diff widgets/PropertyStack.cpp @ 190:53835534a9d3

* Allow user to activate a pane by clicking on the tab for its currently active layer. Formerly nothing happened if you clicked on the tab that was already topmost in a given property stack, because the tab widget only emitted a signal if the current tab changed. We want this to switch focus back to the pane if another one has been active in the mean time. * Make the thumbwheels look a bit round.
author Chris Cannam
date Mon, 22 Jan 2007 15:42:00 +0000
parents 5b7472db612b
children 6b023411087b
line wrap: on
line diff
--- a/widgets/PropertyStack.cpp	Fri Jan 19 13:13:14 2007 +0000
+++ b/widgets/PropertyStack.cpp	Mon Jan 22 15:42:00 2007 +0000
@@ -18,6 +18,7 @@
 #include "base/PropertyContainer.h"
 #include "view/View.h"
 #include "layer/Layer.h"
+#include "widgets/NotifyingTabBar.h"
 
 #include <QIcon>
 #include <QTabWidget>
@@ -30,6 +31,15 @@
     QTabWidget(parent),
     m_client(client)
 {
+    NotifyingTabBar *bar = new NotifyingTabBar();
+    bar->setDrawBase(false);
+
+    connect(bar, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredTabBar()));
+    connect(bar, SIGNAL(mouseLeft()), this, SLOT(mouseLeftTabBar()));
+    connect(bar, SIGNAL(activeTabClicked()), this, SLOT(activeTabClicked()));
+
+    setTabBar(bar);
+
     repopulate();
 
     connect(this, SIGNAL(currentChanged(int)),
@@ -176,6 +186,24 @@
     emit propertyContainerSelected(m_client, m_boxes[n]->getContainer());
 }
 
+void
+PropertyStack::mouseEnteredTabBar()
+{
+    emit contextHelpChanged(tr("Click to change the current active layer"));
+}
+
+void
+PropertyStack::mouseLeftTabBar()
+{
+    emit contextHelpChanged("");
+}
+
+void
+PropertyStack::activeTabClicked()
+{
+    emit viewSelected(m_client);
+}
+
 #ifdef INCLUDE_MOCFILES
 #include "PropertyStack.moc.cpp"
 #endif