- Timestamp:
- Jul 11, 2008 12:40:01 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxToolBar.h
r10230 r10519 72 72 } 73 73 74 void setMacToolbar () 75 { 76 #ifdef Q_WS_MAC 77 if (mMainWindow) 78 { 79 mMainWindow->setUnifiedTitleAndToolBarOnMac (true); 80 WindowRef window = ::darwinToWindowRef (this); 81 EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter); 82 EventTypeSpec eventTypes[2]; 83 eventTypes[0].eventClass = kEventClassMouse; 84 eventTypes[0].eventKind = kEventMouseDown; 85 eventTypes[1].eventClass = kEventClassMouse; 86 eventTypes[1].eventKind = kEventMouseUp; 87 InstallWindowEventHandler (window, eventHandler, 88 RT_ELEMENTS (eventTypes), eventTypes, 89 NULL, NULL); 90 } 91 #endif /* Q_WS_MAC */ 92 } 93 94 #ifdef Q_WS_MAC 95 static pascal OSStatus macEventFilter (EventHandlerCallRef aNextHandler, 96 EventRef aEvent, void * /* aUserData */) 97 { 98 UInt32 eclass = GetEventClass (aEvent); 99 if (eclass == kEventClassMouse) 100 { 101 WindowPartCode partCode; 102 GetEventParameter (aEvent, kEventParamWindowPartCode, typeWindowPartCode, NULL, sizeof (WindowPartCode), NULL, &partCode); 103 UInt32 ekind = GetEventKind (aEvent); 104 if (partCode == 15 || 105 partCode == 4) 106 if(ekind == kEventMouseDown || ekind == kEventMouseUp) 107 { 108 EventMouseButton button = 0; 109 GetEventParameter (aEvent, kEventParamMouseButton, typeMouseButton, NULL, sizeof (button), NULL, &button); 110 if (button != kEventMouseButtonPrimary) 111 return noErr; 112 } 113 } 114 return CallNextEventHandler (aNextHandler, aEvent); 115 } 116 #endif /* Q_WS_MAC */ 117 74 118 void setShowToolBarButton (bool aShow) 75 119 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp
r10416 r10519 363 363 #if MAC_LEOPARD_STYLE 364 364 /* Enable unified toolbars on Mac OS X. Available on Qt >= 4.3 */ 365 setUnifiedTitleAndToolBarOnMac (true);366 365 addToolBar (mActionsToolBar); 366 mActionsToolBar->setMacToolbar(); 367 367 /* No spacing/margin on the mac */ 368 368 VBoxGlobal::setLayoutMargin (centralLayout, 0); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r10515 r10519 476 476 #if MAC_LEOPARD_STYLE 477 477 /* Enable unified toolbars on Mac OS X. Available on Qt >= 4.3 */ 478 setUnifiedTitleAndToolBarOnMac (true);479 478 addToolBar (vmTools); 479 vmTools->setMacToolbar(); 480 480 /* No spacing/margin on the mac */ 481 481 VBoxGlobal::setLayoutMargin (centralLayout, 0); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialog.cpp
r10475 r10519 70 70 #ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS 71 71 mSelector = new VBoxSettingsToolBarSelector (this); 72 s etUnifiedTitleAndToolBarOnMac (true);72 static_cast<VBoxToolBar*> (mSelector->widget())->setMacToolbar(); 73 73 addToolBar (qobject_cast<QToolBar*> (mSelector->widget())); 74 74 /* No title in this mode, we change the title of the window. */
Note:
See TracChangeset
for help on using the changeset viewer.