Mercurial > hg > svgui
comparison view/PaneStack.cpp @ 516:e4e0ae491a48
* Attempt to pick more sensible default centre frame for newly created view
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2009 16:46:27 +0000 |
parents | 666cdcae5f0d |
children | 566787389e59 |
comparison
equal
deleted
inserted
replaced
515:ff1dc4f302bd | 516:e4e0ae491a48 |
---|---|
80 layout->addWidget(currentIndicator, 1, 0); | 80 layout->addWidget(currentIndicator, 1, 0); |
81 layout->setRowStretch(1, 20); | 81 layout->setRowStretch(1, 20); |
82 currentIndicator->setMinimumWidth(8); | 82 currentIndicator->setMinimumWidth(8); |
83 currentIndicator->setScaledContents(true); | 83 currentIndicator->setScaledContents(true); |
84 | 84 |
85 long initialCentreFrame = -1; | |
86 for (int i = 0; i < m_panes.size(); ++i) { | |
87 long f = m_panes[i].pane->getCentreFrame(); | |
88 initialCentreFrame = f; | |
89 break; | |
90 } | |
91 | |
85 Pane *pane = new Pane(frame); | 92 Pane *pane = new Pane(frame); |
86 pane->setViewManager(m_viewManager); | 93 if (initialCentreFrame >= 0) { |
94 pane->setViewManager(m_viewManager, initialCentreFrame); | |
95 } else { | |
96 pane->setViewManager(m_viewManager); | |
97 } | |
87 layout->addWidget(pane, 0, 1, 2, 1); | 98 layout->addWidget(pane, 0, 1, 2, 1); |
88 layout->setColumnStretch(1, 20); | 99 layout->setColumnStretch(1, 20); |
89 | 100 |
90 m_xButtonMap[xButton] = pane; | 101 m_xButtonMap[xButton] = pane; |
91 | 102 |