treeWidget->clear();
treeWidget->setColumnCount(1);
treeWidget->setHeaderLabel("Select Page");
-// treeWidget->addAction(actionUndock);
treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
m_pages = 0;
/*
* Called with a change of the highlighed tree widget item in the page selector.
*/
-
void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *previousitem)
{
int treeindex;
docktext += item->text(0) += " Window";
actionToggleDock->setText(docktext);
+ setTreeWidgetItemDockColor(page, item);
+}
+
+/*
+ * Function to set the color of the tree widget item based on whether it is
+ * docked or not.
+ */
+void MainWin::setTreeWidgetItemDockColor( Pages* page, QTreeWidgetItem* item )
+{
+ if( item->text(0) != "Console" ){
+ if( page->isDocked() ){
+ /* Set the brush to blue if undocked */
+ QBrush blackBrush(Qt::black);
+ item->setForeground(0, blackBrush);
+ } else {
+ /* Set the brush back to black if docked */
+ QBrush blueBrush(Qt::blue);
+ item->setForeground(0, blueBrush);
+ }
+ }
}
void MainWin::stackItemChanged(int)
void writeSettings();
void readSettings();
void resetFocus() { lineEdit->setFocus(); };
-
+ void setContextMenuDockText();
+ void setContextMenuDockText(Pages *, QTreeWidgetItem *);
+ void setTreeWidgetItemDockColor(Pages *, QTreeWidgetItem *);
public slots:
void input_line();
void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
void stackItemChanged(int);
void toggleDockContextWindow();
- void setContextMenuDockText();
- void setContextMenuDockText(Pages *, QTreeWidgetItem *);
protected:
void closeEvent(QCloseEvent *event);
*/
#include "pages.h"
+#include "bat.h"
/*
* dockPage
{
/* A Widget was closed, lets toggle it back into the window, and set it in front. */
dockPage();
+ mainWin->setContextMenuDockText();
+// setTreeWidgetItemDockColor(page, item);
+// foreach(Pages *page, m_pagehash){
+// if
+// }
#ifdef xxx
/* FIXME Really having problems getting it to the front,