VirtualBox

Changeset 9784 in vbox


Ignore:
Timestamp:
Jun 18, 2008 8:28:03 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: Fixed adjustment of the vmsettings selector width.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsDlg.cpp

    r9782 r9784  
    130130    mTwSelector->hideColumn (listView_Id);
    131131    mTwSelector->hideColumn (listView_Link);
    132 
    133     /* Adjust selector list */
    134     int minWid = 0;
    135     for (int i = 0; i < mTwSelector->topLevelItemCount(); ++ i)
    136     {
    137         QTreeWidgetItem *item = mTwSelector->topLevelItem (i);
    138         QFontMetrics fm (item->font (0));
    139         int wid = fm.width (item->text (0)) +
    140                   16 /* icon */ + 2 * 8 /* 2 margins */;
    141         minWid = wid > minWid ? wid : minWid;
    142         int hei = fm.height() > 16 ?
    143                   fm.height() /* text height */ :
    144                   16 /* icon */ + 2 * 2 /* 2 margins */;
    145         item->setSizeHint (0, QSize (wid, hei));
    146     }
    147     mTwSelector->setFixedWidth (minWid);
    148 
    149     /* Sort selector by the id column (to have pages in the desired order) */
    150     mTwSelector->sortItems (listView_Id, Qt::AscendingOrder);
    151132
    152133    /* Initially select the first settings page */
     
    308289    mTwSelector->setCurrentItem (mTwSelector->topLevelItem (ci));
    309290
     291    /* Adjust selector list */
     292    mTwSelector->setFixedWidth (static_cast<QAbstractItemView*> (mTwSelector)->sizeHintForColumn (0) + 2 * mTwSelector->frameWidth());
     293
     294    /* Sort selector by the id column (to have pages in the desired order) */
     295    mTwSelector->sortItems (listView_Id, Qt::AscendingOrder);
     296    mTwSelector->resizeColumnToContents (0);
     297
    310298    mWarnIconLabel->setWarningText (tr ("Invalid settings detected"));
    311299    mButtonBox->button (QDialogButtonBox::Ok)->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog."));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette