- Timestamp:
- Nov 11, 2010 6:23:37 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r33631 r34004 163 163 void UISettingsDialog::sltCategoryChanged(int cId) 164 164 { 165 QWidget *pRootPage = m_pSelector->rootPage(cId);165 int index = m_pages[cId]; 166 166 #ifdef Q_WS_MAC 167 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); 168 if (index < m_sizeList.count()) 169 { 170 QSize ss = m_sizeList.at(index); 178 171 /* Switch to the new page first if we are shrinking: */ 179 172 if (cs.height() > ss.height()) 180 m_pStack->setCurrentIndex( m_pStack->indexOf(pRootPage));173 m_pStack->setCurrentIndex(index); 181 174 /* Do the animation: */ 182 175 ::darwinWindowAnimateResize(this, QRect (x(), y(), ss.width(), ss.height())); 183 176 /* Switch to the new page last if we are zooming: */ 184 177 if (cs.height() <= ss.height()) 185 m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage)); 186 /* Make the widget fixed size: */ 187 setFixedSize(ss); 178 m_pStack->setCurrentIndex(index); 188 179 } 189 180 ::darwinSetShowsResizeIndicator(this, false); 190 181 #else 191 182 m_pLbTitle->setText(m_pSelector->itemText(cId)); 192 m_pStack->setCurrentIndex( m_pStack->indexOf(pRootPage));183 m_pStack->setCurrentIndex(index); 193 184 #endif 194 185 #ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS … … 281 272 cId, strLink, pSettingsPage, iParentId); 282 273 if (pPage) 283 m_pStack->addWidget(pPage); 274 { 275 #ifdef Q_WS_MAC 276 /* On OSX we add a stretch to the vertical end to make sure the page is 277 * always top aligned. */ 278 QWidget *pW = new QWidget(); 279 pW->setContentsMargins(0, 0, 0, 0); 280 QVBoxLayout *pBox = new QVBoxLayout(pW); 281 VBoxGlobal::setLayoutMargin(pBox, 0); 282 pBox->addWidget(pPage); 283 pBox->addStretch(0); 284 m_pages[cId] = m_pStack->addWidget(pW); 285 #else /* Q_WS_MAC */ 286 m_pages[cId] = m_pStack->addWidget(pPage); 287 #endif /* !Q_WS_MAC */ 288 } 284 289 if (pSettingsPage) 285 290 assignValidator(pSettingsPage); … … 474 479 { 475 480 m_pStack->widget(i)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 481 /* Prevent this widgets to go in the Small/Mini size state which is 482 * available on Mac OS X. Not sure why this happens but this seems to help 483 * against. */ 484 QList <QWidget*> list = m_pStack->widget(i)->findChildren<QWidget*>(); 485 for (int a = 0; a < list.size(); ++a) 486 { 487 QWidget *w = list.at(a); 488 if (w->parent() == m_pStack->widget(i)) 489 w->setFixedHeight(w->sizeHint().height()); 490 } 476 491 m_pStack->setCurrentIndex(i); 492 /* Now make sure the layout is freshly calculated. */ 477 493 layout()->activate(); 478 494 QSize s = minimumSize(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r33631 r34004 117 117 QPointer<QWidget> m_pWhatsThisCandidate; 118 118 119 QMap<int, int> m_pages; 119 120 #ifdef Q_WS_MAC 120 121 QList<QSize> m_sizeList; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui
r33882 r34004 131 131 <property name="sizeHint" > 132 132 <size> 133 <width> 20</width>134 <height> 40</height>133 <width>0</width> 134 <height>0</height> 135 135 </size> 136 136 </property> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r33906 r34004 59 59 connect (mTbMAC, SIGNAL (clicked()), this, SLOT (generateMac())); 60 60 connect (mPbPortForwarding, SIGNAL (clicked()), this, SLOT (sltOpenPortForwardingDlg())); 61 62 #ifdef Q_WS_MAC63 /* Prevent this widgets to go in the Small/Mini size state which is64 * available on Mac OS X. Not sure why this happens but this seems to help65 * against. */66 QList <QWidget*> list = findChildren <QWidget*>();67 foreach (QWidget *w, list)68 if (w->parent() == this)69 w->setFixedHeight (w->sizeHint().height());70 #endif /* Q_WS_MAC */71 61 72 62 /* Applying language settings */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r33932 r34004 47 47 * 1. Floppy, 2. DVD-ROM, 3. Hard Disk, 4. Network. 48 48 * But maximum boot devices count supported by machine 49 * should be retr eived through the ISystemProperties getter.49 * should be retrieved through the ISystemProperties getter. 50 50 * Moreover, possible boot device types are not listed in some separate Main vector, 51 51 * so we should get them (randomely?) from the list of all device types. … … 74 74 } 75 75 76 /* Add all available devices types, so we could initially calculate the 77 * right size. */ 78 for (int i = 0; i < m_possibleBootItems.size(); ++i) 79 { 80 QString name = vboxGlobal().toString(m_possibleBootItems[i]); 81 QTreeWidgetItem *pItem = new QTreeWidgetItem(QStringList(name)); 82 pItem->setData(0, ITEM_TYPE_ROLE, QVariant(m_possibleBootItems[i])); 83 pItem->setCheckState(0, Qt::Unchecked); 84 mTwBootOrder->addTopLevelItem(pItem); 85 } 86 76 87 /* Setup validators */ 77 88 mLeMemory->setValidator (new QIntValidator (mSlMemory->minRAM(), mSlMemory->maxRAM(), this)); … … 220 231 void UIMachineSettingsSystem::getFromCache() 221 232 { 233 /* Remove any old data in the boot view. */ 234 QAbstractItemView *iv = qobject_cast <QAbstractItemView*> (mTwBootOrder); 235 iv->model()->removeRows(0, iv->model()->rowCount()); 222 236 /* Apply internal variables data to QWidget(s): */ 223 237 for (int i = 0; i < m_cache.m_bootItems.size(); ++i) … … 246 260 int iChipsetPositionPos = mCbChipset->findData(m_cache.m_chipsetType); 247 261 mCbChipset->setCurrentIndex(iChipsetPositionPos == -1 ? 0 : iChipsetPositionPos); 248 adjustBootOrderTWSize();249 262 if (!m_cache.m_fPFHwVirtExSupported) 250 263 mTwSystem->removeTab(2); … … 529 542 int h = 2 * mTwBootOrder->frameWidth(); 530 543 int w = h; 531 #ifdef Q_WS_MAC 532 int left, top, right, bottom; 533 mTwBootOrder->getContentsMargins (&left, &top, &right, &bottom); 534 h += top + bottom; 535 w += left + right; 536 #else /* Q_WS_MAC */ 537 w += 4; 538 #endif /* Q_WS_MAC */ 539 mTwBootOrder->setFixedSize ( 540 iv->sizeHintForColumn (0) + w, 541 iv->sizeHintForRow (0) * mTwBootOrder->topLevelItemCount() + h); 544 mTwBootOrder->setFixedSize( 545 iv->sizeHintForColumn(0) + w, 546 iv->sizeHintForRow(0) * mTwBootOrder->topLevelItemCount() + h); 542 547 543 548 /* Update the layout system */
Note:
See TracChangeset
for help on using the changeset viewer.