VirtualBox

Changeset 67372 in vbox


Ignore:
Timestamp:
Jun 13, 2017 2:43:54 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector UI: Tools pane: Snapshot pane: Adjusting details elements minimum size-hint calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp

    r67312 r67372  
    199199QSize UISnapshotDetailsElement::minimumSizeHint() const
    200200{
    201     /* Calculate minimum size-hint on the basis of margin, text-document ideal width and size: */
     201    /* Calculate minimum size-hint on the basis of:
     202     * 1. context and text-documnt margins, 2. text-document ideal width and height: */
     203    int iTop = 0, iLeft = 0, iRight = 0, iBottom = 0;
     204    layout()->getContentsMargins(&iTop, &iLeft, &iRight, &iBottom);
     205    const QSize size = m_pTextEdit->document()->size().toSize();
    202206    const int iDocumentMargin = (int)m_pTextEdit->document()->documentMargin();
    203     const int iIdealWidth = (int)m_pTextEdit->document()->idealWidth() + 2 * iDocumentMargin;
    204     QSize size = m_pTextEdit->document()->size().toSize();
    205     size += QSize(2 * iDocumentMargin, 2 * iDocumentMargin);
    206     return QSize(iIdealWidth, size.height());
     207    const int iIdealWidth = (int)m_pTextEdit->document()->idealWidth() + 2 * iDocumentMargin + iLeft + iRight;
     208    const int iIdealHeight = size.height() + 2 * iDocumentMargin + iTop + iBottom;
     209    return QSize(iIdealWidth, iIdealHeight);
    207210}
    208211
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