Changeset 10717 in vbox for trunk/src/VBox
- Timestamp:
- Jul 17, 2008 10:30:35 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33442
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsDialog.h
r10604 r10717 89 89 QTimer *mWhatsThisTimer; 90 90 QWidget *mWhatsThisCandidate; 91 92 #ifdef Q_WS_MAC 93 QList<QSize> mSizeList; 94 #endif /* Q_WS_MAC */ 91 95 }; 92 96 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialog.cpp
r10604 r10717 199 199 mStack->setCurrentIndex (mStack->indexOf (rootPage)); 200 200 #else /* Q_WS_MAC */ 201 /* We will update at once later */202 setUpdatesEnabled (false);201 QSize cs = size(); 202 /* First make all fully resizeable */ 203 203 setMinimumSize (QSize (minimumWidth(), 0)); 204 204 setMaximumSize (QSize (minimumWidth(), QWIDGETSIZE_MAX)); 205 /* Set all tab size policies to ignored */ 206 QList<QWidget*> list = mSelector->rootPages (); 207 for (int i = 0; i < list.count(); ++i) 208 list.at (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored); 209 /* Set the size policy of the current tab to preferred */ 210 if (mStack->widget (mStack->indexOf (rootPage))) 211 mStack->widget (mStack->indexOf (rootPage))->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred); 212 /* Set the new current tab */ 213 mLbTitle->setText (mSelector->itemText (aId)); 214 mStack->setCurrentIndex (mStack->indexOf (rootPage)); 215 /* Activate the new layout */ 216 layout()->activate(); 217 setUpdatesEnabled (true); 218 // mAllWidget->hide(); 219 QSize s = minimumSize(); 220 int minWidth = mSelector->minWidth(); 221 if (minWidth > s.width()) 222 s.setWidth (minWidth); 223 /* Play the resize animation */ 224 ::darwinWindowAnimateResize (this, QRect (x(), y(), 225 s.width(), s.height())); 226 // mAllWidget->show(); 227 /* Set the new size to Qt also */ 228 setFixedSize (s); 205 for (int i = 0; i < mStack->count(); ++i) 206 mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored); 207 int a = mStack->indexOf (rootPage); 208 if (a < mSizeList.count()) 209 { 210 QSize ss = mSizeList.at (a); 211 mStack->widget (a)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred); 212 /* Switch to the new page first if we are shrinking */ 213 if (cs.height() > ss.height()) 214 mStack->setCurrentIndex (mStack->indexOf (rootPage)); 215 /* Do the animation */ 216 ::darwinWindowAnimateResize (this, QRect (x(), y(), 217 ss.width(), ss.height())); 218 /* Switch to the new page last if we are zooming */ 219 if (cs.height() <= ss.height()) 220 mStack->setCurrentIndex (mStack->indexOf (rootPage)); 221 /* Make the widget fixed size */ 222 setFixedSize (ss); 223 } 229 224 #endif /* !Q_WS_MAC */ 230 225 # ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS … … 327 322 { 328 323 QIMainDialog::showEvent (aEvent); 329 330 324 /* One may think that QWidget::polish() is the right place to do things 331 325 * below, but apparently, by the time when QWidget::polish() is called, … … 339 333 mPolished = true; 340 334 335 #ifdef Q_WS_MAC 336 /* Set all size policies to ignored */ 337 for (int i = 0; i < mStack->count(); ++i) 338 mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored); 339 /* Activate every single page to get the optimal size */ 340 for (int i = mStack->count() - 1; i >= 0; --i) 341 { 342 mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred); 343 mStack->setCurrentIndex (i); 344 layout()->activate(); 345 mSizeList.insert (0, minimumSize()); 346 mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored); 347 } 348 349 categoryChanged (mSelector->currentId()); 350 #else /* Q_WS_MAC */ 341 351 /* Resize to the minimum possible size */ 342 352 int minWidth = mSelector->minWidth(); … … 344 354 if (minWidth > s.width()) 345 355 s.setWidth (minWidth); 346 #ifdef Q_WS_MAC347 categoryChanged (mSelector->currentId());348 #else /* Q_WS_MAC */349 356 resize (s); 350 357 #endif /* Q_WS_MAC */
Note:
See TracChangeset
for help on using the changeset viewer.