VirtualBox

Ignore:
Timestamp:
Sep 22, 2009 3:50:03 PM (15 years ago)
Author:
vboxsync
Message:

API: big medium handling change and lots of assorted other cleanups and fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxToolBar.h

    r20052 r23223  
    2626#include <QGlobalStatic> /* for Q_WS_MAC */
    2727#ifdef Q_WS_MAC
    28 # include "VBoxUtils.h"
     28#include "VBoxUtils.h"
    2929#endif
    3030
     
    4949    VBoxToolBar (QWidget *aParent)
    5050        : QToolBar (aParent)
    51         , mMainWindow (qobject_cast<QMainWindow*> (aParent))
     51        , mMainWindow (qobject_cast <QMainWindow*> (aParent))
    5252    {
    5353        setFloatable (false);
    5454        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
    5562        if (layout())
    5663            layout()->setContentsMargins (0, 0, 0, 0);;
    5764
    5865        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 mass
    62          * of KDE styles. But maybe some of them are based on CleanLooks so
    63          * 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; }");
    7366    }
    7467
    75     void setMacToolbar ()
     68#ifdef Q_WS_MAC
     69    void setMacToolbar()
    7670    {
    77 #ifdef Q_WS_MAC
    7871        if (mMainWindow)
    7972        {
    8073            mMainWindow->setUnifiedTitleAndToolBarOnMac (true);
    81 # ifndef QT_MAC_USE_COCOA
     74#ifndef QT_MAC_USE_COCOA
    8275            WindowRef window = ::darwinToNativeWindow (this);
    8376            EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter);
     
    9083                                       RT_ELEMENTS (eventTypes), eventTypes,
    9184                                       NULL, NULL);
    92 # endif /* !QT_MAC_USE_COCOA */
     85#endif /* !QT_MAC_USE_COCOA */
    9386        }
    94 #endif /* Q_WS_MAC */
    9587    }
    9688
    97 #if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
     89#ifndef QT_MAC_USE_COCOA
    9890    static pascal OSStatus macEventFilter (EventHandlerCallRef aNextHandler,
    9991                                           EventRef aEvent, void * /* aUserData */)
     
    117109        return CallNextEventHandler (aNextHandler, aEvent);
    118110    }
    119 #endif /* Q_WS_MAC && !QT_MAC_USE_COCOA */
     111#endif /* !QT_MAC_USE_COCOA */
    120112
    121113    void setShowToolBarButton (bool aShow)
    122114    {
    123 #ifdef Q_WS_MAC
    124115        ::darwinSetShowsToolbarButton (this, aShow);
    125 #else  /* Q_WS_MAC */
    126         Q_UNUSED (aShow);
    127 #endif /* !Q_WS_MAC */
    128116    }
     117#endif /* Q_WS_MAC */
    129118
    130     void setUsesTextLabel (bool enable)
     119    void setUsesTextLabel (bool aEnable)
    131120    {
    132121        Qt::ToolButtonStyle tbs = Qt::ToolButtonTextUnderIcon;
    133         if (!enable)
     122        if (!aEnable)
    134123            tbs = Qt::ToolButtonIconOnly;
    135124
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette