Changeset 23223 in vbox for trunk/src/VBox/Frontends/VirtualBox/include/VBoxToolBar.h
- Timestamp:
- Sep 22, 2009 3:50:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxToolBar.h
r20052 r23223 26 26 #include <QGlobalStatic> /* for Q_WS_MAC */ 27 27 #ifdef Q_WS_MAC 28 # 28 #include "VBoxUtils.h" 29 29 #endif 30 30 … … 49 49 VBoxToolBar (QWidget *aParent) 50 50 : QToolBar (aParent) 51 , mMainWindow (qobject_cast <QMainWindow*> (aParent))51 , mMainWindow (qobject_cast <QMainWindow*> (aParent)) 52 52 { 53 53 setFloatable (false); 54 54 setMovable (false); 55 56 /* Remove that ugly frame panel around the toolbar. 57 * Doing that currently for Cleanlooks & Windows styles. */ 58 if (qobject_cast <QCleanlooksStyle*> (QToolBar::style()) || 59 qobject_cast <QWindowsStyle*> (QToolBar::style())) 60 setStyleSheet ("QToolBar { border: 0px none black; }"); 61 55 62 if (layout()) 56 63 layout()->setContentsMargins (0, 0, 0, 0);; 57 64 58 65 setContextMenuPolicy (Qt::NoContextMenu); 59 60 /* Remove that ugly frame panel around the toolbar. */61 /* I'm not sure if we should do this generally on linux for that mass62 * of KDE styles. But maybe some of them are based on CleanLooks so63 * they are looking ok also. */64 QStyle *style = NULL;65 if (!style)66 /* Check for cleanlooks style */67 style = qobject_cast<QCleanlooksStyle*> (QToolBar::style());68 if (!style)69 /* Check for windows style */70 style = qobject_cast<QWindowsStyle*> (QToolBar::style());71 if (style)72 setStyleSheet ("QToolBar { border: 0px none black; }");73 66 } 74 67 75 void setMacToolbar () 68 #ifdef Q_WS_MAC 69 void setMacToolbar() 76 70 { 77 #ifdef Q_WS_MAC78 71 if (mMainWindow) 79 72 { 80 73 mMainWindow->setUnifiedTitleAndToolBarOnMac (true); 81 # 74 #ifndef QT_MAC_USE_COCOA 82 75 WindowRef window = ::darwinToNativeWindow (this); 83 76 EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter); … … 90 83 RT_ELEMENTS (eventTypes), eventTypes, 91 84 NULL, NULL); 92 # 85 #endif /* !QT_MAC_USE_COCOA */ 93 86 } 94 #endif /* Q_WS_MAC */95 87 } 96 88 97 #if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)89 #ifndef QT_MAC_USE_COCOA 98 90 static pascal OSStatus macEventFilter (EventHandlerCallRef aNextHandler, 99 91 EventRef aEvent, void * /* aUserData */) … … 117 109 return CallNextEventHandler (aNextHandler, aEvent); 118 110 } 119 #endif /* Q_WS_MAC &&!QT_MAC_USE_COCOA */111 #endif /* !QT_MAC_USE_COCOA */ 120 112 121 113 void setShowToolBarButton (bool aShow) 122 114 { 123 #ifdef Q_WS_MAC124 115 ::darwinSetShowsToolbarButton (this, aShow); 125 #else /* Q_WS_MAC */126 Q_UNUSED (aShow);127 #endif /* !Q_WS_MAC */128 116 } 117 #endif /* Q_WS_MAC */ 129 118 130 void setUsesTextLabel (bool enable)119 void setUsesTextLabel (bool aEnable) 131 120 { 132 121 Qt::ToolButtonStyle tbs = Qt::ToolButtonTextUnderIcon; 133 if (! enable)122 if (!aEnable) 134 123 tbs = Qt::ToolButtonIconOnly; 135 124
Note:
See TracChangeset
for help on using the changeset viewer.