VirtualBox

Changeset 10228 in vbox


Ignore:
Timestamp:
Jul 4, 2008 1:54:09 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32816
Message:

FE/Qt4: Tuning of the toolbar appearance in different styles.

File:
1 edited

Legend:

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

    r9797 r10228  
    2727#include <QToolBar>
    2828#include <QMainWindow>
    29 #ifdef Q_WS_MAC
    30 //# include "VBoxAquaStyle.h"
    31 #endif
     29
     30/* Note: This styles are available on _all_ platforms. */
     31#include <QCleanlooksStyle>
     32#include <QWindowsStyle>
    3233
    3334/**
     
    4849        if (layout())
    4950            layout()->setContentsMargins (0, 0, 0, 0);;
    50 #ifdef Q_WS_WIN
     51       
     52        setContextMenuPolicy (Qt::NoContextMenu);
     53
    5154        /* Remove that ugly frame panel around the toolbar. */
    52         setStyleSheet ("QToolBar { border: 0px none black; }");
    53 #endif // Q_WS_WIN
     55        /* I'm not sure if we should do this generally on linux for that mass
     56         * of KDE styles. But maybe some of them are based on CleanLooks so
     57         * they are looking ok also. */
     58        QStyle *style = NULL;
     59        if (!style)
     60            /* Check for cleanlooks style */
     61            style = qobject_cast<QCleanlooksStyle*> (QToolBar::style());
     62        if (!style)
     63            /* Check for windows style */
     64            style = qobject_cast<QWindowsStyle*> (QToolBar::style());
     65        if (style)
     66            setStyleSheet ("QToolBar { border: 0px none black; }");
    5467    }
     68
    5569
    5670    /**
     
    8296    }
    8397
    84 #ifdef Q_WS_MAC
    85     /**
    86      * This is a temporary hack, we'll set the style globally later.
    87      */
    88 //#warning port me
    89     void setMacStyle()
    90     {
    91         /* self */
    92 //        QStyle *qs = &VBoxAquaStyle::instance();
    93 //        setStyle(qs);
    94 //
    95 //        /* the buttons */
    96 //        QObjectList *list = queryList ("QToolButton");
    97 //        QObjectListIt it (*list);
    98 //        QObject *obj;
    99 //        while ((obj = it.current()) != 0)
    100 //        {
    101 //            QToolButton *btn = ::qt_cast <QToolButton *> (obj);
    102 //            btn->setStyle (&VBoxAquaStyle::instance());
    103 //            ++ it;
    104 //        }
    105 //        delete list;
    106 
    107         /** @todo the separator */
    108     }
    109 #endif
    110 
    11198private:
    11299
Note: See TracChangeset for help on using the changeset viewer.

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