VirtualBox

Changeset 102042 in vbox


Ignore:
Timestamp:
Nov 9, 2023 5:01:02 PM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160147
Message:

FE/Qt: bugref:10513: VM Settings / System page / Motherboard tab: Adjust default size-hint for Boot table; Initially it's empty and fix allows to get rid of unwanted flicker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIBootOrderEditor.cpp

    r101974 r102042  
    225225QSize UIBootListWidget::minimumSizeHint() const
    226226{
     227    /* Try to get actual item count: */
     228    int iItemCount = topLevelItemCount();
     229    /* [By default] calculate for 4 items: */
     230    if (iItemCount < 1)
     231        iItemCount = 4;
     232
     233    /* Try to get actual size-hints for column/row: */
     234    int iColumnHint = sizeHintForColumn(0);
     235    int iRowHint = sizeHintForRow(0);
     236    /* [By default] calculate for 15 chars: */
     237    if (iColumnHint < 1 || iRowHint < 1)
     238    {
     239        QFontMetrics fm(font());
     240        iColumnHint = 15 * fm.averageCharWidth();
     241        iRowHint = fm.height() + 2 * 3; /// @todo <= tree-widget item margin
     242    }
     243
     244    /* Take into account table frame as well: */
    227245    const int iH = 2 * frameWidth();
    228246    const int iW = iH;
    229     return QSize(sizeHintForColumn(0) + iW,
    230                  sizeHintForRow(0) * topLevelItemCount() + iH);
    231 
     247
     248    /* Calculate tree-widget hint finally: */
     249    return QSize(iColumnHint + iW, iRowHint * iItemCount + iH);
    232250}
    233251
Note: See TracChangeset for help on using the changeset viewer.

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