- Timestamp:
- Feb 26, 2009 9:33:38 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h
r17126 r17147 44 44 class QToolBar; 45 45 class QPixmap; 46 class QRect; 46 47 47 48 # ifdef QT_MAC_USE_COCOA … … 73 74 void darwinSetMouseCoalescingEnabled (bool aEnabled); 74 75 76 /******************************************************************************** 77 * 78 * Simple helper methods (OS System native) 79 * 80 ********************************************************************************/ 81 void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height); 82 75 83 __END_DECLS 76 84 … … 124 132 QString darwinSystemLanguage (void); 125 133 QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText); 134 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget); 126 135 127 136 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSettingsDialog.cpp
r17126 r17147 276 276 mStack->setCurrentIndex (mStack->indexOf (rootPage)); 277 277 #else /* Q_WS_MAC */ 278 # ifndef QT_MAC_USE_COCOA279 278 QSize cs = size(); 280 279 /* First make all fully resizeable */ … … 300 299 setFixedSize (ss); 301 300 } 302 # else /* QT_MAC_USE_COCOA */303 for (int i = 0; i < mStack->count(); ++i)304 mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred);305 mStack->setCurrentIndex (mStack->indexOf (rootPage));306 # endif /* QT_MAC_USE_COCOA */307 301 #endif /* !Q_WS_MAC */ 308 302 # ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS … … 420 414 int minWidth = mSelector->minWidth(); 421 415 #ifdef Q_WS_MAC 422 # ifndef QT_MAC_USE_COCOA423 416 /* Set all size policies to ignored */ 424 417 for (int i = 0; i < mStack->count(); ++i) … … 438 431 439 432 categoryChanged (mSelector->currentId()); 440 # else /* QT_MAC_USE_COCOA */441 categoryChanged (mSelector->currentId());442 # endif /* QT_MAC_USE_COCOA */443 433 #else /* Q_WS_MAC */ 444 434 /* Resize to the minimum possible size */ -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp
r17126 r17147 45 45 } 46 46 47 47 void darwinWindowAnimateResizeImpl (NativeWindowRef aWidget, int x, int y, int width, int height) 48 { 49 HIRect r = CGRectMake (x, y, width, height); 50 TransitionWindowWithOptions (aWidget, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &r, false, NULL); 51 } 48 52 49 53 … … 118 122 Assert (!qpm.isNull()); 119 123 return ::darwinToCGImageRef (&qpm); 120 }121 122 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)123 {124 HIRect r = ::darwinToHIRect (aTarget);125 TransitionWindowWithOptions (::darwinToNativeWindow (aWidget), kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &r, false, NULL);126 124 } 127 125 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m
r17126 r17147 27 27 #import <AppKit/NSView.h> 28 28 #import <AppKit/NSEvent.h> 29 #import <AppKit/NSToolbar.h> 29 30 30 31 NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView) … … 50 51 } 51 52 53 void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height) 54 { 55 /* It seems that Qt doesn't return the height of the window with the 56 * toolbar height included. So add this size manually. Could easily be that 57 * the Trolls fix this in the final release. */ 58 NSToolbar *toolbar = [aWindow toolbar]; 59 NSRect windowFrame = [aWindow frame]; 60 int toolbarHeight = 0; 61 if(toolbar && [toolbar isVisible]) 62 toolbarHeight = NSHeight (windowFrame) - NSHeight ([[aWindow contentView] frame]); 63 int h = height + toolbarHeight; 64 int h1 = h - NSHeight (windowFrame); 65 windowFrame.size.height = h; 66 windowFrame.origin.y -= h1; 67 68 [aWindow setFrame:windowFrame display:YES animate:YES]; 69 } -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r17126 r17147 45 45 46 46 NativeWindowRef darwinToNativeWindow (NativeViewRef aView) 47 { 47 { 48 48 return darwinToNativeWindowImpl (aView); 49 49 } … … 54 54 if (parent) 55 55 darwinSetShowsToolbarButtonImpl (::darwinToNativeWindow (parent), aEnabled); 56 } 57 58 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget) 59 { 60 darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height()); 56 61 } 57 62 … … 107 112 return dragPixmap; 108 113 } 109 110 114 111 115 /********************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.