Changeset 33631 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
- Timestamp:
- Nov 1, 2010 6:35:05 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r33540 r33631 161 161 } 162 162 163 void UISettingsDialog::sltCategoryChanged(int cId) 164 { 165 QWidget *pRootPage = m_pSelector->rootPage(cId); 166 #ifdef Q_WS_MAC 167 QSize cs = size(); 168 /* First make all fully resizeable: */ 169 setMinimumSize(QSize(minimumWidth(), 0)); 170 setMaximumSize(QSize(minimumWidth(), QWIDGETSIZE_MAX)); 171 for (int i = 0; i < m_pStack->count(); ++i) 172 m_pStack->widget(i)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); 173 int a = m_pStack->indexOf(pRootPage); 174 if (a < m_sizeList.count()) 175 { 176 QSize ss = m_sizeList.at(a); 177 m_pStack->widget(a)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 178 /* Switch to the new page first if we are shrinking: */ 179 if (cs.height() > ss.height()) 180 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage)); 181 /* Do the animation: */ 182 ::darwinWindowAnimateResize(this, QRect (x(), y(), ss.width(), ss.height())); 183 /* Switch to the new page last if we are zooming: */ 184 if (cs.height() <= ss.height()) 185 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage)); 186 /* Make the widget fixed size: */ 187 setFixedSize(ss); 188 } 189 ::darwinSetShowsResizeIndicator(this, false); 190 #else 191 m_pLbTitle->setText(m_pSelector->itemText(cId)); 192 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage)); 193 #endif 194 #ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS 195 setWindowTitle(title()); 196 #endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */ 197 } 198 163 199 void UISettingsDialog::retranslateUi() 164 200 { … … 371 407 } 372 408 373 void UISettingsDialog::sltCategoryChanged(int cId)374 {375 QWidget *pRootPage = m_pSelector->rootPage(cId);376 #ifdef Q_WS_MAC377 QSize cs = size();378 /* First make all fully resizeable: */379 setMinimumSize(QSize(minimumWidth(), 0));380 setMaximumSize(QSize(minimumWidth(), QWIDGETSIZE_MAX));381 for (int i = 0; i < m_pStack->count(); ++i)382 m_pStack->widget(i)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);383 int a = m_pStack->indexOf(pRootPage);384 if (a < m_sizeList.count())385 {386 QSize ss = m_sizeList.at(a);387 m_pStack->widget(a)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);388 /* Switch to the new page first if we are shrinking: */389 if (cs.height() > ss.height())390 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));391 /* Do the animation: */392 ::darwinWindowAnimateResize(this, QRect (x(), y(), ss.width(), ss.height()));393 /* Switch to the new page last if we are zooming: */394 if (cs.height() <= ss.height())395 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));396 /* Make the widget fixed size: */397 setFixedSize(ss);398 }399 ::darwinSetShowsResizeIndicator(this, false);400 #else401 m_pLbTitle->setText(m_pSelector->itemText(cId));402 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));403 #endif404 #ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS405 setWindowTitle(title());406 #endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */407 }408 409 409 bool UISettingsDialog::eventFilter(QObject *pObject, QEvent *pEvent) 410 410 {
Note:
See TracChangeset
for help on using the changeset viewer.