Changeset 21034 in vbox
- Timestamp:
- Jun 29, 2009 3:36:04 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r20470 r21034 3428 3428 /* ensure the widget is within the available desktop area */ 3429 3429 QRect newGeo = normalizeGeometry (geo, deskGeo, aCanResize); 3430 #ifdef Q_WS_MAC 3431 /* No idea why, but Qt doesn't respect if there is a unified toolbar on the 3432 * ::move call. So manually add the height of the toolbar before setting 3433 * the position. */ 3434 if (w) 3435 newGeo.translate (0, ::darwinWindowToolBarHeight (aWidget)); 3436 #endif /* Q_WS_MAC */ 3430 3437 3431 3438 aWidget->move (newGeo.topLeft()); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp
r20928 r21034 717 717 /* Save the position of the window */ 718 718 { 719 int y = mNormalGeo.y(); 720 #if defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA) 721 /* The toolbar counts to the content not to the frame. Unfortunaly the 722 * toolbar isn't fully initialized when this window will be moved to 723 * the last position after VBox starting. As a workaround just do 724 * remove the toolbar height part when save the last position. */ 725 y -= ::darwinWindowToolBarHeight (this); 726 #endif /* Q_WS_MAC && !QT_MAC_USE_COCOA */ 719 727 QString winPos = QString ("%1,%2,%3,%4") 720 .arg (mNormalGeo.x()).arg ( mNormalGeo.y())728 .arg (mNormalGeo.x()).arg (y) 721 729 .arg (mNormalGeo.width()).arg (mNormalGeo.height()); 722 730 if (isMaximized()) -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp
r18829 r21034 137 137 // HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport())); 138 138 // ReshapeCustomWindow (::darwinToWindowRef (this)); 139 } 140 141 int darwinWindowToolBarHeight (NativeWindowRef aWindow) 142 { 143 int h = 0; 144 if (::IsWindowToolbarVisible (aWindow)) 145 { 146 /* Seems there is no method for getting the height of a toolbar in 147 * Carbon directly. Calculate it by getting the full window size, 148 * without the titlebar height & the content height. */ 149 HIRect win, win1, win2; 150 if (OSStatus result = ::HIWindowGetBounds (aWindow, kWindowStructureRgn, kHICoordSpaceWindow, &win) == noErr) 151 if((result = ::HIWindowGetBounds (aWindow, kWindowTitleBarRgn, kHICoordSpaceWindow, &win1)) == noErr) 152 if ((result = ::HIWindowGetBounds (aWindow, kWindowContentRgn, kHICoordSpaceWindow, &win2)) == noErr) 153 h = win.size.height - win1.size.height - win2.size.height; 154 } 155 return h; 139 156 } 140 157 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r17340 r21034 138 138 QApplication::instance()->setAttribute (Qt::AA_DontShowIconsInMenus, true); 139 139 #endif /* QT_VERSION >= 0x040400 */ 140 } 141 142 int darwinWindowToolBarHeight (QWidget *aWidget) 143 { 144 #ifndef QT_MAC_USE_COCOA 145 return ::darwinWindowToolBarHeight (::darwinToNativeWindow (aWidget)); 146 #else /* QT_MAC_USE_COCOA */ 147 NOREF (aWidget); 148 return 0; 149 #endif /* QT_MAC_USE_COCOA */ 140 150 } 141 151
Note:
See TracChangeset
for help on using the changeset viewer.