VirtualBox

Changeset 21739 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 21, 2009 11:26:06 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 3948: Mini-ToolBar for Full-screen & Seamless modes: Fixed multi-monitor issue (ToolBar missed on other screens except the first one).

File:
1 edited

Legend:

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

    r20757 r21739  
    216216    if (aEvent->timerId() == mScrollTimer.timerId())
    217217    {
     218        QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (window()) :
     219                                   QApplication::desktop()->screenGeometry (window());
    218220        switch (mAlignment)
    219221        {
    220222            case AlignTop:
    221223            {
    222                 if (((mPositionY == 0) && mSlideToScreen) ||
    223                     ((mPositionY == - height() + 1) && !mSlideToScreen))
     224                if (((mPositionY == screen.y()) && mSlideToScreen) ||
     225                    ((mPositionY == screen.y() - height() + 1) && !mSlideToScreen))
    224226                {
    225227                    mScrollTimer.stop();
     
    236238            case AlignBottom:
    237239            {
    238                 QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (this) :
    239                                            QApplication::desktop()->screenGeometry (this);
    240                 if (((mPositionY == screen.height() - height()) && mSlideToScreen) ||
    241                     ((mPositionY == screen.height() - 1) && !mSlideToScreen))
     240                if (((mPositionY == screen.y() + screen.height() - height()) && mSlideToScreen) ||
     241                    ((mPositionY == screen.y() + screen.height() - 1) && !mSlideToScreen))
    242242                {
    243243                    mScrollTimer.stop();
     
    377377void VBoxMiniToolBar::moveToBase()
    378378{
    379     QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (this) :
    380                                QApplication::desktop()->screenGeometry (this);
    381     mPositionX = screen.width() / 2 - width() / 2;
     379    QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (window()) :
     380                               QApplication::desktop()->screenGeometry (window());
     381    mPositionX = screen.x() + screen.width() / 2 - width() / 2;
    382382    switch (mAlignment)
    383383    {
    384384        case AlignTop:
    385385        {
    386             mPositionY = - height() + 1;
     386            mPositionY = screen.y() - height() + 1;
    387387            break;
    388388        }
    389389        case AlignBottom:
    390390        {
    391             mPositionY = screen.height() - 1;
     391            mPositionY = screen.y() + screen.height() - 1;
    392392            break;
    393393        }
     
    404404{
    405405    QPoint globalPosition = parentWidget()->mapFromGlobal (aPoint);
    406     QRect fullArea = QApplication::desktop()->screenGeometry (this);
    407     QRect realArea = mSeamless ? QApplication::desktop()->availableGeometry (this) :
    408                                  QApplication::desktop()->screenGeometry (this);
     406    QRect fullArea = QApplication::desktop()->screenGeometry (window());
     407    QRect realArea = mSeamless ? QApplication::desktop()->availableGeometry (window()) :
     408                                 QApplication::desktop()->screenGeometry (window());
    409409    QPoint shiftToReal (realArea.topLeft() - fullArea.topLeft());
    410410    return globalPosition + shiftToReal;
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