Changeset 21739 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 21, 2009 11:26:06 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMiniToolBar.cpp
r20757 r21739 216 216 if (aEvent->timerId() == mScrollTimer.timerId()) 217 217 { 218 QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (window()) : 219 QApplication::desktop()->screenGeometry (window()); 218 220 switch (mAlignment) 219 221 { 220 222 case AlignTop: 221 223 { 222 if (((mPositionY == 0) && mSlideToScreen) ||223 ((mPositionY == - height() + 1) && !mSlideToScreen))224 if (((mPositionY == screen.y()) && mSlideToScreen) || 225 ((mPositionY == screen.y() - height() + 1) && !mSlideToScreen)) 224 226 { 225 227 mScrollTimer.stop(); … … 236 238 case AlignBottom: 237 239 { 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)) 242 242 { 243 243 mScrollTimer.stop(); … … 377 377 void VBoxMiniToolBar::moveToBase() 378 378 { 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; 382 382 switch (mAlignment) 383 383 { 384 384 case AlignTop: 385 385 { 386 mPositionY = - height() + 1;386 mPositionY = screen.y() - height() + 1; 387 387 break; 388 388 } 389 389 case AlignBottom: 390 390 { 391 mPositionY = screen. height() - 1;391 mPositionY = screen.y() + screen.height() - 1; 392 392 break; 393 393 } … … 404 404 { 405 405 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()); 409 409 QPoint shiftToReal (realArea.topLeft() - fullArea.topLeft()); 410 410 return globalPosition + shiftToReal;
Note:
See TracChangeset
for help on using the changeset viewer.