VirtualBox

儲存庫 vbox 的更動 63230


忽略:
時間撮記:
2016-8-9 下午05:18:44 (8 年 以前)
作者:
vboxsync
訊息:

FE/Qt: bugref:7625: Runtime UI: Normalization for Scaled mode as well, useful for pushing windows to visible area (same as for Normal mode but without touching a size).

位置:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r63054 r63230  
    123123            setGeometry(m_normalGeometry);
    124124        }
     125
     126        /* Normalize to the optimal size: */
     127#ifdef VBOX_WS_X11
     128        QTimer::singleShot(0, this, SLOT(sltNormalizeGeometry()));
     129#else /* !VBOX_WS_X11 */
     130        normalizeGeometry(true /* adjust position */);
     131#endif /* !VBOX_WS_X11 */
    125132    }
    126133}
     
    173180    /* Adjust machine-view accordingly: */
    174181    adjustMachineViewSize();
     182}
     183
     184void UIMachineWindowScale::normalizeGeometry(bool fAdjustPosition)
     185{
     186#ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1
     187    /* Skip if maximized: */
     188    if (isMaximized())
     189        return;
     190
     191    /* Calculate client window offsets: */
     192    QRect frGeo = frameGeometry();
     193    const QRect geo = geometry();
     194    const int dl = geo.left() - frGeo.left();
     195    const int dt = geo.top() - frGeo.top();
     196    const int dr = frGeo.right() - geo.right();
     197    const int db = frGeo.bottom() - geo.bottom();
     198
     199    /* Adjust position if necessary: */
     200    if (fAdjustPosition)
     201        frGeo = VBoxGlobal::normalizeGeometry(frGeo, gpDesktop->overallAvailableRegion());
     202
     203    /* Finally, set the frame geometry: */
     204    setGeometry(frGeo.left() + dl, frGeo.top() + dt,
     205                frGeo.width() - dl - dr, frGeo.height() - dt - db);
     206#else /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */
     207    /* Customer request: There should no be
     208     * machine-window resize/move on machine-view resize: */
     209    Q_UNUSED(fAdjustPosition);
     210#endif /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */
    175211}
    176212
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h

    r62913 r63230  
    5757    virtual void restoreCachedGeometry() /* override */;
    5858
     59    /** Performs window geometry normalization according to guest-size and host's available geometry.
     60      * @param  fAdjustPosition  Determines whether is it necessary to adjust position as well. */
     61    virtual void normalizeGeometry(bool fAdjustPosition) /* override */;
     62
    5963    /** Common @a pEvent handler. */
    6064    bool event(QEvent *pEvent);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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