VirtualBox

Changeset 62225 in vbox


Ignore:
Timestamp:
Jul 13, 2016 4:41:24 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108736
Message:

FE/Qt: bugref:7625: Runtime UI: Normal mode: Normalization mechanism: Cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r62206 r62225  
    513513}
    514514
    515 /**
    516  * Adjusts machine-window size to correspond current guest screen size.
    517  * @param fAdjustPosition determines whether is it necessary to adjust position too.
    518  */
    519515void UIMachineWindowNormal::normalizeGeometry(bool fAdjustPosition)
    520516{
     
    525521
    526522    /* Calculate client window offsets: */
    527     QRect frameGeo = frameGeometry();
     523    QRect frGeo = frameGeometry();
    528524    const QRect geo = geometry();
    529     int dl = geo.left() - frameGeo.left();
    530     int dt = geo.top() - frameGeo.top();
    531     int dr = frameGeo.right() - geo.right();
    532     int db = frameGeo.bottom() - geo.bottom();
     525    const int dl = geo.left() - frGeo.left();
     526    const int dt = geo.top() - frGeo.top();
     527    const int dr = frGeo.right() - geo.right();
     528    const int db = frGeo.bottom() - geo.bottom();
    533529
    534530    /* Get the best size w/o scroll-bars: */
    535     QSize s = sizeHint();
     531    QSize sh = sizeHint();
    536532
    537533    /* If guest-screen auto-resize is not enabled
     
    541537    {
    542538        if (machineView()->verticalScrollBar()->isVisible())
    543             s -= QSize(machineView()->verticalScrollBar()->sizeHint().width(), 0);
     539            sh -= QSize(machineView()->verticalScrollBar()->sizeHint().width(), 0);
    544540        if (machineView()->horizontalScrollBar()->isVisible())
    545             s -= QSize(0, machineView()->horizontalScrollBar()->sizeHint().height());
     541            sh -= QSize(0, machineView()->horizontalScrollBar()->sizeHint().height());
    546542    }
    547543
    548544    /* Resize the frame to fit the contents: */
    549     s -= size();
    550     frameGeo.setRight(frameGeo.right() + s.width());
    551     frameGeo.setBottom(frameGeo.bottom() + s.height());
     545    sh -= size();
     546    frGeo.setRight(frGeo.right() + sh.width());
     547    frGeo.setBottom(frGeo.bottom() + sh.height());
    552548
    553549    /* Adjust position if necessary: */
    554550    if (fAdjustPosition)
    555         frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, vboxGlobal().availableGeometry(pos()));
     551        frGeo = VBoxGlobal::normalizeGeometry(frGeo, vboxGlobal().availableGeometry(pos()));
    556552
    557553    /* Finally, set the frame geometry: */
    558     setGeometry(frameGeo.left() + dl, frameGeo.top() + dt,
    559                 frameGeo.width() - dl - dr, frameGeo.height() - dt - db);
     554    setGeometry(frGeo.left() + dl, frGeo.top() + dt,
     555                frGeo.width() - dl - dr, frGeo.height() - dt - db);
    560556#else /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */
    561557    /* Customer request: There should no be
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r62206 r62225  
    113113    void showInNecessaryMode();
    114114
    115     /** Normalizes geometry according to guest-size. */
     115    /** Performs window geometry normalization according to guest-size and host's available geometry.
     116      * @param  fAdjustPosition  Determines whether is it necessary to adjust position as well. */
    116117    void normalizeGeometry(bool fAdjustPosition);
    117118
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