Mercurial > hg > easaier-soundaccess
comparison view/PaneStack.cpp @ 204:c5970f7af886
remove in the preferences the possibility to have one property box per panes
author | lbajardsilogic |
---|---|
date | Wed, 30 Jan 2008 09:06:08 +0000 |
parents | 33105d5afff8 |
children |
comparison
equal
deleted
inserted
replaced
203:74d1b3bda5a3 | 204:c5970f7af886 |
---|---|
37 PaneStack::PaneStack(QWidget *parent, ViewManager *viewManager) : | 37 PaneStack::PaneStack(QWidget *parent, ViewManager *viewManager) : |
38 QFrame(parent), | 38 QFrame(parent), |
39 m_currentPane(0), | 39 m_currentPane(0), |
40 m_splitter(new QSplitter), | 40 m_splitter(new QSplitter), |
41 m_propertyStackStack(new QStackedWidget), | 41 m_propertyStackStack(new QStackedWidget), |
42 m_viewManager(viewManager), | 42 m_viewManager(viewManager) |
43 m_layoutStyle(PropertyStackPerPaneLayout) | |
44 { | 43 { |
45 QHBoxLayout *layout = new QHBoxLayout; | 44 QHBoxLayout *layout = new QHBoxLayout; |
46 layout->setMargin(0); | 45 layout->setMargin(0); |
47 layout->setSpacing(0); | 46 layout->setSpacing(0); |
48 | 47 |
115 for (std::vector<PaneRec>::iterator i = m_panes.begin(); | 114 for (std::vector<PaneRec>::iterator i = m_panes.begin(); |
116 i != m_panes.end(); ++i) { | 115 i != m_panes.end(); ++i) { |
117 i->propertyStack->setMinimumWidth(mw); | 116 i->propertyStack->setMinimumWidth(mw); |
118 } | 117 } |
119 m_propertyStackMinWidth = mw; | 118 m_propertyStackMinWidth = mw; |
120 } | |
121 | |
122 void | |
123 PaneStack::setLayoutStyle(LayoutStyle style) | |
124 { | |
125 if (style == m_layoutStyle) return; | |
126 m_layoutStyle = style; | |
127 | |
128 std::vector<PaneRec>::iterator i; | |
129 | |
130 switch (style) { | |
131 | |
132 case NoPropertyStacks: | |
133 case SinglePropertyStackLayout: | |
134 | |
135 for (i = m_panes.begin(); i != m_panes.end(); ++i) { | |
136 i->layout->removeWidget(i->propertyStack); | |
137 i->propertyStack->setParent(m_propertyStackStack); | |
138 m_propertyStackStack->addWidget(i->propertyStack); | |
139 } | |
140 m_propertyStackStack->setVisible(style != NoPropertyStacks); | |
141 break; | |
142 | |
143 case PropertyStackPerPaneLayout: | |
144 | |
145 for (i = m_panes.begin(); i != m_panes.end(); ++i) { | |
146 m_propertyStackStack->removeWidget(i->propertyStack); | |
147 i->propertyStack->setParent(i->frame); | |
148 i->layout->addWidget(i->propertyStack); | |
149 i->propertyStack->show(); | |
150 } | |
151 m_propertyStackStack->hide(); | |
152 break; | |
153 } | |
154 } | 119 } |
155 | 120 |
156 Pane * | 121 Pane * |
157 PaneStack::getPane(int n) | 122 PaneStack::getPane(int n) |
158 { | 123 { |
291 bool found = false; | 256 bool found = false; |
292 | 257 |
293 while (i != m_panes.end()) { | 258 while (i != m_panes.end()) { |
294 if (i->pane == pane) { | 259 if (i->pane == pane) { |
295 i->currentIndicator->setPixmap(selectedMap); | 260 i->currentIndicator->setPixmap(selectedMap); |
296 if (m_layoutStyle != PropertyStackPerPaneLayout) { | 261 m_propertyStackStack->setCurrentWidget(i->propertyStack); |
297 m_propertyStackStack->setCurrentWidget(i->propertyStack); | 262 found = true; |
298 } | |
299 found = true; | |
300 | 263 |
301 QFrame* frame = (QFrame*) (i->pane->parentWidget()); | 264 QFrame* frame = (QFrame*) (i->pane->parentWidget()); |
302 if(frame!=0){ | 265 if(frame!=0){ |
303 frame->setLineWidth(2); | 266 frame->setLineWidth(2); |
304 } | 267 } |