VirtualBox

Changeset 99602 in vbox for trunk


Ignore:
Timestamp:
May 4, 2023 12:43:21 PM (17 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6832: Snapshot pane: Make sure snapshot-item name is always visible even at the cost of horizontal scroll-bar presence; That is very important in huge snapshot-trees with tons of items to see their names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r99567 r99602  
    17551755    /* Calculate the total snapshot tree width: */
    17561756    const int iTotal = m_pSnapshotTree->viewport()->width();
    1757     /* Look for a minimum width hints for non-important columns: */
     1757
     1758    /* Look for a minimum width hint for Taken column: */
    17581759    const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(Column_Taken), pItemHeader->sectionSizeHint(Column_Taken));
    1759     /* Propose suitable width hints for non-important columns: */
     1760    /* Propose suitable width hint for Taken column (but no more than the half of existing space): */
    17601761    const int iWidth1 = iMinWidth1 < iTotal / Column_Max ? iMinWidth1 : iTotal / Column_Max;
     1762
     1763    /* Look for a minimum width hint for Name column: */
     1764    const int iMinWidth0 = qMax(pItemView->sizeHintForColumn(Column_Name), pItemHeader->sectionSizeHint(Column_Name));
     1765    /* Propose suitable width hint for important column (at least all remaining space and no less than the hint itself): */
     1766    const int iWidth0 = iMinWidth0 > iTotal - iWidth1 ? iMinWidth0 : iTotal - iWidth1;
     1767
    17611768    /* Apply the proposal: */
    17621769    m_pSnapshotTree->setColumnWidth(Column_Taken, iWidth1);
    1763     m_pSnapshotTree->setColumnWidth(Column_Name, iTotal - iWidth1);
     1770    m_pSnapshotTree->setColumnWidth(Column_Name, iWidth0);
    17641771}
    17651772
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