Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
189:5b7472db612b | 190:53835534a9d3 |
---|---|
16 #include "PropertyStack.h" | 16 #include "PropertyStack.h" |
17 #include "PropertyBox.h" | 17 #include "PropertyBox.h" |
18 #include "base/PropertyContainer.h" | 18 #include "base/PropertyContainer.h" |
19 #include "view/View.h" | 19 #include "view/View.h" |
20 #include "layer/Layer.h" | 20 #include "layer/Layer.h" |
21 #include "widgets/NotifyingTabBar.h" | |
21 | 22 |
22 #include <QIcon> | 23 #include <QIcon> |
23 #include <QTabWidget> | 24 #include <QTabWidget> |
24 | 25 |
25 #include <iostream> | 26 #include <iostream> |
28 | 29 |
29 PropertyStack::PropertyStack(QWidget *parent, View *client) : | 30 PropertyStack::PropertyStack(QWidget *parent, View *client) : |
30 QTabWidget(parent), | 31 QTabWidget(parent), |
31 m_client(client) | 32 m_client(client) |
32 { | 33 { |
34 NotifyingTabBar *bar = new NotifyingTabBar(); | |
35 bar->setDrawBase(false); | |
36 | |
37 connect(bar, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredTabBar())); | |
38 connect(bar, SIGNAL(mouseLeft()), this, SLOT(mouseLeftTabBar())); | |
39 connect(bar, SIGNAL(activeTabClicked()), this, SLOT(activeTabClicked())); | |
40 | |
41 setTabBar(bar); | |
42 | |
33 repopulate(); | 43 repopulate(); |
34 | 44 |
35 connect(this, SIGNAL(currentChanged(int)), | 45 connect(this, SIGNAL(currentChanged(int)), |
36 this, SLOT(selectedContainerChanged(int))); | 46 this, SLOT(selectedContainerChanged(int))); |
37 | 47 |
174 { | 184 { |
175 if (n >= int(m_boxes.size())) return; | 185 if (n >= int(m_boxes.size())) return; |
176 emit propertyContainerSelected(m_client, m_boxes[n]->getContainer()); | 186 emit propertyContainerSelected(m_client, m_boxes[n]->getContainer()); |
177 } | 187 } |
178 | 188 |
189 void | |
190 PropertyStack::mouseEnteredTabBar() | |
191 { | |
192 emit contextHelpChanged(tr("Click to change the current active layer")); | |
193 } | |
194 | |
195 void | |
196 PropertyStack::mouseLeftTabBar() | |
197 { | |
198 emit contextHelpChanged(""); | |
199 } | |
200 | |
201 void | |
202 PropertyStack::activeTabClicked() | |
203 { | |
204 emit viewSelected(m_client); | |
205 } | |
206 | |
179 #ifdef INCLUDE_MOCFILES | 207 #ifdef INCLUDE_MOCFILES |
180 #include "PropertyStack.moc.cpp" | 208 #include "PropertyStack.moc.cpp" |
181 #endif | 209 #endif |
182 | 210 |