VirtualBox

Changeset 34168 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 18, 2010 12:48:19 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: fix selector pos/size on save/restore for newer Qt versions

File:
1 edited

Legend:

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

    r34096 r34168  
    200200#define BIG_TOOLBAR
    201201#if MAC_LEOPARD_STYLE
    202     /* Enable unified toolbars on Mac OS X. Available on Qt >= 4.3 */
    203202    addToolBar(mVMToolBar);
    204     mVMToolBar->setMacToolbar();
    205203    /* Central widget @ horizontal layout */
    206204    setCentralWidget(m_pSplitter);
     
    346344        {
    347345            mNormalGeo.moveTo(x, y);
    348             mNormalGeo.setSize(QSize(w, h).expandedTo(minimumSizeHint())
    349                                           .boundedTo(ar.size()));
     346            mNormalGeo.setSize(QSize(w, h)
     347                               .expandedTo(minimumSizeHint())
     348                               .boundedTo(ar.size()));
     349#if defined(Q_WS_MAC) && (QT_VERSION >= 0x040700)
     350            move(mNormalGeo.topLeft());
     351            resize(mNormalGeo.size());
     352            mNormalGeo = normalGeometry();
     353#else /* defined(Q_WS_MAC) && (QT_VERSION >= 0x040700) */
    350354            setGeometry(mNormalGeo);
     355#endif /* !(defined(Q_WS_MAC) && (QT_VERSION >= 0x040700)) */
    351356            if (max) /* maximize if needed */
    352357                showMaximized();
     
    360365        }
    361366    }
     367#if MAC_LEOPARD_STYLE
     368    /* Enable unified toolbars on Mac OS X. Available on Qt >= 4.3. We do this
     369     * after setting the window pos/size, cause Qt sometime includes the
     370     * toolbar height in the content height. */
     371    mVMToolBar->setMacToolbar();
     372#endif /* MAC_LEOPARD_STYLE */
    362373
    363374    /* Update the list */
     
    473484    /* Save the position of the window */
    474485    {
    475         int y = mNormalGeo.y();
     486#if defined(Q_WS_MAC) && (QT_VERSION >= 0x040700)
     487        QRect frameGeo = frameGeometry();
     488        QRect save(frameGeo.x(), frameGeo.y(), mNormalGeo.width(), mNormalGeo.height());
     489#else /* defined(Q_WS_MAC) && (QT_VERSION >= 0x040700) */
     490        QRect save(mNormalGeo);
     491#endif /* !(defined(Q_WS_MAC) && (QT_VERSION >= 0x040700)) */
    476492        QString winPos = QString("%1,%2,%3,%4")
    477             .arg(mNormalGeo.x()).arg(y)
    478             .arg(mNormalGeo.width()).arg(mNormalGeo.height());
     493            .arg(save.x()).arg(save.y())
     494            .arg(save.width()).arg(save.height());
    479495#ifdef Q_WS_MAC
    480496        UIWindowMenuManager::destroy();
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