├── .qmake.conf ├── .tag ├── qtstyleplugins.pro └── src ├── plugins ├── platformthemes │ ├── gtk2 │ │ ├── gtk2.json │ │ ├── gtk2.pro │ │ ├── main.cpp │ │ ├── qgtk2dialoghelpers.cpp │ │ ├── qgtk2dialoghelpers.h │ │ ├── qgtk2theme.cpp │ │ └── qgtk2theme.h │ └── platformthemes.pro ├── plugins.pro └── styles │ ├── bb10style │ ├── bb10lightstyle.qrc │ ├── bb10style.pro │ ├── bright │ │ ├── button │ │ │ ├── core_button_disabled.png │ │ │ ├── core_button_disabled_selected.png │ │ │ ├── core_button_enabled_selected.png │ │ │ ├── core_button_inactive.png │ │ │ └── core_button_pressed.png │ │ ├── checkbox │ │ │ ├── core_checkbox_checked.png │ │ │ ├── core_checkbox_disabled.png │ │ │ ├── core_checkbox_disabled_checked.png │ │ │ ├── core_checkbox_enabled.png │ │ │ ├── core_checkbox_pressed.png │ │ │ └── core_checkbox_pressed_checked.png │ │ ├── combobox │ │ │ ├── core_dropdown_button.png │ │ │ ├── core_dropdown_button_arrowdown.png │ │ │ ├── core_dropdown_button_arrowdown_pressed.png │ │ │ ├── core_dropdown_button_arrowup.png │ │ │ ├── core_dropdown_button_disabled.png │ │ │ ├── core_dropdown_button_pressed.png │ │ │ ├── core_dropdown_checkmark.png │ │ │ ├── core_dropdown_divider.png │ │ │ ├── core_dropdown_menu.png │ │ │ ├── core_dropdown_menuup.png │ │ │ └── core_listitem_active.png │ │ ├── lineedit │ │ │ ├── core_textinput_bg.png │ │ │ ├── core_textinput_bg_disabled.png │ │ │ └── core_textinput_bg_highlight.png │ │ ├── listitem │ │ │ ├── core_listitem_active.png │ │ │ └── core_listitem_divider.png │ │ ├── progressbar │ │ │ ├── core_progressindicator_bg.png │ │ │ ├── core_progressindicator_complete.png │ │ │ ├── core_progressindicator_fill.png │ │ │ ├── core_progressindicator_vbg.png │ │ │ ├── core_progressindicator_vcomplete.png │ │ │ └── core_progressindicator_vfill.png │ │ ├── radiobutton │ │ │ ├── core_radiobutton_checked.png │ │ │ ├── core_radiobutton_disabled.png │ │ │ ├── core_radiobutton_disabled_checked.png │ │ │ ├── core_radiobutton_inactive.png │ │ │ └── core_radiobutton_pressed.png │ │ ├── scrollbar │ │ │ ├── core_scrollbar.png │ │ │ └── core_scrollbar_v.png │ │ └── slider │ │ │ ├── core_slider_active.png │ │ │ ├── core_slider_cache.png │ │ │ ├── core_slider_disabled.png │ │ │ ├── core_slider_enabled.png │ │ │ ├── core_slider_handle.png │ │ │ ├── core_slider_handle_disabled.png │ │ │ ├── core_slider_handle_pressed.png │ │ │ ├── core_slider_inactive.png │ │ │ ├── core_slider_vactive.png │ │ │ ├── core_slider_vcache.png │ │ │ ├── core_slider_vdisabled.png │ │ │ ├── core_slider_venabled.png │ │ │ └── core_slider_vinactive.png │ ├── dark │ │ ├── button │ │ │ ├── core_button_disabled.png │ │ │ ├── core_button_disabled_selected.png │ │ │ ├── core_button_enabled_selected.png │ │ │ ├── core_button_inactive.png │ │ │ └── core_button_pressed.png │ │ ├── checkbox │ │ │ ├── core_checkbox_checked.png │ │ │ ├── core_checkbox_disabled.png │ │ │ ├── core_checkbox_disabled_checked.png │ │ │ ├── core_checkbox_enabled.png │ │ │ ├── core_checkbox_pressed.png │ │ │ └── core_checkbox_pressed_checked.png │ │ ├── combobox │ │ │ ├── core_dropdown_button.png │ │ │ ├── core_dropdown_button_arrowdown.png │ │ │ ├── core_dropdown_button_arrowdown_pressed.png │ │ │ ├── core_dropdown_button_arrowup.png │ │ │ ├── core_dropdown_button_disabled.png │ │ │ ├── core_dropdown_button_pressed.png │ │ │ ├── core_dropdown_checkmark.png │ │ │ ├── core_dropdown_divider.png │ │ │ ├── core_dropdown_menu.png │ │ │ ├── core_dropdown_menuup.png │ │ │ └── core_listitem_active.png │ │ ├── lineedit │ │ │ ├── core_textinput_bg.png │ │ │ ├── core_textinput_bg_disabled.png │ │ │ └── core_textinput_bg_highlight.png │ │ ├── listitem │ │ │ ├── core_listitem_active.png │ │ │ └── core_listitem_divider.png │ │ ├── progressbar │ │ │ ├── core_progressindicator_bg.png │ │ │ ├── core_progressindicator_complete.png │ │ │ ├── core_progressindicator_fill.png │ │ │ ├── core_progressindicator_vbg.png │ │ │ ├── core_progressindicator_vcomplete.png │ │ │ └── core_progressindicator_vfill.png │ │ ├── radiobutton │ │ │ ├── core_radiobutton_checked.png │ │ │ ├── core_radiobutton_disabled.png │ │ │ ├── core_radiobutton_disabled_checked.png │ │ │ ├── core_radiobutton_inactive.png │ │ │ └── core_radiobutton_pressed.png │ │ ├── scrollbar │ │ │ ├── core_scrollbar.png │ │ │ └── core_scrollbar_v.png │ │ └── slider │ │ │ ├── core_slider_active.png │ │ │ ├── core_slider_cache.png │ │ │ ├── core_slider_disabled.png │ │ │ ├── core_slider_enabled.png │ │ │ ├── core_slider_handle.png │ │ │ ├── core_slider_handle_disabled.png │ │ │ ├── core_slider_handle_pressed.png │ │ │ ├── core_slider_inactive.png │ │ │ ├── core_slider_vactive.png │ │ │ ├── core_slider_vcache.png │ │ │ ├── core_slider_vdisabled.png │ │ │ ├── core_slider_venabled.png │ │ │ └── core_slider_vinactive.png │ ├── qbb10brightstyle.cpp │ ├── qbb10brightstyle.h │ ├── qbb10brightstyle.qrc │ ├── qbb10darkstyle.cpp │ ├── qbb10darkstyle.h │ ├── qbb10darkstyle.qrc │ ├── qbb10styleplugin.cpp │ ├── qbb10styleplugin.h │ └── qbb10styleplugin.json │ ├── cleanlooks │ ├── cleanlooks.json │ ├── cleanlooks.pro │ ├── plugin.cpp │ ├── qcleanlooksstyle.cpp │ └── qcleanlooksstyle.h │ ├── gtk2 │ ├── gtk2.json │ ├── gtk2.pro │ ├── plugin.cpp │ ├── qgtk2painter.cpp │ ├── qgtk2painter_p.h │ ├── qgtkglobal_p.h │ ├── qgtkpainter.cpp │ ├── qgtkpainter_p.h │ ├── qgtkstyle.cpp │ ├── qgtkstyle_p.cpp │ ├── qgtkstyle_p.h │ └── qgtkstyle_p_p.h │ ├── motif │ ├── motif.json │ ├── motif.pro │ ├── plugin.cpp │ ├── qcdestyle.cpp │ ├── qcdestyle.h │ ├── qmotifstyle.cpp │ └── qmotifstyle.h │ ├── plastique │ ├── plastique.json │ ├── plastique.pro │ ├── plugin.cpp │ ├── qplastiquestyle.cpp │ └── qplastiquestyle.h │ ├── shared │ ├── qhexstring_p.h │ ├── qstylecache_p.h │ ├── qstylehelper.cpp │ ├── qstylehelper_p.h │ └── shared.pri │ └── styles.pro └── src.pro /.qmake.conf: -------------------------------------------------------------------------------- 1 | load(qt_build_config) 2 | -------------------------------------------------------------------------------- /.tag: -------------------------------------------------------------------------------- 1 | 335dbece103e2cbf6c7cf819ab6672c2956b17b3 2 | -------------------------------------------------------------------------------- /qtstyleplugins.pro: -------------------------------------------------------------------------------- 1 | load(qt_parts) 2 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/gtk2/gtk2.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "gtk2" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/gtk2/gtk2.pro: -------------------------------------------------------------------------------- 1 | TARGET = qgtk2 2 | 3 | QT += core-private gui-private 4 | greaterThan(QT_MAJOR_VERSION, 5)|greaterThan(QT_MINOR_VERSION, 7): \ 5 | QT += theme_support-private 6 | else: \ 7 | QT += platformsupport-private 8 | 9 | CONFIG += X11 10 | CONFIG += link_pkgconfig 11 | PKGCONFIG += gtk+-2.0 12 | 13 | HEADERS += \ 14 | qgtk2dialoghelpers.h \ 15 | qgtk2theme.h 16 | 17 | SOURCES += \ 18 | main.cpp \ 19 | qgtk2dialoghelpers.cpp \ 20 | qgtk2theme.cpp \ 21 | 22 | PLUGIN_TYPE = platformthemes 23 | PLUGIN_EXTENDS = - 24 | PLUGIN_CLASS_NAME = QGtk2ThemePlugin 25 | load(qt_plugin) 26 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/gtk2/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include 35 | #include "qgtk2theme.h" 36 | 37 | QT_BEGIN_NAMESPACE 38 | 39 | class QGtk2ThemePlugin : public QPlatformThemePlugin 40 | { 41 | Q_OBJECT 42 | Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "gtk2.json") 43 | 44 | public: 45 | QPlatformTheme *create(const QString &key, const QStringList ¶ms) Q_DECL_OVERRIDE; 46 | }; 47 | 48 | QPlatformTheme *QGtk2ThemePlugin::create(const QString &key, const QStringList ¶ms) 49 | { 50 | Q_UNUSED(params); 51 | if (!key.compare(QLatin1String(QGtk2Theme::name), Qt::CaseInsensitive)) 52 | return new QGtk2Theme; 53 | 54 | return 0; 55 | } 56 | 57 | QT_END_NAMESPACE 58 | 59 | #include "main.moc" 60 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTK2DIALOGHELPERS_P_H 35 | #define QGTK2DIALOGHELPERS_P_H 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | typedef struct _GtkDialog GtkDialog; 45 | typedef struct _GtkFileFilter GtkFileFilter; 46 | 47 | QT_BEGIN_NAMESPACE 48 | 49 | class QGtk2Dialog; 50 | class QColor; 51 | 52 | class QGtk2ColorDialogHelper : public QPlatformColorDialogHelper 53 | { 54 | Q_OBJECT 55 | 56 | public: 57 | QGtk2ColorDialogHelper(); 58 | ~QGtk2ColorDialogHelper(); 59 | 60 | bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE; 61 | void exec() Q_DECL_OVERRIDE; 62 | void hide() Q_DECL_OVERRIDE; 63 | 64 | void setCurrentColor(const QColor &color) Q_DECL_OVERRIDE; 65 | QColor currentColor() const Q_DECL_OVERRIDE; 66 | 67 | private Q_SLOTS: 68 | void onAccepted(); 69 | 70 | private: 71 | static void onColorChanged(QGtk2ColorDialogHelper *helper); 72 | void applyOptions(); 73 | 74 | QScopedPointer d; 75 | }; 76 | 77 | class QGtk2FileDialogHelper : public QPlatformFileDialogHelper 78 | { 79 | Q_OBJECT 80 | 81 | public: 82 | QGtk2FileDialogHelper(); 83 | ~QGtk2FileDialogHelper(); 84 | 85 | bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE; 86 | void exec() Q_DECL_OVERRIDE; 87 | void hide() Q_DECL_OVERRIDE; 88 | 89 | bool defaultNameFilterDisables() const Q_DECL_OVERRIDE; 90 | void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE; 91 | QUrl directory() const Q_DECL_OVERRIDE; 92 | void selectFile(const QUrl &filename) Q_DECL_OVERRIDE; 93 | QList selectedFiles() const Q_DECL_OVERRIDE; 94 | void setFilter() Q_DECL_OVERRIDE; 95 | void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE; 96 | QString selectedNameFilter() const Q_DECL_OVERRIDE; 97 | 98 | private Q_SLOTS: 99 | void onAccepted(); 100 | 101 | private: 102 | static void onSelectionChanged(GtkDialog *dialog, QGtk2FileDialogHelper *helper); 103 | static void onCurrentFolderChanged(QGtk2FileDialogHelper *helper); 104 | void applyOptions(); 105 | void setNameFilters(const QStringList &filters); 106 | 107 | QUrl _dir; 108 | QList _selection; 109 | QHash _filters; 110 | QHash _filterNames; 111 | QScopedPointer d; 112 | }; 113 | 114 | class QGtk2FontDialogHelper : public QPlatformFontDialogHelper 115 | { 116 | Q_OBJECT 117 | 118 | public: 119 | QGtk2FontDialogHelper(); 120 | ~QGtk2FontDialogHelper(); 121 | 122 | bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE; 123 | void exec() Q_DECL_OVERRIDE; 124 | void hide() Q_DECL_OVERRIDE; 125 | 126 | void setCurrentFont(const QFont &font) Q_DECL_OVERRIDE; 127 | QFont currentFont() const Q_DECL_OVERRIDE; 128 | 129 | private Q_SLOTS: 130 | void onAccepted(); 131 | 132 | private: 133 | void applyOptions(); 134 | 135 | QScopedPointer d; 136 | }; 137 | 138 | QT_END_NAMESPACE 139 | 140 | #endif // QGTK2DIALOGHELPERS_P_H 141 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/gtk2/qgtk2theme.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "qgtk2theme.h" 35 | #include "qgtk2dialoghelpers.h" 36 | #include 37 | 38 | #undef signals 39 | #include 40 | 41 | #include 42 | 43 | QT_BEGIN_NAMESPACE 44 | 45 | const char *QGtk2Theme::name = "gtk2"; 46 | 47 | static QString gtkSetting(const gchar *propertyName) 48 | { 49 | GtkSettings *settings = gtk_settings_get_default(); 50 | gchararray value; 51 | g_object_get(settings, propertyName, &value, NULL); 52 | QString str = QString::fromUtf8(value); 53 | g_free(value); 54 | return str; 55 | } 56 | 57 | QGtk2Theme::QGtk2Theme() 58 | { 59 | // gtk_init will reset the Xlib error handler, and that causes 60 | // Qt applications to quit on X errors. Therefore, we need to manually restore it. 61 | int (*oldErrorHandler)(Display *, XErrorEvent *) = XSetErrorHandler(NULL); 62 | 63 | gtk_init(0, 0); 64 | 65 | XSetErrorHandler(oldErrorHandler); 66 | } 67 | 68 | QVariant QGtk2Theme::themeHint(QPlatformTheme::ThemeHint hint) const 69 | { 70 | switch (hint) { 71 | case QPlatformTheme::SystemIconThemeName: 72 | return QVariant(gtkSetting("gtk-icon-theme-name")); 73 | case QPlatformTheme::SystemIconFallbackThemeName: 74 | return QVariant(gtkSetting("gtk-fallback-icon-theme")); 75 | case QPlatformTheme::StyleNames: 76 | return QVariant(QStringList(QStringLiteral("gtk2"))); 77 | default: 78 | return QGnomeTheme::themeHint(hint); 79 | } 80 | } 81 | 82 | QString QGtk2Theme::gtkFontName() const 83 | { 84 | QString cfgFontName = gtkSetting("gtk-font-name"); 85 | if (!cfgFontName.isEmpty()) 86 | return cfgFontName; 87 | return QGnomeTheme::gtkFontName(); 88 | } 89 | 90 | bool QGtk2Theme::usePlatformNativeDialog(DialogType type) const 91 | { 92 | switch (type) { 93 | case ColorDialog: 94 | return true; 95 | case FileDialog: 96 | return true; 97 | case FontDialog: 98 | return true; 99 | default: 100 | return false; 101 | } 102 | } 103 | 104 | QPlatformDialogHelper *QGtk2Theme::createPlatformDialogHelper(DialogType type) const 105 | { 106 | switch (type) { 107 | case ColorDialog: 108 | return new QGtk2ColorDialogHelper; 109 | case FileDialog: 110 | return new QGtk2FileDialogHelper; 111 | case FontDialog: 112 | return new QGtk2FontDialogHelper; 113 | default: 114 | return 0; 115 | } 116 | } 117 | 118 | QT_END_NAMESPACE 119 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/gtk2/qgtk2theme.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTK2THEME_H 35 | #define QGTK2THEME_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | 41 | class QGtk2Theme : public QGnomeTheme 42 | { 43 | public: 44 | QGtk2Theme(); 45 | 46 | virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE; 47 | virtual QString gtkFontName() const Q_DECL_OVERRIDE; 48 | 49 | bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE; 50 | QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE; 51 | 52 | static const char *name; 53 | }; 54 | 55 | QT_END_NAMESPACE 56 | 57 | #endif // QGTK2THEME_H 58 | -------------------------------------------------------------------------------- /src/plugins/platformthemes/platformthemes.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | packagesExist(gtk+-2.0) { 4 | SUBDIRS += gtk2 5 | } 6 | -------------------------------------------------------------------------------- /src/plugins/plugins.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = platformthemes styles 3 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bb10lightstyle.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | light/button/core_button_disabled.png 4 | light/button/core_button_inactive.png 5 | light/button/core_button_pressed.png 6 | light/checkbox/core_checkbox_checked.png 7 | light/checkbox/core_checkbox_disabled.png 8 | light/checkbox/core_checkbox_disabledchecked.png 9 | light/checkbox/core_checkbox_enabled.png 10 | light/checkbox/core_checkbox_pressed.png 11 | light/checkbox/core_checkbox_pressedchecked.png 12 | light/radiobutton/core_radiobutton_checked.png 13 | light/radiobutton/core_radiobutton_disabled.png 14 | light/radiobutton/core_radiobutton_disabledchecked.png 15 | light/radiobutton/core_radiobutton_enabled.png 16 | light/radiobutton/core_radiobutton_pressed.png 17 | light/slider/core_slider_active.png 18 | light/slider/core_slider_disabled.png 19 | light/slider/core_slider_handle.png 20 | light/slider/core_slider_handle_disabled.png 21 | light/slider/core_slider_handle_pressed.png 22 | light/slider/core_slider_inactive.png 23 | light/slider/core_slider_vactive.png 24 | light/slider/core_slider_vdisabled.png 25 | light/slider/core_slider_vinactive.png 26 | light/slider/core_slider_black.png 27 | light/slider/core_slider_enabled.png 28 | light/slider/core_slider_vblack.png 29 | light/slider/core_slider_venabled.png 30 | light/button/core_button_active.png 31 | light/lineedit/core_textinput_bg.png 32 | light/lineedit/core_textinput_bg_disabled.png 33 | light/lineedit/core_textinput_bg_focused.png 34 | light/progressbar/core_progressindicator_bg.png 35 | light/progressbar/core_progressindicator_complete.png 36 | light/progressbar/core_progressindicator_fill.png 37 | light/progressbar/core_progressindicator_vbg.png 38 | light/progressbar/core_progressindicator_vcomplete.png 39 | light/progressbar/core_progressindicator_vfill.png 40 | light/combobox/core_dropdown_button.png 41 | light/combobox/core_dropdown_button_arrowdown.png 42 | light/combobox/core_dropdown_button_arrowdown_pressed.png 43 | light/combobox/core_dropdown_button_arrowup.png 44 | light/combobox/core_dropdown_button_disabled.png 45 | light/combobox/core_dropdown_button_pressed.png 46 | light/combobox/core_dropdown_checkmark.png 47 | light/combobox/core_dropdown_divider.png 48 | light/combobox/core_dropdown_menu.png 49 | light/combobox/core_dropdown_menuup.png 50 | light/combobox/core_listitem_active.png 51 | light/listitem/core_listitem_active.png 52 | light/listitem/core_listitem_divider.png 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bb10style.pro: -------------------------------------------------------------------------------- 1 | TARGET = bb10styleplugin 2 | 3 | PLUGIN_TYPE = styles 4 | PLUGIN_CLASS_NAME = QBB10StylePlugin 5 | load(qt_plugin) 6 | 7 | INCLUDEPATH += $$PWD 8 | 9 | QT += widgets-private 10 | 11 | HEADERS += \ 12 | qbb10brightstyle.h \ 13 | qbb10darkstyle.h \ 14 | qbb10styleplugin.h 15 | 16 | SOURCES += \ 17 | qbb10brightstyle.cpp \ 18 | qbb10darkstyle.cpp \ 19 | qbb10styleplugin.cpp 20 | 21 | RESOURCES += \ 22 | qbb10brightstyle.qrc \ 23 | qbb10darkstyle.qrc 24 | 25 | OTHER_FILES += qbb10styleplugin.json 26 | 27 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/button/core_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/button/core_button_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/button/core_button_disabled_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/button/core_button_disabled_selected.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/button/core_button_enabled_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/button/core_button_enabled_selected.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/button/core_button_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/button/core_button_inactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/button/core_button_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/button/core_button_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/checkbox/core_checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/checkbox/core_checkbox_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_enabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowup.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_checkmark.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_divider.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menu.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_dropdown_menuup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menuup.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/combobox/core_listitem_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/combobox/core_listitem_active.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_complete.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_fill.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vbg.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vcomplete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vcomplete.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vfill.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar_v.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_active.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_cache.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_enabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_handle.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_handle_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_handle_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_inactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_vactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_vactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_vcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_vcache.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_vdisabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_vdisabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_venabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_venabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/bright/slider/core_slider_vinactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/bright/slider/core_slider_vinactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/button/core_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/button/core_button_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/button/core_button_disabled_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/button/core_button_disabled_selected.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/button/core_button_enabled_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/button/core_button_enabled_selected.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/button/core_button_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/button/core_button_inactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/button/core_button_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/button/core_button_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/checkbox/core_checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/checkbox/core_checkbox_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_enabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowup.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_checkmark.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_divider.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menu.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_dropdown_menuup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menuup.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/combobox/core_listitem_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/combobox/core_listitem_active.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_complete.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_fill.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vbg.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vcomplete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vcomplete.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vfill.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled_checked.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar_v.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_active.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_cache.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_enabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_handle.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_handle_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_handle_disabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_inactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_vactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_vactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_vcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_vcache.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_vdisabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_vdisabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_venabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_venabled.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/dark/slider/core_slider_vinactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtstyleplugins/335dbece103e2cbf6c7cf819ab6672c2956b17b3/src/plugins/styles/bb10style/dark/slider/core_slider_vinactive.png -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10brightstyle.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "qbb10brightstyle.h" 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | QT_BEGIN_NAMESPACE 45 | 46 | QBB10BrightStyle::QBB10BrightStyle() : 47 | QPixmapStyle() 48 | { 49 | addDescriptor(PB_Enabled, 50 | QLatin1String("://bright/button/core_button_inactive.png"), 51 | QMargins(13, 13, 13, 13), 52 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 53 | addDescriptor(PB_Checked, 54 | QLatin1String("://bright/button/core_button_enabled_selected.png"), 55 | QMargins(13, 13, 13, 13), 56 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 57 | addDescriptor(PB_Pressed, 58 | QLatin1String("://bright/button/core_button_pressed.png"), 59 | QMargins(13, 13, 13, 13), 60 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 61 | addDescriptor(PB_Disabled, 62 | QLatin1String("://bright/button/core_button_disabled.png"), 63 | QMargins(13, 13, 13, 13), 64 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 65 | addDescriptor(PB_PressedDisabled, 66 | QLatin1String("://bright/button/core_button_disabled_selected.png"), 67 | QMargins(13, 13, 13, 13), 68 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 69 | 70 | addDescriptor(LE_Enabled, 71 | QLatin1String("://bright/lineedit/core_textinput_bg.png"), 72 | QMargins(8, 8, 8, 8)); 73 | addDescriptor(LE_Disabled, 74 | QLatin1String("://bright/lineedit/core_textinput_bg_disabled.png"), 75 | QMargins(8, 8, 8, 8)); 76 | addDescriptor(LE_Focused, 77 | QLatin1String("://bright/lineedit/core_textinput_bg_highlight.png"), 78 | QMargins(8, 8, 8, 8)); 79 | 80 | copyDescriptor(LE_Enabled, TE_Enabled); 81 | copyDescriptor(LE_Disabled, TE_Disabled); 82 | copyDescriptor(LE_Focused, TE_Focused); 83 | 84 | addPixmap(CB_Enabled, 85 | QLatin1String("://bright/checkbox/core_checkbox_enabled.png"), 86 | QMargins(16, 16, 16, 16)); 87 | addPixmap(CB_Checked, 88 | QLatin1String("://bright/checkbox/core_checkbox_checked.png"), 89 | QMargins(16, 16, 16, 16)); 90 | addPixmap(CB_Pressed, 91 | QLatin1String("://bright/checkbox/core_checkbox_pressed.png"), 92 | QMargins(16, 16, 16, 16)); 93 | addPixmap(CB_PressedChecked, 94 | QLatin1String("://bright/checkbox/core_checkbox_pressed_checked.png"), 95 | QMargins(16, 16, 16, 16)); 96 | addPixmap(CB_Disabled, 97 | QLatin1String("://bright/checkbox/core_checkbox_disabled.png"), 98 | QMargins(16, 16, 16, 16)); 99 | addPixmap(CB_DisabledChecked, 100 | QLatin1String("://bright/checkbox/core_checkbox_disabled_checked.png"), 101 | QMargins(16, 16, 16, 16)); 102 | 103 | addPixmap(RB_Enabled, 104 | QLatin1String("://bright/radiobutton/core_radiobutton_inactive.png"), 105 | QMargins(16, 16, 16, 16)); 106 | addPixmap(RB_Checked, 107 | QLatin1String("://bright/radiobutton/core_radiobutton_checked.png"), 108 | QMargins(16, 16, 16, 16)); 109 | addPixmap(RB_Pressed, 110 | QLatin1String("://bright/radiobutton/core_radiobutton_pressed.png"), 111 | QMargins(16, 16, 16, 16)); 112 | addPixmap(RB_Disabled, 113 | QLatin1String("://bright/radiobutton/core_radiobutton_disabled.png"), 114 | QMargins(16, 16, 16, 16)); 115 | addPixmap(RB_DisabledChecked, 116 | QLatin1String("://bright/radiobutton/core_radiobutton_disabled_checked.png"), 117 | QMargins(16, 16, 16, 16)); 118 | 119 | addDescriptor(PB_HBackground, 120 | QLatin1String("://bright/progressbar/core_progressindicator_bg.png"), 121 | QMargins(10, 10, 10, 10), 122 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 123 | addDescriptor(PB_HContent, 124 | QLatin1String("://bright/progressbar/core_progressindicator_fill.png"), 125 | QMargins(10, 10, 10, 10), 126 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 127 | addDescriptor(PB_HComplete, 128 | QLatin1String("://bright/progressbar/core_progressindicator_complete.png"), 129 | QMargins(10, 10, 10, 10), 130 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 131 | addDescriptor(PB_VBackground, 132 | QLatin1String("://bright/progressbar/core_progressindicator_vbg.png"), 133 | QMargins(10, 10, 10, 10), 134 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 135 | addDescriptor(PB_VContent, 136 | QLatin1String("://bright/progressbar/core_progressindicator_vfill.png"), 137 | QMargins(10, 10, 10, 10), 138 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 139 | addDescriptor(PB_VComplete, 140 | QLatin1String("://bright/progressbar/core_progressindicator_vcomplete.png"), 141 | QMargins(10, 10, 10, 10), 142 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 143 | 144 | addDescriptor(SG_HEnabled, 145 | QLatin1String("://bright/slider/core_slider_enabled.png"), 146 | QMargins(50, 50, 50, 50), 147 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 148 | addDescriptor(SG_HDisabled, 149 | QLatin1String("://bright/slider/core_slider_disabled.png"), 150 | QMargins(50, 50, 50, 50), 151 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 152 | addDescriptor(SG_HActiveEnabled, 153 | QLatin1String("://bright/slider/core_slider_inactive.png"), 154 | QMargins(50, 50, 50, 50), 155 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 156 | addDescriptor(SG_HActivePressed, 157 | QLatin1String("://bright/slider/core_slider_active.png"), 158 | QMargins(50, 50, 50, 50), 159 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 160 | addDescriptor(SG_HActiveDisabled, 161 | QLatin1String("://bright/slider/core_slider_cache.png"), 162 | QMargins(50, 50, 50, 50), 163 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 164 | addDescriptor(SG_VEnabled, 165 | QLatin1String("://bright/slider/core_slider_venabled.png"), 166 | QMargins(50, 50, 50, 50), 167 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 168 | addDescriptor(SG_VDisabled, 169 | QLatin1String("://bright/slider/core_slider_vdisabled.png"), 170 | QMargins(50, 50, 50, 50), 171 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 172 | addDescriptor(SG_VActiveEnabled, 173 | QLatin1String("://bright/slider/core_slider_vinactive.png"), 174 | QMargins(50, 50, 50, 50), 175 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 176 | addDescriptor(SG_VActivePressed, 177 | QLatin1String("://bright/slider/core_slider_vactive.png"), 178 | QMargins(50, 50, 50, 50), 179 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 180 | addDescriptor(SG_VActiveDisabled, 181 | QLatin1String("://bright/slider/core_slider_vcache.png"), 182 | QMargins(50, 50, 50, 50), 183 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 184 | 185 | addPixmap(SH_HEnabled, 186 | QLatin1String("://bright/slider/core_slider_handle.png")); 187 | addPixmap(SH_HDisabled, 188 | QLatin1String("://bright/slider/core_slider_handle_disabled.png")); 189 | addPixmap(SH_HPressed, 190 | QLatin1String("://bright/slider/core_slider_handle_pressed.png")); 191 | addPixmap(SH_VEnabled, 192 | QLatin1String("://bright/slider/core_slider_handle.png")); 193 | addPixmap(SH_VDisabled, 194 | QLatin1String("://bright/slider/core_slider_handle_disabled.png")); 195 | addPixmap(SH_VPressed, 196 | QLatin1String("://bright/slider/core_slider_handle_pressed.png")); 197 | 198 | addDescriptor(DD_ButtonEnabled, 199 | QLatin1String("://bright/combobox/core_dropdown_button.png"), 200 | QMargins(14, 14, 14, 14), 201 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 202 | addDescriptor(DD_ButtonDisabled, 203 | QLatin1String("://bright/combobox/core_dropdown_button_disabled.png"), 204 | QMargins(14, 14, 14, 14), 205 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 206 | addDescriptor(DD_ButtonPressed, 207 | QLatin1String("://bright/combobox/core_dropdown_button_pressed.png"), 208 | QMargins(14, 14, 14, 14), 209 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 210 | addDescriptor(DD_ItemSelected, 211 | QLatin1String("://bright/combobox/core_listitem_active.png")); 212 | 213 | addPixmap(DD_ArrowEnabled, 214 | QLatin1String("://bright/combobox/core_dropdown_button_arrowdown.png"), 215 | QMargins(35, 39, 35, 39)); 216 | copyPixmap(DD_ArrowEnabled, DD_ArrowDisabled); 217 | addPixmap(DD_ArrowPressed, 218 | QLatin1String("://bright/combobox/core_dropdown_button_arrowdown_pressed.png"), 219 | QMargins(35, 39, 35, 39)); 220 | addPixmap(DD_ArrowOpen, 221 | QLatin1String("://bright/combobox/core_dropdown_button_arrowup.png"), 222 | QMargins(35, 39, 35, 39)); 223 | addDescriptor(DD_PopupDown, 224 | QLatin1String("://bright/combobox/core_dropdown_menu.png"), 225 | QMargins(12, 12, 12, 12), 226 | QTileRules(Qt::StretchTile, Qt::StretchTile)); 227 | addDescriptor(DD_PopupUp, 228 | QLatin1String("://bright/combobox/core_dropdown_menuup.png"), 229 | QMargins(12, 12, 12, 12), 230 | QTileRules(Qt::StretchTile, Qt::StretchTile)); 231 | addPixmap(DD_ItemSeparator, 232 | QLatin1String("://bright/combobox/core_dropdown_divider.png"), 233 | QMargins(5, 0, 5, 0)); 234 | 235 | addDescriptor(ID_Selected, 236 | QLatin1String("://bright/listitem/core_listitem_active.png")); 237 | addPixmap(ID_Separator, 238 | QLatin1String("://bright/listitem/core_listitem_divider.png")); 239 | 240 | addDescriptor(SB_Horizontal, 241 | QLatin1String("://bright/scrollbar/core_scrollbar.png"), 242 | QMargins(7, 8, 7, 8), 243 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 244 | addDescriptor(SB_Vertical, 245 | QLatin1String("://bright/scrollbar/core_scrollbar_v.png"), 246 | QMargins(8, 7, 8, 7), 247 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 248 | } 249 | 250 | QBB10BrightStyle::~QBB10BrightStyle() 251 | { 252 | } 253 | 254 | void QBB10BrightStyle::polish(QApplication *application) 255 | { 256 | QPixmapStyle::polish(application); 257 | } 258 | 259 | void QBB10BrightStyle::polish(QWidget *widget) 260 | { 261 | // Hide the text by default 262 | if (QProgressBar *pb = qobject_cast(widget)) 263 | pb->setTextVisible(false); 264 | 265 | if (QComboBox *cb = qobject_cast(widget)) { 266 | QAbstractItemView *list = cb->view(); 267 | QPalette p = list->palette(); 268 | p.setBrush(QPalette::HighlightedText, p.brush(QPalette::Text)); 269 | list->setPalette(p); 270 | } 271 | 272 | if (qobject_cast(widget)) { 273 | QPalette p = widget->palette(); 274 | p.setBrush(QPalette::Disabled, QPalette::HighlightedText, p.brush(QPalette::Text)); 275 | widget->setPalette(p); 276 | } 277 | 278 | QPixmapStyle::polish(widget); 279 | } 280 | 281 | QPalette QBB10BrightStyle::standardPalette() const 282 | { 283 | QPalette p; 284 | 285 | QColor color = QColor(38, 38, 38); 286 | p.setBrush(QPalette::ButtonText, color); 287 | p.setBrush(QPalette::WindowText, color); 288 | p.setBrush(QPalette::Text, color); 289 | 290 | color.setAlpha(179); 291 | p.setBrush(QPalette::Disabled, QPalette::ButtonText, color); 292 | p.setBrush(QPalette::Disabled, QPalette::WindowText, color); 293 | p.setBrush(QPalette::Disabled, QPalette::Text, color); 294 | 295 | p.setColor(QPalette::Window, QColor(248, 248, 248)); 296 | 297 | p.setBrush(QPalette::Highlight, QColor(0, 168, 223)); 298 | p.setBrush(QPalette::HighlightedText, QColor(250, 250,250)); 299 | 300 | return p; 301 | } 302 | 303 | void QBB10BrightStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option, 304 | QPainter *painter, const QWidget *widget) const 305 | { 306 | switch (element) { 307 | case CE_PushButtonLabel: 308 | { 309 | const bool on = option->state & State_On || option->state & State_Sunken; 310 | const QStyleOptionButton *button = qstyleoption_cast(option); 311 | QStyleOptionButton newOpt = *button; 312 | if (on) 313 | newOpt.palette.setBrush(QPalette::ButtonText, QColor(250, 250, 250)); 314 | QPixmapStyle::drawControl(CE_PushButtonLabel, &newOpt, painter, widget); 315 | break; 316 | } 317 | case CE_ProgressBarLabel: 318 | // Don't draw the progress bar label 319 | break; 320 | default: 321 | QPixmapStyle::drawControl(element, option, painter, widget); 322 | } 323 | } 324 | 325 | void QBB10BrightStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, 326 | QPainter *painter, const QWidget *widget) const 327 | { 328 | QPixmapStyle::drawPrimitive(element, option, painter, widget); 329 | 330 | if (element == PE_PanelItemViewItem) { 331 | // Draw the checkbox for current item 332 | if (widget->property("_pixmap_combobox_list").toBool() 333 | && option->state & QStyle::State_Selected) { 334 | QPixmap pix(QLatin1String("://bright/combobox/core_dropdown_checkmark.png")); 335 | QRect rect = option->rect; 336 | const int margin = rect.height() / 2; 337 | QPoint pos(rect.right() - margin - pix.width() / 2, 338 | rect.top() + margin - pix.height() / 2); 339 | painter->drawPixmap(pos, pix); 340 | } 341 | } 342 | } 343 | 344 | QT_END_NAMESPACE 345 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10brightstyle.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QBB10BRIGHTSTYLE_H 35 | #define QBB10BRIGHTSTYLE_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | 41 | class QBB10BrightStyle : public QPixmapStyle 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | QBB10BrightStyle(); 47 | ~QBB10BrightStyle(); 48 | 49 | void polish(QApplication *application) Q_DECL_OVERRIDE; 50 | void polish(QWidget *widget) Q_DECL_OVERRIDE; 51 | 52 | QPalette standardPalette() const Q_DECL_OVERRIDE; 53 | 54 | void drawControl(ControlElement element, const QStyleOption *option, 55 | QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 56 | void drawPrimitive(PrimitiveElement element, const QStyleOption *option, 57 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 58 | }; 59 | 60 | QT_END_NAMESPACE 61 | 62 | #endif // QBB10BRIGHTSTYLE_H 63 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10brightstyle.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | bright/button/core_button_disabled.png 4 | bright/button/core_button_disabled_selected.png 5 | bright/button/core_button_inactive.png 6 | bright/button/core_button_enabled_selected.png 7 | bright/button/core_button_pressed.png 8 | bright/checkbox/core_checkbox_checked.png 9 | bright/checkbox/core_checkbox_disabled.png 10 | bright/checkbox/core_checkbox_disabled_checked.png 11 | bright/checkbox/core_checkbox_enabled.png 12 | bright/checkbox/core_checkbox_pressed.png 13 | bright/checkbox/core_checkbox_pressed_checked.png 14 | bright/combobox/core_dropdown_button.png 15 | bright/combobox/core_dropdown_button_arrowdown.png 16 | bright/combobox/core_dropdown_button_arrowdown_pressed.png 17 | bright/combobox/core_dropdown_button_arrowup.png 18 | bright/combobox/core_dropdown_button_disabled.png 19 | bright/combobox/core_dropdown_button_pressed.png 20 | bright/combobox/core_dropdown_checkmark.png 21 | bright/combobox/core_dropdown_divider.png 22 | bright/combobox/core_dropdown_menu.png 23 | bright/combobox/core_dropdown_menuup.png 24 | bright/combobox/core_listitem_active.png 25 | bright/lineedit/core_textinput_bg.png 26 | bright/lineedit/core_textinput_bg_disabled.png 27 | bright/lineedit/core_textinput_bg_highlight.png 28 | bright/listitem/core_listitem_active.png 29 | bright/listitem/core_listitem_divider.png 30 | bright/progressbar/core_progressindicator_bg.png 31 | bright/progressbar/core_progressindicator_complete.png 32 | bright/progressbar/core_progressindicator_fill.png 33 | bright/progressbar/core_progressindicator_vbg.png 34 | bright/progressbar/core_progressindicator_vcomplete.png 35 | bright/progressbar/core_progressindicator_vfill.png 36 | bright/radiobutton/core_radiobutton_checked.png 37 | bright/radiobutton/core_radiobutton_disabled.png 38 | bright/radiobutton/core_radiobutton_disabled_checked.png 39 | bright/radiobutton/core_radiobutton_inactive.png 40 | bright/radiobutton/core_radiobutton_pressed.png 41 | bright/scrollbar/core_scrollbar.png 42 | bright/scrollbar/core_scrollbar_v.png 43 | bright/slider/core_slider_active.png 44 | bright/slider/core_slider_cache.png 45 | bright/slider/core_slider_disabled.png 46 | bright/slider/core_slider_enabled.png 47 | bright/slider/core_slider_handle.png 48 | bright/slider/core_slider_handle_disabled.png 49 | bright/slider/core_slider_handle_pressed.png 50 | bright/slider/core_slider_inactive.png 51 | bright/slider/core_slider_vactive.png 52 | bright/slider/core_slider_vcache.png 53 | bright/slider/core_slider_vdisabled.png 54 | bright/slider/core_slider_venabled.png 55 | bright/slider/core_slider_vinactive.png 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10darkstyle.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "qbb10darkstyle.h" 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | QT_BEGIN_NAMESPACE 47 | 48 | QBB10DarkStyle::QBB10DarkStyle() : 49 | QPixmapStyle() 50 | { 51 | addDescriptor(PB_Enabled, 52 | QLatin1String("://dark/button/core_button_inactive.png"), 53 | QMargins(13, 13, 13, 13), 54 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 55 | addDescriptor(PB_Checked, 56 | QLatin1String("://dark/button/core_button_enabled_selected.png"), 57 | QMargins(13, 13, 13, 13), 58 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 59 | addDescriptor(PB_Pressed, 60 | QLatin1String("://dark/button/core_button_pressed.png"), 61 | QMargins(13, 13, 13, 13), 62 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 63 | addDescriptor(PB_Disabled, 64 | QLatin1String("://dark/button/core_button_disabled.png"), 65 | QMargins(13, 13, 13, 13), 66 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 67 | addDescriptor(PB_PressedDisabled, 68 | QLatin1String("://dark/button/core_button_disabled_selected.png"), 69 | QMargins(13, 13, 13, 13), 70 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 71 | 72 | addDescriptor(LE_Enabled, 73 | QLatin1String("://dark/lineedit/core_textinput_bg.png"), 74 | QMargins(8, 8, 8, 8)); 75 | addDescriptor(LE_Disabled, 76 | QLatin1String("://dark/lineedit/core_textinput_bg_disabled.png"), 77 | QMargins(8, 8, 8, 8)); 78 | addDescriptor(LE_Focused, 79 | QLatin1String("://dark/lineedit/core_textinput_bg_highlight.png"), 80 | QMargins(8, 8, 8, 8)); 81 | 82 | copyDescriptor(LE_Enabled, TE_Enabled); 83 | copyDescriptor(LE_Disabled, TE_Disabled); 84 | copyDescriptor(LE_Focused, TE_Focused); 85 | 86 | addPixmap(CB_Enabled, 87 | QLatin1String("://dark/checkbox/core_checkbox_enabled.png"), 88 | QMargins(16, 16, 16, 16)); 89 | addPixmap(CB_Checked, 90 | QLatin1String("://dark/checkbox/core_checkbox_checked.png"), 91 | QMargins(16, 16, 16, 16)); 92 | addPixmap(CB_Pressed, 93 | QLatin1String("://dark/checkbox/core_checkbox_pressed.png"), 94 | QMargins(16, 16, 16, 16)); 95 | addPixmap(CB_PressedChecked, 96 | QLatin1String("://dark/checkbox/core_checkbox_pressed_checked.png"), 97 | QMargins(16, 16, 16, 16)); 98 | addPixmap(CB_Disabled, 99 | QLatin1String("://dark/checkbox/core_checkbox_disabled.png"), 100 | QMargins(16, 16, 16, 16)); 101 | addPixmap(CB_DisabledChecked, 102 | QLatin1String("://dark/checkbox/core_checkbox_disabled_checked.png"), 103 | QMargins(16, 16, 16, 16)); 104 | 105 | addPixmap(RB_Enabled, 106 | QLatin1String("://dark/radiobutton/core_radiobutton_inactive.png"), 107 | QMargins(16, 16, 16, 16)); 108 | addPixmap(RB_Checked, 109 | QLatin1String("://dark/radiobutton/core_radiobutton_checked.png"), 110 | QMargins(16, 16, 16, 16)); 111 | addPixmap(RB_Pressed, 112 | QLatin1String("://dark/radiobutton/core_radiobutton_pressed.png"), 113 | QMargins(16, 16, 16, 16)); 114 | addPixmap(RB_Disabled, 115 | QLatin1String("://dark/radiobutton/core_radiobutton_disabled.png"), 116 | QMargins(16, 16, 16, 16)); 117 | addPixmap(RB_DisabledChecked, 118 | QLatin1String("://dark/radiobutton/core_radiobutton_disabled_checked.png"), 119 | QMargins(16, 16, 16, 16)); 120 | 121 | addDescriptor(PB_HBackground, 122 | QLatin1String("://dark/progressbar/core_progressindicator_bg.png"), 123 | QMargins(10, 10, 10, 10), 124 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 125 | addDescriptor(PB_HContent, 126 | QLatin1String("://dark/progressbar/core_progressindicator_fill.png"), 127 | QMargins(10, 10, 10, 10), 128 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 129 | addDescriptor(PB_HComplete, 130 | QLatin1String("://dark/progressbar/core_progressindicator_complete.png"), 131 | QMargins(10, 10, 10, 10), 132 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 133 | addDescriptor(PB_VBackground, 134 | QLatin1String("://dark/progressbar/core_progressindicator_vbg.png"), 135 | QMargins(10, 10, 10, 10), 136 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 137 | addDescriptor(PB_VContent, 138 | QLatin1String("://dark/progressbar/core_progressindicator_vfill.png"), 139 | QMargins(10, 10, 10, 10), 140 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 141 | addDescriptor(PB_VComplete, 142 | QLatin1String("://dark/progressbar/core_progressindicator_vcomplete.png"), 143 | QMargins(10, 10, 10, 10), 144 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 145 | 146 | addDescriptor(SG_HEnabled, 147 | QLatin1String("://dark/slider/core_slider_enabled.png"), 148 | QMargins(50, 50, 50, 50), 149 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 150 | addDescriptor(SG_HDisabled, 151 | QLatin1String("://dark/slider/core_slider_disabled.png"), 152 | QMargins(50, 50, 50, 50), 153 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 154 | addDescriptor(SG_HActiveEnabled, 155 | QLatin1String("://dark/slider/core_slider_inactive.png"), 156 | QMargins(50, 50, 50, 50), 157 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 158 | addDescriptor(SG_HActivePressed, 159 | QLatin1String("://dark/slider/core_slider_active.png"), 160 | QMargins(50, 50, 50, 50), 161 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 162 | addDescriptor(SG_HActiveDisabled, 163 | QLatin1String("://dark/slider/core_slider_cache.png"), 164 | QMargins(50, 50, 50, 50), 165 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 166 | addDescriptor(SG_VEnabled, 167 | QLatin1String("://dark/slider/core_slider_venabled.png"), 168 | QMargins(50, 50, 50, 50), 169 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 170 | addDescriptor(SG_VDisabled, 171 | QLatin1String("://dark/slider/core_slider_vdisabled.png"), 172 | QMargins(50, 50, 50, 50), 173 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 174 | addDescriptor(SG_VActiveEnabled, 175 | QLatin1String("://dark/slider/core_slider_vinactive.png"), 176 | QMargins(50, 50, 50, 50), 177 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 178 | addDescriptor(SG_VActivePressed, 179 | QLatin1String("://dark/slider/core_slider_vactive.png"), 180 | QMargins(50, 50, 50, 50), 181 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 182 | addDescriptor(SG_VActiveDisabled, 183 | QLatin1String("://dark/slider/core_slider_vcache.png"), 184 | QMargins(50, 50, 50, 50), 185 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 186 | 187 | addPixmap(SH_HEnabled, 188 | QLatin1String("://dark/slider/core_slider_handle.png")); 189 | addPixmap(SH_HDisabled, 190 | QLatin1String("://dark/slider/core_slider_handle_disabled.png")); 191 | addPixmap(SH_HPressed, 192 | QLatin1String("://dark/slider/core_slider_handle_pressed.png")); 193 | addPixmap(SH_VEnabled, 194 | QLatin1String("://dark/slider/core_slider_handle.png")); 195 | addPixmap(SH_VDisabled, 196 | QLatin1String("://dark/slider/core_slider_handle_disabled.png")); 197 | addPixmap(SH_VPressed, 198 | QLatin1String("://dark/slider/core_slider_handle_pressed.png")); 199 | 200 | addDescriptor(DD_ButtonEnabled, 201 | QLatin1String("://dark/combobox/core_dropdown_button.png"), 202 | QMargins(14, 14, 14, 14), 203 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 204 | addDescriptor(DD_ButtonDisabled, 205 | QLatin1String("://dark/combobox/core_dropdown_button_disabled.png"), 206 | QMargins(14, 14, 14, 14), 207 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 208 | addDescriptor(DD_ButtonPressed, 209 | QLatin1String("://dark/combobox/core_dropdown_button_pressed.png"), 210 | QMargins(14, 14, 14, 14), 211 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 212 | addDescriptor(DD_ItemSelected, 213 | QLatin1String("://dark/combobox/core_listitem_active.png")); 214 | addPixmap(DD_ArrowEnabled, 215 | QLatin1String("://dark/combobox/core_dropdown_button_arrowdown.png"), 216 | QMargins(35, 39, 35, 39)); 217 | copyPixmap(DD_ArrowEnabled, DD_ArrowDisabled); 218 | addPixmap(DD_ArrowPressed, 219 | QLatin1String("://dark/combobox/core_dropdown_button_arrowdown_pressed.png"), 220 | QMargins(35, 39, 35, 39)); 221 | addPixmap(DD_ArrowOpen, 222 | QLatin1String("://dark/combobox/core_dropdown_button_arrowup.png"), 223 | QMargins(35, 39, 35, 39)); 224 | addDescriptor(DD_PopupDown, 225 | QLatin1String("://dark/combobox/core_dropdown_menu.png"), 226 | QMargins(12, 12, 12, 12), QTileRules(Qt::StretchTile, Qt::StretchTile)); 227 | addDescriptor(DD_PopupUp, 228 | QLatin1String("://dark/combobox/core_dropdown_menuup.png"), 229 | QMargins(12, 12, 12, 12), QTileRules(Qt::StretchTile, Qt::StretchTile)); 230 | addPixmap(DD_ItemSeparator, 231 | QLatin1String("://dark/combobox/core_dropdown_divider.png"), 232 | QMargins(5, 0, 5, 0)); 233 | 234 | addDescriptor(ID_Selected, 235 | QLatin1String("://dark/listitem/core_listitem_active.png")); 236 | addPixmap(ID_Separator, 237 | QLatin1String("://dark/listitem/core_listitem_divider.png")); 238 | 239 | addDescriptor(SB_Horizontal, 240 | QLatin1String("://dark/scrollbar/core_scrollbar.png"), 241 | QMargins(7, 8, 7, 8), 242 | QTileRules(Qt::RepeatTile, Qt::StretchTile)); 243 | addDescriptor(SB_Vertical, 244 | QLatin1String("://dark/scrollbar/core_scrollbar_v.png"), 245 | QMargins(8, 7, 8, 7), 246 | QTileRules(Qt::StretchTile, Qt::RepeatTile)); 247 | } 248 | 249 | QBB10DarkStyle::~QBB10DarkStyle() 250 | { 251 | } 252 | 253 | void QBB10DarkStyle::polish(QApplication *application) 254 | { 255 | QPixmapStyle::polish(application); 256 | } 257 | 258 | void QBB10DarkStyle::polish(QWidget *widget) 259 | { 260 | // Hide the text by default 261 | if (QProgressBar *pb = qobject_cast(widget)) 262 | pb->setTextVisible(false); 263 | 264 | if (QComboBox *cb = qobject_cast(widget)) { 265 | QAbstractItemView *list = cb->view(); 266 | QPalette p = list->palette(); 267 | p.setBrush(QPalette::HighlightedText, p.brush(QPalette::Text)); 268 | list->setPalette(p); 269 | } 270 | 271 | if (qobject_cast(widget) || qobject_cast(widget)) { 272 | QPalette p = widget->palette(); 273 | p.setBrush(QPalette::Text, QColor(38, 38, 38)); 274 | widget->setPalette(p); 275 | } 276 | 277 | if (qobject_cast(widget)) { 278 | QPalette p = widget->palette(); 279 | p.setBrush(QPalette::Disabled, QPalette::HighlightedText, p.brush(QPalette::Text)); 280 | widget->setPalette(p); 281 | } 282 | 283 | QPixmapStyle::polish(widget); 284 | } 285 | 286 | QPalette QBB10DarkStyle::standardPalette() const 287 | { 288 | QPalette p; 289 | 290 | QColor color = QColor(250, 250, 250); 291 | p.setBrush(QPalette::ButtonText, color); 292 | p.setBrush(QPalette::WindowText, color); 293 | p.setBrush(QPalette::Text, color); 294 | 295 | color.setAlpha(179); 296 | p.setBrush(QPalette::Disabled, QPalette::ButtonText, color); 297 | p.setBrush(QPalette::Disabled, QPalette::WindowText, color); 298 | p.setBrush(QPalette::Disabled, QPalette::Text, color); 299 | 300 | p.setColor(QPalette::Window, QColor(18, 18, 18)); 301 | 302 | p.setBrush(QPalette::Highlight, QColor(0, 168, 223)); 303 | p.setBrush(QPalette::HighlightedText, QColor(250, 250,250)); 304 | 305 | return p; 306 | } 307 | 308 | void QBB10DarkStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option, 309 | QPainter *painter, const QWidget *widget) const 310 | { 311 | switch (element) { 312 | case CE_PushButtonLabel: 313 | { 314 | const bool on = option->state & State_On || option->state & State_Sunken; 315 | const QStyleOptionButton *button = qstyleoption_cast(option); 316 | QStyleOptionButton newOpt = *button; 317 | if (on) 318 | newOpt.palette.setBrush(QPalette::ButtonText, QColor(38, 38, 38)); 319 | QPixmapStyle::drawControl(CE_PushButtonLabel, &newOpt, painter, widget); 320 | break; 321 | } 322 | case CE_ProgressBarLabel: 323 | // Don't draw the progress bar label 324 | break; 325 | default: 326 | QPixmapStyle::drawControl(element, option, painter, widget); 327 | } 328 | } 329 | 330 | void QBB10DarkStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, 331 | QPainter *painter, const QWidget *widget) const 332 | { 333 | QPixmapStyle::drawPrimitive(element, option, painter, widget); 334 | 335 | if (element == PE_PanelItemViewItem) { 336 | // Draw the checkbox for current item 337 | if (widget->property("_pixmap_combobox_list").toBool() 338 | && option->state & QStyle::State_Selected) { 339 | QPixmap pix(QLatin1String("://dark/combobox/core_dropdown_checkmark.png")); 340 | QRect rect = option->rect; 341 | const int margin = rect.height() / 2; 342 | QPoint pos(rect.right() - margin - pix.width() / 2, 343 | rect.top() + margin - pix.height() / 2); 344 | painter->drawPixmap(pos, pix); 345 | } 346 | } 347 | } 348 | 349 | QT_END_NAMESPACE 350 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10darkstyle.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QBB10DARKSTYLE_H 35 | #define QBB10DARKSTYLE_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | 41 | class QBB10DarkStyle : public QPixmapStyle 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | QBB10DarkStyle(); 47 | ~QBB10DarkStyle(); 48 | 49 | void polish(QApplication *application) Q_DECL_OVERRIDE; 50 | void polish(QWidget *widget) Q_DECL_OVERRIDE; 51 | 52 | QPalette standardPalette() const Q_DECL_OVERRIDE; 53 | 54 | void drawControl(ControlElement element, const QStyleOption *option, 55 | QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 56 | void drawPrimitive(PrimitiveElement element, const QStyleOption *option, 57 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 58 | }; 59 | 60 | QT_END_NAMESPACE 61 | 62 | #endif // QBB10DARKSTYLE_H 63 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10darkstyle.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | dark/button/core_button_disabled.png 4 | dark/button/core_button_disabled_selected.png 5 | dark/button/core_button_inactive.png 6 | dark/button/core_button_enabled_selected.png 7 | dark/button/core_button_pressed.png 8 | dark/checkbox/core_checkbox_checked.png 9 | dark/checkbox/core_checkbox_disabled.png 10 | dark/checkbox/core_checkbox_disabled_checked.png 11 | dark/checkbox/core_checkbox_enabled.png 12 | dark/checkbox/core_checkbox_pressed.png 13 | dark/checkbox/core_checkbox_pressed_checked.png 14 | dark/combobox/core_dropdown_button.png 15 | dark/combobox/core_dropdown_button_arrowdown.png 16 | dark/combobox/core_dropdown_button_arrowdown_pressed.png 17 | dark/combobox/core_dropdown_button_arrowup.png 18 | dark/combobox/core_dropdown_button_disabled.png 19 | dark/combobox/core_dropdown_button_pressed.png 20 | dark/combobox/core_dropdown_checkmark.png 21 | dark/combobox/core_dropdown_divider.png 22 | dark/combobox/core_dropdown_menu.png 23 | dark/combobox/core_dropdown_menuup.png 24 | dark/combobox/core_listitem_active.png 25 | dark/lineedit/core_textinput_bg.png 26 | dark/lineedit/core_textinput_bg_disabled.png 27 | dark/lineedit/core_textinput_bg_highlight.png 28 | dark/listitem/core_listitem_active.png 29 | dark/listitem/core_listitem_divider.png 30 | dark/progressbar/core_progressindicator_bg.png 31 | dark/progressbar/core_progressindicator_complete.png 32 | dark/progressbar/core_progressindicator_fill.png 33 | dark/progressbar/core_progressindicator_vbg.png 34 | dark/progressbar/core_progressindicator_vcomplete.png 35 | dark/progressbar/core_progressindicator_vfill.png 36 | dark/radiobutton/core_radiobutton_checked.png 37 | dark/radiobutton/core_radiobutton_disabled.png 38 | dark/radiobutton/core_radiobutton_disabled_checked.png 39 | dark/radiobutton/core_radiobutton_inactive.png 40 | dark/radiobutton/core_radiobutton_pressed.png 41 | dark/scrollbar/core_scrollbar.png 42 | dark/scrollbar/core_scrollbar_v.png 43 | dark/slider/core_slider_active.png 44 | dark/slider/core_slider_cache.png 45 | dark/slider/core_slider_disabled.png 46 | dark/slider/core_slider_enabled.png 47 | dark/slider/core_slider_handle.png 48 | dark/slider/core_slider_handle_disabled.png 49 | dark/slider/core_slider_handle_pressed.png 50 | dark/slider/core_slider_inactive.png 51 | dark/slider/core_slider_vactive.png 52 | dark/slider/core_slider_vcache.png 53 | dark/slider/core_slider_vdisabled.png 54 | dark/slider/core_slider_venabled.png 55 | dark/slider/core_slider_vinactive.png 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10styleplugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "qbb10styleplugin.h" 35 | #include "qbb10darkstyle.h" 36 | #include "qbb10brightstyle.h" 37 | 38 | QT_BEGIN_NAMESPACE 39 | 40 | QBB10StylePlugin::QBB10StylePlugin() 41 | { 42 | } 43 | 44 | QBB10StylePlugin::~QBB10StylePlugin() 45 | { 46 | } 47 | 48 | QStyle *QBB10StylePlugin::create(const QString &key) 49 | { 50 | const QString keyLower(key.toLower()); 51 | if (keyLower == QLatin1String("bb10bright")) 52 | return new QBB10BrightStyle; 53 | else if (keyLower == QLatin1String("bb10dark")) 54 | return new QBB10DarkStyle; 55 | 56 | return 0; 57 | } 58 | 59 | QT_END_NAMESPACE 60 | 61 | #include "moc_qbb10styleplugin.cpp" 62 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10styleplugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 BlackBerry Limited. All rights reserved. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QBB10STYLEPLUGIN_H 35 | #define QBB10STYLEPLUGIN_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | 41 | class QBB10StylePlugin : public QStylePlugin 42 | { 43 | Q_OBJECT 44 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "qbb10styleplugin.json") 45 | 46 | public: 47 | QBB10StylePlugin(); 48 | ~QBB10StylePlugin(); 49 | 50 | QStyle *create(const QString &key) Q_DECL_OVERRIDE; 51 | }; 52 | 53 | QT_END_NAMESPACE 54 | 55 | #endif // QBB10STYLEPLUGIN_H 56 | -------------------------------------------------------------------------------- /src/plugins/styles/bb10style/qbb10styleplugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "bb10bright", "bb10dark" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/styles/cleanlooks/cleanlooks.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "cleanlooks" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/styles/cleanlooks/cleanlooks.pro: -------------------------------------------------------------------------------- 1 | TARGET = qcleanlooksstyle 2 | PLUGIN_TYPE = styles 3 | PLUGIN_CLASS_NAME = QCleanlooksStylePlugin 4 | load(qt_plugin) 5 | 6 | QT = core gui widgets 7 | 8 | HEADERS += qcleanlooksstyle.h 9 | SOURCES += qcleanlooksstyle.cpp 10 | SOURCES += plugin.cpp 11 | 12 | include(../shared/shared.pri) 13 | 14 | OTHER_FILES += cleanlooks.json 15 | -------------------------------------------------------------------------------- /src/plugins/styles/cleanlooks/plugin.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the MNG plugins in the Qt ImageFormats module. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | #include "qcleanlooksstyle.h" 44 | 45 | QT_BEGIN_NAMESPACE 46 | 47 | class QCleanlooksStylePlugin : public QStylePlugin 48 | { 49 | Q_OBJECT 50 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "cleanlooks.json") 51 | 52 | public: 53 | QStyle *create(const QString &key); 54 | }; 55 | 56 | QStyle *QCleanlooksStylePlugin::create(const QString &key) 57 | { 58 | if (key == "cleanlooks") 59 | return new QCleanlooksStyle; 60 | return 0; 61 | } 62 | 63 | QT_END_NAMESPACE 64 | 65 | #include "plugin.moc" 66 | -------------------------------------------------------------------------------- /src/plugins/styles/cleanlooks/qcleanlooksstyle.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef QCLEANLOOKSSTYLE_H 43 | #define QCLEANLOOKSSTYLE_H 44 | 45 | #include 46 | #include 47 | 48 | QT_BEGIN_HEADER 49 | 50 | QT_BEGIN_NAMESPACE 51 | 52 | class QProgressBar; 53 | 54 | class QCleanlooksStyle : public QProxyStyle 55 | { 56 | Q_OBJECT 57 | 58 | public: 59 | QCleanlooksStyle(); 60 | ~QCleanlooksStyle(); 61 | 62 | QPalette standardPalette () const Q_DECL_OVERRIDE; 63 | void drawPrimitive(PrimitiveElement elem, 64 | const QStyleOption *option, 65 | QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 66 | void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter, 67 | const QWidget *widget) const Q_DECL_OVERRIDE; 68 | int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 69 | void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, 70 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 71 | QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 72 | QSize sizeFromContents(ContentsType type, const QStyleOption *option, 73 | const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE; 74 | SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, 75 | const QPoint &pt, const QWidget *w = 0) const Q_DECL_OVERRIDE; 76 | QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, 77 | SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE; 78 | QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, 79 | const QStyleOption *opt) const Q_DECL_OVERRIDE; 80 | int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, 81 | QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE; 82 | QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE; 83 | QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0, 84 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 85 | QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, 86 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 87 | void drawItemPixmap(QPainter *painter, const QRect &rect, 88 | int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE; 89 | void drawItemText(QPainter *painter, const QRect &rect, 90 | int flags, const QPalette &pal, bool enabled, 91 | const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const Q_DECL_OVERRIDE; 92 | void polish(QWidget *widget) Q_DECL_OVERRIDE; 93 | void polish(QApplication *app) Q_DECL_OVERRIDE; 94 | void polish(QPalette &pal) Q_DECL_OVERRIDE; 95 | void unpolish(QWidget *widget) Q_DECL_OVERRIDE; 96 | void unpolish(QApplication *app) Q_DECL_OVERRIDE; 97 | 98 | 99 | protected: 100 | bool event(QEvent *event) Q_DECL_OVERRIDE; 101 | bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; 102 | void startProgressAnimation(QObject *o, QProgressBar *bar); 103 | void stopProgressAnimation(QObject *o, QProgressBar *bar); 104 | 105 | private: 106 | int animateStep; 107 | int animateTimer; 108 | QElapsedTimer startTime; 109 | QList animatedProgressBars; 110 | }; 111 | 112 | QT_END_NAMESPACE 113 | 114 | QT_END_HEADER 115 | 116 | #endif // QCLEANLOOKSSTYLE_H 117 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/gtk2.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "gtk2" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/gtk2.pro: -------------------------------------------------------------------------------- 1 | TARGET = qgtk2style 2 | PLUGIN_TYPE = styles 3 | PLUGIN_CLASS_NAME = QGtk2StylePlugin 4 | load(qt_plugin) 5 | 6 | QT = core-private gui-private widgets-private 7 | 8 | CONFIG += link_pkgconfig 9 | PKGCONFIG += gtk+-2.0 x11 10 | 11 | HEADERS += qgtk2painter_p.h qgtkglobal_p.h qgtkpainter_p.h qgtkstyle_p.h qgtkstyle_p_p.h 12 | SOURCES += qgtk2painter.cpp qgtkpainter.cpp qgtkstyle.cpp qgtkstyle_p.cpp plugin.cpp 13 | DEFINES += QT_NO_ANIMATION 14 | 15 | include(../shared/shared.pri) 16 | 17 | OTHER_FILES += gtk2.json 18 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/plugin.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include 35 | #include "qgtkstyle_p.h" 36 | 37 | QT_BEGIN_NAMESPACE 38 | 39 | class QGtk2StylePlugin : public QStylePlugin 40 | { 41 | Q_OBJECT 42 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "gtk2.json") 43 | 44 | public: 45 | QStyle *create(const QString &key); 46 | }; 47 | 48 | QStyle *QGtk2StylePlugin::create(const QString &key) 49 | { 50 | if (key == "gtk2") 51 | return new QGtkStyle; 52 | return 0; 53 | } 54 | 55 | QT_END_NAMESPACE 56 | 57 | #include "plugin.moc" 58 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/qgtk2painter_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTK2PAINTER_P_H 35 | #define QGTK2PAINTER_P_H 36 | 37 | // 38 | // W A R N I N G 39 | // ------------- 40 | // 41 | // This file is not part of the Qt API. It exists purely as an 42 | // implementation detail. This header file may change from version to 43 | // version without notice, or even be removed. 44 | // 45 | // We mean it. 46 | // 47 | 48 | #include 49 | 50 | #include "qgtkpainter_p.h" 51 | 52 | QT_BEGIN_NAMESPACE 53 | 54 | class QGtk2Painter : public QGtkPainter 55 | { 56 | public: 57 | QGtk2Painter(); 58 | 59 | void paintBoxGap(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, 60 | GtkStateType state, GtkShadowType shadow, GtkPositionType gap_side, gint x, 61 | gint width, GtkStyle *style) Q_DECL_OVERRIDE; 62 | void paintBox(GtkWidget *gtkWidget, const gchar* part, 63 | const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, 64 | const QString &pmKey = QString()) Q_DECL_OVERRIDE; 65 | void paintHline(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style, 66 | int x1, int x2, int y, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 67 | void paintVline(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style, 68 | int y1, int y2, int x, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 69 | void paintExpander(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, 70 | GtkExpanderStyle expander_state, GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 71 | void paintFocus(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style, 72 | const QString &pmKey = QString()) Q_DECL_OVERRIDE; 73 | void paintResizeGrip(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 74 | GdkWindowEdge edge, GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 75 | void paintArrow(GtkWidget *gtkWidget, const gchar* part, const QRect &arrowrect, GtkArrowType arrow_type, GtkStateType state, GtkShadowType shadow, 76 | gboolean fill, GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 77 | void paintHandle(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, 78 | GtkStateType state, GtkShadowType shadow, GtkOrientation orientation, GtkStyle *style) Q_DECL_OVERRIDE; 79 | void paintSlider(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 80 | GtkStyle *style, GtkOrientation orientation, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 81 | void paintShadow(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 82 | GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE; 83 | void paintFlatBox(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString & = QString()) Q_DECL_OVERRIDE; 84 | void paintExtention(GtkWidget *gtkWidget, const gchar *part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 85 | GtkPositionType gap_pos, GtkStyle *style) Q_DECL_OVERRIDE; 86 | void paintOption(GtkWidget *gtkWidget, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString &detail) Q_DECL_OVERRIDE; 87 | void paintCheckbox(GtkWidget *gtkWidget, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString &detail) Q_DECL_OVERRIDE; 88 | 89 | private: 90 | QPixmap renderTheme(uchar *bdata, uchar *wdata, const QRect &rect) const; 91 | 92 | GtkWidget *m_window; 93 | }; 94 | 95 | QT_END_NAMESPACE 96 | 97 | #endif // QGTK2PAINTER_P_H 98 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/qgtkglobal_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTKGLOBAL_P_H 35 | #define QGTKGLOBAL_P_H 36 | 37 | // 38 | // W A R N I N G 39 | // ------------- 40 | // 41 | // This file is not part of the Qt API. It exists purely as an 42 | // implementation detail. This header file may change from version to 43 | // version without notice, or even be removed. 44 | // 45 | // We mean it. 46 | // 47 | 48 | #include 49 | 50 | #undef signals // Collides with GTK symbols 51 | #include 52 | 53 | typedef unsigned long XID; 54 | 55 | #undef GTK_OBJECT_FLAGS 56 | #define GTK_OBJECT_FLAGS(obj)(((GtkObject*)(obj))->flags) 57 | 58 | #define QLS(x) QLatin1String(x) 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | #if Q_BYTE_ORDER == Q_BIG_ENDIAN 63 | # define QT_RED 3 64 | # define QT_GREEN 2 65 | # define QT_BLUE 1 66 | # define QT_ALPHA 0 67 | #else 68 | # define QT_RED 0 69 | # define QT_GREEN 1 70 | # define QT_BLUE 2 71 | # define QT_ALPHA 3 72 | #endif 73 | # define GTK_RED 2 74 | # define GTK_GREEN 1 75 | # define GTK_BLUE 0 76 | # define GTK_ALPHA 3 77 | 78 | QT_END_NAMESPACE 79 | 80 | #endif // QGTKGLOBAL_P_H 81 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/qgtkpainter.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "qgtkpainter_p.h" 35 | 36 | #include 37 | 38 | QT_BEGIN_NAMESPACE 39 | 40 | QGtkPainter::QGtkPainter() 41 | { 42 | reset(0); 43 | } 44 | 45 | QGtkPainter::~QGtkPainter() 46 | { 47 | } 48 | 49 | void QGtkPainter::reset(QPainter *painter) 50 | { 51 | m_painter = painter; 52 | m_alpha = true; 53 | m_hflipped = false; 54 | m_vflipped = false; 55 | m_usePixmapCache = true; 56 | m_cliprect = QRect(); 57 | } 58 | 59 | QString QGtkPainter::uniqueName(const QString &key, GtkStateType state, GtkShadowType shadow, 60 | const QSize &size, GtkWidget *widget) 61 | { 62 | // Note the widget arg should ideally use the widget path, though would compromise performance 63 | QString tmp = key 64 | % HexString(state) 65 | % HexString(shadow) 66 | % HexString(size.width()) 67 | % HexString(size.height()) 68 | % HexString(quint64(widget)); 69 | return tmp; 70 | } 71 | 72 | QT_END_NAMESPACE 73 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/qgtkpainter_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTKPAINTER_H 35 | #define QGTKPAINTER_H 36 | 37 | // 38 | // W A R N I N G 39 | // ------------- 40 | // 41 | // This file is not part of the Qt API. It exists purely as an 42 | // implementation detail. This header file may change from version to 43 | // version without notice, or even be removed. 44 | // 45 | // We mean it. 46 | // 47 | 48 | #include 49 | 50 | #include "qgtkglobal_p.h" 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | 57 | QT_BEGIN_NAMESPACE 58 | 59 | class QGtkPainter 60 | { 61 | public: 62 | QGtkPainter(); 63 | virtual ~QGtkPainter(); 64 | 65 | void reset(QPainter *painter = 0); 66 | 67 | void setAlphaSupport(bool value) { m_alpha = value; } 68 | void setClipRect(const QRect &rect) { m_cliprect = rect; } 69 | void setFlipHorizontal(bool value) { m_hflipped = value; } 70 | void setFlipVertical(bool value) { m_vflipped = value; } 71 | void setUsePixmapCache(bool value) { m_usePixmapCache = value; } 72 | 73 | virtual void paintBoxGap(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, 74 | GtkStateType state, GtkShadowType shadow, GtkPositionType gap_side, gint x, 75 | gint width, GtkStyle *style) = 0; 76 | virtual void paintBox(GtkWidget *gtkWidget, const gchar* part, 77 | const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, 78 | const QString &pmKey = QString()) = 0; 79 | virtual void paintHline(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style, 80 | int x1, int x2, int y, const QString &pmKey = QString()) = 0; 81 | virtual void paintVline(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style, 82 | int y1, int y2, int x, const QString &pmKey = QString()) = 0; 83 | virtual void paintExpander(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, 84 | GtkExpanderStyle expander_state, GtkStyle *style, const QString &pmKey = QString()) = 0; 85 | virtual void paintFocus(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style, 86 | const QString &pmKey = QString()) = 0; 87 | virtual void paintResizeGrip(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 88 | GdkWindowEdge edge, GtkStyle *style, const QString &pmKey = QString()) = 0; 89 | virtual void paintArrow(GtkWidget *gtkWidget, const gchar* part, const QRect &arrowrect, GtkArrowType arrow_type, GtkStateType state, GtkShadowType shadow, 90 | gboolean fill, GtkStyle *style, const QString &pmKey = QString()) = 0; 91 | virtual void paintHandle(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, 92 | GtkStateType state, GtkShadowType shadow, GtkOrientation orientation, GtkStyle *style) = 0; 93 | virtual void paintSlider(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 94 | GtkStyle *style, GtkOrientation orientation, const QString &pmKey = QString()) = 0; 95 | virtual void paintShadow(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 96 | GtkStyle *style, const QString &pmKey = QString()) = 0; 97 | virtual void paintFlatBox(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString & = QString()) = 0; 98 | virtual void paintExtention(GtkWidget *gtkWidget, const gchar *part, const QRect &rect, GtkStateType state, GtkShadowType shadow, 99 | GtkPositionType gap_pos, GtkStyle *style) = 0; 100 | virtual void paintOption(GtkWidget *gtkWidget, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString &detail) = 0; 101 | virtual void paintCheckbox(GtkWidget *gtkWidget, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString &detail) = 0; 102 | 103 | protected: 104 | static QString uniqueName(const QString &key, GtkStateType state, GtkShadowType shadow, const QSize &size, GtkWidget *widget = 0); 105 | 106 | QPainter *m_painter; 107 | bool m_alpha; 108 | bool m_hflipped; 109 | bool m_vflipped; 110 | bool m_usePixmapCache; 111 | QRect m_cliprect; 112 | }; 113 | 114 | QT_END_NAMESPACE 115 | 116 | #endif // QGTKPAINTER_H 117 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/qgtkstyle_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTKSTYLE_P_H 35 | #define QGTKSTYLE_P_H 36 | 37 | // 38 | // W A R N I N G 39 | // ------------- 40 | // 41 | // This file is not part of the Qt API. It exists purely as an 42 | // implementation detail. This header file may change from version to 43 | // version without notice, or even be removed. 44 | // 45 | // We mean it. 46 | // 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | QT_BEGIN_NAMESPACE 54 | 55 | 56 | class QPainterPath; 57 | class QGtkStylePrivate; 58 | 59 | class QGtkStyle : public QCommonStyle 60 | { 61 | Q_OBJECT 62 | Q_DECLARE_PRIVATE(QGtkStyle) 63 | 64 | public: 65 | QGtkStyle(); 66 | QGtkStyle(QGtkStylePrivate &dd); 67 | 68 | ~QGtkStyle(); 69 | 70 | QPalette standardPalette() const Q_DECL_OVERRIDE; 71 | 72 | void drawPrimitive(PrimitiveElement element, const QStyleOption *option, 73 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 74 | void drawControl(ControlElement control, const QStyleOption *option, 75 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 76 | void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, 77 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 78 | void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, 79 | const QPixmap &pixmap) const Q_DECL_OVERRIDE; 80 | void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal, 81 | bool enabled, const QString& text, QPalette::ColorRole textRole) const Q_DECL_OVERRIDE; 82 | 83 | int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, 84 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 85 | int styleHint(StyleHint hint, const QStyleOption *option, 86 | const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE; 87 | 88 | QStyle::SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, 89 | const QPoint &pt, const QWidget *w) const Q_DECL_OVERRIDE; 90 | 91 | QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, 92 | SubControl subControl, const QWidget *widget) const Q_DECL_OVERRIDE; 93 | QRect subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const Q_DECL_OVERRIDE; 94 | QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE; 95 | 96 | 97 | QSize sizeFromContents(ContentsType type, const QStyleOption *option, 98 | const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE; 99 | QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0, 100 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 101 | QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *option, 102 | const QWidget *widget) const Q_DECL_OVERRIDE; 103 | QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, 104 | const QStyleOption *opt) const Q_DECL_OVERRIDE; 105 | 106 | void polish(QWidget *widget) Q_DECL_OVERRIDE; 107 | void polish(QApplication *app) Q_DECL_OVERRIDE; 108 | void polish(QPalette &palette) Q_DECL_OVERRIDE; 109 | 110 | void unpolish(QWidget *widget) Q_DECL_OVERRIDE; 111 | void unpolish(QApplication *app) Q_DECL_OVERRIDE; 112 | }; 113 | 114 | QT_END_NAMESPACE 115 | 116 | #endif //QGTKSTYLE_P_H 117 | -------------------------------------------------------------------------------- /src/plugins/styles/gtk2/qgtkstyle_p_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef QGTKSTYLE_P_P_H 35 | #define QGTKSTYLE_P_P_H 36 | 37 | // 38 | // W A R N I N G 39 | // ------------- 40 | // 41 | // This file is not part of the Qt API. It exists purely as an 42 | // implementation detail. This header file may change from version to 43 | // version without notice, or even be removed. 44 | // 45 | // We mean it. 46 | // 47 | 48 | #include 49 | 50 | #include 51 | #include 52 | #include 53 | 54 | #include 55 | 56 | #include "qgtkstyle_p.h" 57 | #include 58 | #include "qgtkglobal_p.h" 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | class QHashableLatin1Literal 63 | { 64 | public: 65 | int size() const { return m_size; } 66 | const char *data() const { return m_data; } 67 | 68 | #ifdef __SUNPRO_CC 69 | QHashableLatin1Literal(const char* str) 70 | : m_size(strlen(str)), m_data(str) {} 71 | #else 72 | template 73 | QHashableLatin1Literal(const char (&str)[N]) 74 | : m_size(N - 1), m_data(str) {} 75 | #endif 76 | 77 | QHashableLatin1Literal(const QHashableLatin1Literal &other) 78 | : m_size(other.m_size), m_data(other.m_data) 79 | {} 80 | 81 | QHashableLatin1Literal &operator=(const QHashableLatin1Literal &other) 82 | { 83 | if (this == &other) 84 | return *this; 85 | *const_cast(&m_size) = other.m_size; 86 | *const_cast(&m_data) = const_cast(other.m_data); 87 | return *this; 88 | } 89 | 90 | QString toString() const { return QString::fromLatin1(m_data, m_size); } 91 | 92 | static QHashableLatin1Literal fromData(const char *str) 93 | { 94 | return QHashableLatin1Literal(str, qstrlen(str)); 95 | } 96 | 97 | private: 98 | QHashableLatin1Literal(const char *str, int length) 99 | : m_size(length), m_data(str) 100 | {} 101 | 102 | const int m_size; 103 | const char *m_data; 104 | }; 105 | 106 | bool operator==(const QHashableLatin1Literal &l1, const QHashableLatin1Literal &l2); 107 | inline bool operator!=(const QHashableLatin1Literal &l1, const QHashableLatin1Literal &l2) { return !operator==(l1, l2); } 108 | uint qHash(const QHashableLatin1Literal &key); 109 | 110 | typedef void (*Ptr_ubuntu_gtk_set_use_overlay_scrollbar) (gboolean); 111 | 112 | class QGtkPainter; 113 | class QGtkStylePrivate; 114 | 115 | class QGtkStyleFilter : public QObject 116 | { 117 | public: 118 | QGtkStyleFilter(QGtkStylePrivate* sp) 119 | : stylePrivate(sp) 120 | {} 121 | private: 122 | QGtkStylePrivate* stylePrivate; 123 | bool eventFilter(QObject *obj, QEvent *e) Q_DECL_OVERRIDE; 124 | }; 125 | 126 | typedef enum { 127 | GNOME_ICON_LOOKUP_FLAGS_NONE = 0, 128 | GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT = 1<<0, 129 | GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES = 1<<1, 130 | GNOME_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES = 1<<2 131 | } GnomeIconLookupFlags; 132 | 133 | typedef enum { 134 | GNOME_ICON_LOOKUP_RESULT_FLAGS_NONE = 0, 135 | GNOME_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL = 1<<0 136 | } GnomeIconLookupResultFlags; 137 | 138 | struct GnomeThumbnailFactory; 139 | 140 | class QGtkStylePrivate : public QCommonStylePrivate 141 | { 142 | Q_DECLARE_PUBLIC(QGtkStyle) 143 | public: 144 | QGtkStylePrivate(); 145 | ~QGtkStylePrivate(); 146 | 147 | QGtkStyleFilter filter; 148 | 149 | static QGtkPainter* gtkPainter(QPainter *painter = 0); 150 | static GtkWidget* gtkWidget(const QHashableLatin1Literal &path); 151 | static GtkStyle* gtkStyle(const QHashableLatin1Literal &path = QHashableLatin1Literal("GtkWindow")); 152 | static void gtkWidgetSetFocus(GtkWidget *widget, bool focus); 153 | 154 | virtual void initGtkMenu() const; 155 | virtual void initGtkTreeview() const; 156 | virtual void initGtkWidgets() const; 157 | 158 | static void cleanupGtkWidgets(); 159 | 160 | static bool isKDE4Session(); 161 | void applyCustomPaletteHash(); 162 | static QFont getThemeFont(); 163 | static bool isThemeAvailable() { return gtkStyle() != 0; } 164 | 165 | static QString getThemeName(); 166 | virtual int getSpinboxArrowSize() const; 167 | 168 | virtual QPalette gtkWidgetPalette(const QHashableLatin1Literal >kWidgetName) const; 169 | 170 | static Ptr_ubuntu_gtk_set_use_overlay_scrollbar ubuntu_gtk_set_use_overlay_scrollbar; 171 | 172 | protected: 173 | typedef QHash WidgetMap; 174 | 175 | static inline void destroyWidgetMap() 176 | { 177 | cleanupGtkWidgets(); 178 | delete widgetMap; 179 | widgetMap = 0; 180 | } 181 | 182 | static inline WidgetMap *gtkWidgetMap() 183 | { 184 | if (!widgetMap) { 185 | widgetMap = new WidgetMap(); 186 | qAddPostRoutine(destroyWidgetMap); 187 | } 188 | return widgetMap; 189 | } 190 | 191 | static QStringList extract_filter(const QString &rawFilter); 192 | 193 | virtual GtkWidget* getTextColorWidget() const; 194 | static void setupGtkWidget(GtkWidget* widget); 195 | static void addWidgetToMap(GtkWidget* widget); 196 | static void addAllSubWidgets(GtkWidget *widget, gpointer v = 0); 197 | static void addWidget(GtkWidget *widget); 198 | static void removeWidgetFromMap(const QHashableLatin1Literal &path); 199 | 200 | virtual void init(); 201 | 202 | enum { 203 | menuItemFrame = 2, // menu item frame width 204 | menuItemHMargin = 3, // menu item hor text margin 205 | menuArrowHMargin = 6, // menu arrow horizontal margin 206 | menuItemVMargin = 2, // menu item ver text margin 207 | menuRightBorder = 15, // right border on menus 208 | menuCheckMarkWidth = 12 // checkmarks width on menus 209 | }; 210 | 211 | private: 212 | static QList instances; 213 | static WidgetMap *widgetMap; 214 | friend class QGtkStyleUpdateScheduler; 215 | }; 216 | 217 | // Helper to ensure that we have polished all our gtk widgets 218 | // before updating our own palettes 219 | class QGtkStyleUpdateScheduler : public QObject 220 | { 221 | Q_OBJECT 222 | public slots: 223 | void updateTheme(); 224 | }; 225 | 226 | QT_END_NAMESPACE 227 | 228 | #endif // QGTKSTYLE_P_P_H 229 | -------------------------------------------------------------------------------- /src/plugins/styles/motif/motif.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "motif", "cde" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/styles/motif/motif.pro: -------------------------------------------------------------------------------- 1 | TARGET = qmotifstyle 2 | PLUGIN_TYPE = styles 3 | PLUGIN_CLASS_NAME = QMotifStylePlugin 4 | load(qt_plugin) 5 | 6 | QT = core gui widgets 7 | 8 | HEADERS += qcdestyle.h 9 | HEADERS += qmotifstyle.h 10 | SOURCES += qcdestyle.cpp 11 | SOURCES += qmotifstyle.cpp 12 | SOURCES += plugin.cpp 13 | 14 | OTHER_FILES += motif.json 15 | -------------------------------------------------------------------------------- /src/plugins/styles/motif/plugin.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the MNG plugins in the Qt ImageFormats module. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | #include "qmotifstyle.h" 44 | #include "qcdestyle.h" 45 | 46 | QT_BEGIN_NAMESPACE 47 | 48 | class QMotifStylePlugin : public QStylePlugin 49 | { 50 | Q_OBJECT 51 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "motif.json") 52 | 53 | public: 54 | QStyle *create(const QString &key); 55 | }; 56 | 57 | QStyle *QMotifStylePlugin::create(const QString &key) 58 | { 59 | if (key == "motif") 60 | return new QMotifStyle; 61 | if (key == "cde") 62 | return new QCDEStyle; 63 | return 0; 64 | } 65 | 66 | QT_END_NAMESPACE 67 | 68 | #include "plugin.moc" 69 | -------------------------------------------------------------------------------- /src/plugins/styles/motif/qcdestyle.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include "qcdestyle.h" 43 | 44 | #include "qmenu.h" 45 | #include "qapplication.h" 46 | #include "qpainter.h" 47 | #include "qdrawutil.h" 48 | #include "qpixmap.h" 49 | #include "qpalette.h" 50 | #include "qwidget.h" 51 | #include "qpushbutton.h" 52 | #include "qscrollbar.h" 53 | #include "qtabbar.h" 54 | #include "qtabwidget.h" 55 | #include "qlistview.h" 56 | #include "qsplitter.h" 57 | #include "qslider.h" 58 | #include "qcombobox.h" 59 | #include "qlineedit.h" 60 | #include "qprogressbar.h" 61 | #include "qimage.h" 62 | #include "qfocusframe.h" 63 | #include "qpainterpath.h" 64 | #include "qdebug.h" 65 | #include 66 | 67 | QT_BEGIN_NAMESPACE 68 | 69 | /*! 70 | \class QCDEStyle 71 | \brief The QCDEStyle class provides a CDE look and feel. 72 | 73 | \ingroup appearance 74 | \inmodule QtWidgets 75 | 76 | This style provides a slightly improved Motif look similar to some 77 | versions of the Common Desktop Environment (CDE). The main 78 | differences are thinner frames and more modern radio buttons and 79 | checkboxes. Together with a dark background and a bright 80 | text/foreground color, the style looks quite attractive (at least 81 | for Motif fans). 82 | 83 | Note that most of the functions provided by QCDEStyle are 84 | reimplementations of QStyle functions; see QStyle for their 85 | documentation. QCDEStyle provides overloads for drawControl() and 86 | drawPrimitive() which are documented here. 87 | 88 | \image qcdestyle.png 89 | \sa QWindowsXPStyle, QMacStyle, QWindowsStyle, QPlastiqueStyle, QMotifStyle 90 | */ 91 | 92 | /*! 93 | Constructs a QCDEStyle. 94 | 95 | If \a useHighlightCols is false (the default), then the style will 96 | polish the application's color palette to emulate the Motif way of 97 | highlighting, which is a simple inversion between the base and the 98 | text color. 99 | */ 100 | QCDEStyle::QCDEStyle(bool useHighlightCols) 101 | : QMotifStyle(useHighlightCols) 102 | { 103 | spinboxHCoeff = 10; 104 | } 105 | 106 | /*! 107 | Destroys the style. 108 | */ 109 | QCDEStyle::~QCDEStyle() 110 | { 111 | } 112 | 113 | 114 | /*!\reimp 115 | */ 116 | int QCDEStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, 117 | const QWidget *widget) const 118 | /* 119 | int QCDEStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, 120 | const QWidget *widget) const 121 | */ 122 | { 123 | int ret = 0; 124 | 125 | switch (metric) { 126 | case PM_MenuBarPanelWidth: 127 | case PM_DefaultFrameWidth: 128 | case PM_FocusFrameVMargin: 129 | case PM_FocusFrameHMargin: 130 | case PM_MenuPanelWidth: 131 | case PM_SpinBoxFrameWidth: 132 | case PM_MenuBarVMargin: 133 | case PM_MenuBarHMargin: 134 | case PM_DockWidgetFrameWidth: 135 | ret = 1; 136 | break; 137 | case PM_ScrollBarExtent: 138 | ret = 13; 139 | break; 140 | default: 141 | ret = QMotifStyle::pixelMetric(metric, option, widget); 142 | break; 143 | } 144 | return ret; 145 | } 146 | 147 | /*! 148 | \reimp 149 | */ 150 | void QCDEStyle::drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, 151 | const QWidget *widget) const 152 | { 153 | 154 | switch (element) { 155 | case CE_MenuBarItem: { 156 | if (opt->state & State_Selected) // active item 157 | qDrawShadePanel(p, opt->rect, opt->palette, true, 1, 158 | &opt->palette.brush(QPalette::Button)); 159 | else // other item 160 | p->fillRect(opt->rect, opt->palette.brush(QPalette::Button)); 161 | QCommonStyle::drawControl(element, opt, p, widget); 162 | break; } 163 | case CE_RubberBand: { 164 | p->save(); 165 | p->setClipping(false); 166 | QPainterPath path; 167 | path.addRect(opt->rect); 168 | path.addRect(opt->rect.adjusted(2, 2, -2, -2)); 169 | p->fillPath(path, opt->palette.color(QPalette::Active, QPalette::Text)); 170 | p->restore(); 171 | break; } 172 | default: 173 | QMotifStyle::drawControl(element, opt, p, widget); 174 | break; 175 | } 176 | } 177 | 178 | /*! 179 | \reimp 180 | */ 181 | void QCDEStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, 182 | const QWidget *widget) const 183 | { 184 | switch (pe) { 185 | case PE_IndicatorCheckBox: { 186 | bool down = opt->state & State_Sunken; 187 | bool on = opt->state & State_On; 188 | bool showUp = !(down ^ on); 189 | QBrush fill = (showUp || (opt->state & State_NoChange)) ? opt->palette.brush(QPalette::Button) : opt->palette.brush(QPalette::Mid); 190 | qDrawShadePanel(p, opt->rect, opt->palette, !showUp, pixelMetric(PM_DefaultFrameWidth), &opt->palette.brush(QPalette::Button)); 191 | 192 | if (on || (opt->state & State_NoChange)) { 193 | QRect r = opt->rect; 194 | QPolygon a(7 * 2); 195 | int i, xx, yy; 196 | xx = r.x() + 3; 197 | yy = r.y() + 5; 198 | if (opt->rect.width() <= 9) { 199 | // When called from CE_MenuItem in QMotifStyle 200 | xx -= 2; 201 | yy -= 2; 202 | } 203 | 204 | for (i = 0; i < 3; i++) { 205 | a.setPoint(2 * i, xx, yy); 206 | a.setPoint(2 * i + 1, xx, yy + 2); 207 | xx++; yy++; 208 | } 209 | yy -= 2; 210 | for (i = 3; i < 7; i++) { 211 | a.setPoint(2 * i, xx, yy); 212 | a.setPoint(2 * i + 1, xx, yy + 2); 213 | xx++; yy--; 214 | } 215 | if (opt->state & State_NoChange) 216 | p->setPen(opt->palette.dark().color()); 217 | else 218 | p->setPen(opt->palette.foreground().color()); 219 | p->drawPolyline(a); 220 | } 221 | if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText)) 222 | p->fillRect(opt->rect, QBrush(p->background().color(), Qt::Dense5Pattern)); 223 | } break; 224 | case PE_IndicatorRadioButton: 225 | { 226 | QRect r = opt->rect; 227 | #define INTARRLEN(x) sizeof(x)/(sizeof(int)*2) 228 | static const int pts1[] = { // up left lines 229 | 1,9, 1,8, 0,7, 0,4, 1,3, 1,2, 2,1, 3,1, 4,0, 7,0, 8,1, 9,1 }; 230 | static const int pts4[] = { // bottom right lines 231 | 2,10, 3,10, 4,11, 7,11, 8,10, 9,10, 10,9, 10,8, 11,7, 232 | 11,4, 10,3, 10,2 }; 233 | static const int pts5[] = { // inner fill 234 | 4,2, 7,2, 9,4, 9,7, 7,9, 4,9, 2,7, 2,4 }; 235 | bool down = opt->state & State_Sunken; 236 | bool on = opt->state & State_On; 237 | QPolygon a(INTARRLEN(pts1), pts1); 238 | 239 | //center when rect is larger than indicator size 240 | int xOffset = 0; 241 | int yOffset = 0; 242 | int indicatorWidth = pixelMetric(PM_ExclusiveIndicatorWidth); 243 | int indicatorHeight = pixelMetric(PM_ExclusiveIndicatorWidth); 244 | if (r.width() > indicatorWidth) 245 | xOffset += (r.width() - indicatorWidth)/2; 246 | if (r.height() > indicatorHeight) 247 | yOffset += (r.height() - indicatorHeight)/2; 248 | p->translate(xOffset, yOffset); 249 | 250 | a.translate(r.x(), r.y()); 251 | QPen oldPen = p->pen(); 252 | QBrush oldBrush = p->brush(); 253 | p->setPen((down || on) ? opt->palette.dark().color() : opt->palette.light().color()); 254 | p->drawPolyline(a); 255 | a.setPoints(INTARRLEN(pts4), pts4); 256 | a.translate(r.x(), r.y()); 257 | p->setPen((down || on) ? opt->palette.light().color() : opt->palette.dark().color()); 258 | p->drawPolyline(a); 259 | a.setPoints(INTARRLEN(pts5), pts5); 260 | a.translate(r.x(), r.y()); 261 | QColor fillColor = on ? opt->palette.dark().color() : opt->palette.background().color(); 262 | p->setPen(fillColor); 263 | p->setBrush(on ? opt->palette.brush(QPalette::Dark) : 264 | opt->palette.brush(QPalette::Window)); 265 | p->drawPolygon(a); 266 | if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText)) 267 | p->fillRect(opt->rect, QBrush(p->background().color(), Qt::Dense5Pattern)); 268 | p->setPen(oldPen); 269 | p->setBrush(oldBrush); 270 | 271 | p->translate(-xOffset, -yOffset); 272 | 273 | } break; 274 | default: 275 | QMotifStyle::drawPrimitive(pe, opt, p, widget); 276 | } 277 | } 278 | 279 | /*!\reimp*/ 280 | QPalette QCDEStyle::standardPalette() const 281 | { 282 | QColor background(0xb6, 0xb6, 0xcf); 283 | QColor light = background.lighter(); 284 | QColor mid = background.darker(150); 285 | QColor dark = background.darker(); 286 | QPalette palette(Qt::black, background, light, dark, mid, Qt::black, Qt::white); 287 | palette.setBrush(QPalette::Disabled, QPalette::WindowText, dark); 288 | palette.setBrush(QPalette::Disabled, QPalette::Text, dark); 289 | palette.setBrush(QPalette::Disabled, QPalette::ButtonText, dark); 290 | palette.setBrush(QPalette::Disabled, QPalette::Base, background); 291 | return palette; 292 | } 293 | 294 | /*! 295 | \reimp 296 | */ 297 | QIcon QCDEStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *opt, 298 | const QWidget *widget) const 299 | { 300 | return QMotifStyle::standardIcon(standardIcon, opt, widget); 301 | } 302 | 303 | QT_END_NAMESPACE 304 | -------------------------------------------------------------------------------- /src/plugins/styles/motif/qcdestyle.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | #ifndef QCDESTYLE_H 44 | #define QCDESTYLE_H 45 | 46 | #include "qmotifstyle.h" 47 | 48 | QT_BEGIN_HEADER 49 | 50 | QT_BEGIN_NAMESPACE 51 | 52 | class QCDEStyle : public QMotifStyle 53 | { 54 | Q_OBJECT 55 | public: 56 | explicit QCDEStyle(bool useHighlightCols = false); 57 | virtual ~QCDEStyle(); 58 | 59 | int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, 60 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 61 | void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, 62 | const QWidget *w = 0) const Q_DECL_OVERRIDE; 63 | void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, 64 | const QWidget *w = 0) const Q_DECL_OVERRIDE; 65 | QPalette standardPalette() const Q_DECL_OVERRIDE; 66 | QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = 0, 67 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 68 | }; 69 | 70 | QT_END_NAMESPACE 71 | 72 | QT_END_HEADER 73 | 74 | #endif // QCDESTYLE_H 75 | -------------------------------------------------------------------------------- /src/plugins/styles/motif/qmotifstyle.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef QMOTIFSTYLE_H 43 | #define QMOTIFSTYLE_H 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | QT_BEGIN_HEADER 50 | 51 | QT_BEGIN_NAMESPACE 52 | 53 | class QPalette; 54 | class QFocusFrame; 55 | class QProgressBar; 56 | 57 | class QMotifStyle : public QCommonStyle 58 | { 59 | Q_OBJECT 60 | 61 | public: 62 | explicit QMotifStyle(bool useHighlightCols=false); 63 | virtual ~QMotifStyle(); 64 | 65 | void setUseHighlightColors(bool); 66 | bool useHighlightColors() const; 67 | 68 | void polish(QPalette&) Q_DECL_OVERRIDE; 69 | void polish(QWidget*) Q_DECL_OVERRIDE; 70 | void unpolish(QWidget*) Q_DECL_OVERRIDE; 71 | void polish(QApplication*) Q_DECL_OVERRIDE; 72 | void unpolish(QApplication*) Q_DECL_OVERRIDE; 73 | 74 | void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, 75 | const QWidget *w = 0) const Q_DECL_OVERRIDE; 76 | 77 | void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, 78 | const QWidget *w = 0) const Q_DECL_OVERRIDE; 79 | 80 | void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, 81 | const QWidget *w = 0) const Q_DECL_OVERRIDE; 82 | 83 | QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, 84 | SubControl sc, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 85 | 86 | int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, 87 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 88 | 89 | QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, 90 | const QSize &contentsSize, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 91 | 92 | QRect subElementRect(SubElement r, const QStyleOption *opt,const QWidget *widget = 0) const Q_DECL_OVERRIDE; 93 | 94 | QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, 95 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 96 | 97 | int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0, 98 | QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE; 99 | 100 | bool event(QEvent *) Q_DECL_OVERRIDE; 101 | QPalette standardPalette() const Q_DECL_OVERRIDE; 102 | QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = 0, 103 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 104 | 105 | protected: 106 | QPointer focus; 107 | void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; 108 | bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; 109 | void startProgressAnimation(QProgressBar *bar); 110 | void stopProgressAnimation(QProgressBar *bar); 111 | 112 | private: 113 | bool highlightCols; 114 | QList bars; 115 | int animationFps; 116 | int animateTimer; 117 | QTime startTime; 118 | int animateStep; 119 | 120 | protected: 121 | int spinboxHCoeff; 122 | }; 123 | 124 | QT_END_NAMESPACE 125 | 126 | QT_END_HEADER 127 | 128 | #endif // QMOTIFSTYLE_H 129 | -------------------------------------------------------------------------------- /src/plugins/styles/plastique/plastique.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "plastique" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/styles/plastique/plastique.pro: -------------------------------------------------------------------------------- 1 | TARGET = qplastiquestyle 2 | PLUGIN_TYPE = styles 3 | PLUGIN_CLASS_NAME = QPlastiqueStylePlugin 4 | load(qt_plugin) 5 | 6 | QT = core core-private gui gui-private widgets 7 | 8 | HEADERS += qplastiquestyle.h 9 | SOURCES += qplastiquestyle.cpp 10 | SOURCES += plugin.cpp 11 | 12 | include(../shared/shared.pri) 13 | 14 | OTHER_FILES += plastique.json 15 | -------------------------------------------------------------------------------- /src/plugins/styles/plastique/plugin.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the MNG plugins in the Qt ImageFormats module. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | #include "qplastiquestyle.h" 44 | 45 | QT_BEGIN_NAMESPACE 46 | 47 | class QPlastiqueStylePlugin : public QStylePlugin 48 | { 49 | Q_OBJECT 50 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "plastique.json") 51 | 52 | public: 53 | QStyle *create(const QString &key); 54 | }; 55 | 56 | QStyle *QPlastiqueStylePlugin::create(const QString &key) 57 | { 58 | if (key == "plastique") 59 | return new QPlastiqueStyle; 60 | return 0; 61 | } 62 | 63 | QT_END_NAMESPACE 64 | 65 | #include "plugin.moc" 66 | -------------------------------------------------------------------------------- /src/plugins/styles/plastique/qplastiquestyle.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef QPLASTIQUESTYLE_H 43 | #define QPLASTIQUESTYLE_H 44 | 45 | #include 46 | #include 47 | 48 | QT_BEGIN_HEADER 49 | 50 | QT_BEGIN_NAMESPACE 51 | 52 | class QProgressBar; 53 | 54 | class QPlastiqueStyle : public QProxyStyle 55 | { 56 | Q_OBJECT 57 | 58 | public: 59 | QPlastiqueStyle(); 60 | ~QPlastiqueStyle(); 61 | 62 | void drawPrimitive(PrimitiveElement element, const QStyleOption *option, 63 | QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 64 | void drawControl(ControlElement element, const QStyleOption *option, 65 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 66 | void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, 67 | QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; 68 | QSize sizeFromContents(ContentsType type, const QStyleOption *option, 69 | const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE; 70 | 71 | QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE; 72 | QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, 73 | SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE; 74 | 75 | int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, 76 | QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE; 77 | SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, 78 | const QPoint &pos, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 79 | 80 | int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE; 81 | 82 | QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, 83 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 84 | 85 | void polish(QWidget *widget) Q_DECL_OVERRIDE; 86 | void polish(QApplication *app) Q_DECL_OVERRIDE; 87 | void polish(QPalette &pal) Q_DECL_OVERRIDE; 88 | void unpolish(QWidget *widget) Q_DECL_OVERRIDE; 89 | void unpolish(QApplication *app) Q_DECL_OVERRIDE; 90 | 91 | QPalette standardPalette() const Q_DECL_OVERRIDE; 92 | 93 | QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = 0, 94 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 95 | int layoutSpacing(QSizePolicy::ControlType control1, 96 | QSizePolicy::ControlType control2, 97 | Qt::Orientation orientation, 98 | const QStyleOption *option = 0, 99 | const QWidget *widget = 0) const Q_DECL_OVERRIDE; 100 | 101 | protected: 102 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; 103 | bool event(QEvent *event) Q_DECL_OVERRIDE; 104 | void startProgressAnimation(QProgressBar *bar); 105 | void stopProgressAnimation(QProgressBar *bar); 106 | 107 | private: 108 | int animateStep; 109 | QList bars; 110 | int progressBarAnimateTimer; 111 | QElapsedTimer timer; 112 | }; 113 | 114 | QT_END_NAMESPACE 115 | 116 | QT_END_HEADER 117 | 118 | #endif // QPLASTIQUESTYLE_H 119 | -------------------------------------------------------------------------------- /src/plugins/styles/shared/qhexstring_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | #ifndef QHEXSTRING_P_H 47 | #define QHEXSTRING_P_H 48 | 49 | // 50 | // W A R N I N G 51 | // ------------- 52 | // 53 | // This file is not part of the Qt API. It exists purely as an 54 | // implementation detail. This header file may change from version to 55 | // version without notice, or even be removed. 56 | // 57 | // We mean it. 58 | // 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | // internal helper. Converts an integer value to an unique string token 63 | template 64 | struct HexString 65 | { 66 | inline HexString(const T t) 67 | : val(t) 68 | {} 69 | 70 | inline void write(QChar *&dest) const 71 | { 72 | const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; 73 | const char *c = reinterpret_cast(&val); 74 | for (uint i = 0; i < sizeof(T); ++i) { 75 | *dest++ = hexChars[*c & 0xf]; 76 | *dest++ = hexChars[(*c & 0xf0) >> 4]; 77 | ++c; 78 | } 79 | } 80 | const T val; 81 | }; 82 | 83 | // specialization to enable fast concatenating of our string tokens to a string 84 | template 85 | struct QConcatenable > 86 | { 87 | typedef HexString type; 88 | enum { ExactSize = true }; 89 | static int size(const HexString &) { return sizeof(T) * 2; } 90 | static inline void appendTo(const HexString &str, QChar *&out) { str.write(out); } 91 | typedef QString ConvertTo; 92 | }; 93 | 94 | QT_END_NAMESPACE 95 | 96 | #endif // QHEXSTRING_P_H 97 | -------------------------------------------------------------------------------- /src/plugins/styles/shared/qstylecache_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtGui module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef QSTYLECACHE_P_H 43 | #define QSTYLECACHE_P_H 44 | 45 | QT_BEGIN_NAMESPACE 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include "qstylehelper_p.h" 52 | 53 | // 54 | // W A R N I N G 55 | // ------------- 56 | // 57 | // This file is not part of the Qt API. It exists purely as an 58 | // implementation detail. This header file may change from version to 59 | // version without notice, or even be removed. 60 | // 61 | // We mean it. 62 | // 63 | 64 | inline QImage styleCacheImage(const QSize &size) 65 | { 66 | return QImage(size, QImage::Format_ARGB32_Premultiplied); 67 | } 68 | 69 | inline QPixmap styleCachePixmap(const QSize &size) 70 | { 71 | return QPixmap(size); 72 | } 73 | 74 | #define BEGIN_STYLE_PIXMAPCACHE(a) \ 75 | QRect rect = option->rect; \ 76 | QPixmap internalPixmapCache; \ 77 | QImage imageCache; \ 78 | QPainter *p = painter; \ 79 | QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \ 80 | int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \ 81 | bool doPixmapCache = (txType <= QTransform::TxTranslate) \ 82 | || (painter->deviceTransform().type() == QTransform::TxScale); \ 83 | if (doPixmapCache && QPixmapCache::find(unique, internalPixmapCache)) { \ 84 | painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \ 85 | } else { \ 86 | if (doPixmapCache) { \ 87 | rect.setRect(0, 0, option->rect.width(), option->rect.height()); \ 88 | imageCache = styleCacheImage(option->rect.size()); \ 89 | imageCache.fill(0); \ 90 | p = new QPainter(&imageCache); \ 91 | } 92 | 93 | #define END_STYLE_PIXMAPCACHE \ 94 | if (doPixmapCache) { \ 95 | p->end(); \ 96 | delete p; \ 97 | internalPixmapCache = QPixmap::fromImage(imageCache); \ 98 | painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \ 99 | QPixmapCache::insert(unique, internalPixmapCache); \ 100 | } \ 101 | } 102 | 103 | QT_END_NAMESPACE 104 | 105 | #endif // QSTYLECACHE_P_H 106 | -------------------------------------------------------------------------------- /src/plugins/styles/shared/qstylehelper.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include "qstylecache_p.h" 43 | #include "qstylehelper_p.h" 44 | #include 45 | 46 | QT_BEGIN_NAMESPACE 47 | 48 | static const qreal Q_PI = qreal(3.14159265358979323846); // pi 49 | 50 | namespace QStyleHelper { 51 | 52 | QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size) 53 | { 54 | const QStyleOptionComplex *complexOption = qstyleoption_cast(option); 55 | QString tmp = key % HexString(option->state) 56 | % HexString(option->direction) 57 | % HexString(complexOption ? uint(complexOption->activeSubControls) : 0u) 58 | % HexString(option->palette.cacheKey()) 59 | % HexString(size.width()) 60 | % HexString(size.height()); 61 | 62 | #ifndef QT_NO_SPINBOX 63 | if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { 64 | tmp = tmp % HexString(spinBox->buttonSymbols) 65 | % HexString(spinBox->stepEnabled) 66 | % QLatin1Char(spinBox->frame ? '1' : '0'); ; 67 | } 68 | #endif // QT_NO_SPINBOX 69 | return tmp; 70 | } 71 | 72 | #ifndef QT_NO_ACCESSIBILITY 73 | bool isInstanceOf(QObject *obj, QAccessible::Role role) 74 | { 75 | bool match = false; 76 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(obj); 77 | match = iface && iface->role() == role; 78 | return match; 79 | } 80 | 81 | // Searches for an ancestor of a particular accessible role 82 | bool hasAncestor(QObject *obj, QAccessible::Role role) 83 | { 84 | bool found = false; 85 | QObject *parent = obj ? obj->parent() : 0; 86 | while (parent && !found) { 87 | if (isInstanceOf(parent, role)) 88 | found = true; 89 | parent = parent->parent(); 90 | } 91 | return found; 92 | } 93 | #endif // QT_NO_ACCESSIBILITY 94 | 95 | 96 | #ifndef QT_NO_DIAL 97 | 98 | int calcBigLineSize(int radius) 99 | { 100 | int bigLineSize = radius / 6; 101 | if (bigLineSize < 4) 102 | bigLineSize = 4; 103 | if (bigLineSize > radius / 2) 104 | bigLineSize = radius / 2; 105 | return bigLineSize; 106 | } 107 | 108 | static QPointF calcRadialPos(const QStyleOptionSlider *dial, qreal offset) 109 | { 110 | const int width = dial->rect.width(); 111 | const int height = dial->rect.height(); 112 | const int r = qMin(width, height) / 2; 113 | const int currentSliderPosition = dial->upsideDown ? dial->sliderPosition : (dial->maximum - dial->sliderPosition); 114 | qreal a = 0; 115 | if (dial->maximum == dial->minimum) 116 | a = Q_PI / 2; 117 | else if (dial->dialWrapping) 118 | a = Q_PI * 3 / 2 - (currentSliderPosition - dial->minimum) * 2 * Q_PI 119 | / (dial->maximum - dial->minimum); 120 | else 121 | a = (Q_PI * 8 - (currentSliderPosition - dial->minimum) * 10 * Q_PI 122 | / (dial->maximum - dial->minimum)) / 6; 123 | qreal xc = width / 2.0; 124 | qreal yc = height / 2.0; 125 | qreal len = r - QStyleHelper::calcBigLineSize(r) - 3; 126 | qreal back = offset * len; 127 | QPointF pos(QPointF(xc + back * qCos(a), yc - back * qSin(a))); 128 | return pos; 129 | } 130 | 131 | qreal angle(const QPointF &p1, const QPointF &p2) 132 | { 133 | static const qreal rad_factor = 180 / Q_PI; 134 | qreal _angle = 0; 135 | 136 | if (p1.x() == p2.x()) { 137 | if (p1.y() < p2.y()) 138 | _angle = 270; 139 | else 140 | _angle = 90; 141 | } else { 142 | qreal x1, x2, y1, y2; 143 | 144 | if (p1.x() <= p2.x()) { 145 | x1 = p1.x(); y1 = p1.y(); 146 | x2 = p2.x(); y2 = p2.y(); 147 | } else { 148 | x2 = p1.x(); y2 = p1.y(); 149 | x1 = p2.x(); y1 = p2.y(); 150 | } 151 | 152 | qreal m = -(y2 - y1) / (x2 - x1); 153 | _angle = qAtan(m) * rad_factor; 154 | 155 | if (p1.x() < p2.x()) 156 | _angle = 180 - _angle; 157 | else 158 | _angle = -_angle; 159 | } 160 | return _angle; 161 | } 162 | 163 | QPolygonF calcLines(const QStyleOptionSlider *dial) 164 | { 165 | QPolygonF poly; 166 | int width = dial->rect.width(); 167 | int height = dial->rect.height(); 168 | qreal r = qMin(width, height) / 2; 169 | int bigLineSize = calcBigLineSize(int(r)); 170 | 171 | qreal xc = width / 2 + 0.5; 172 | qreal yc = height / 2 + 0.5; 173 | const int ns = dial->tickInterval; 174 | if (!ns) // Invalid values may be set by Qt Designer. 175 | return poly; 176 | int notches = (dial->maximum + ns - 1 - dial->minimum) / ns; 177 | if (notches <= 0) 178 | return poly; 179 | if (dial->maximum < dial->minimum || dial->maximum - dial->minimum > 1000) { 180 | int maximum = dial->minimum + 1000; 181 | notches = (maximum + ns - 1 - dial->minimum) / ns; 182 | } 183 | 184 | poly.resize(2 + 2 * notches); 185 | int smallLineSize = bigLineSize / 2; 186 | for (int i = 0; i <= notches; ++i) { 187 | qreal angle = dial->dialWrapping ? Q_PI * 3 / 2 - i * 2 * Q_PI / notches 188 | : (Q_PI * 8 - i * 10 * Q_PI / notches) / 6; 189 | qreal s = qSin(angle); 190 | qreal c = qCos(angle); 191 | if (i == 0 || (((ns * i) % (dial->pageStep ? dial->pageStep : 1)) == 0)) { 192 | poly[2 * i] = QPointF(xc + (r - bigLineSize) * c, 193 | yc - (r - bigLineSize) * s); 194 | poly[2 * i + 1] = QPointF(xc + r * c, yc - r * s); 195 | } else { 196 | poly[2 * i] = QPointF(xc + (r - 1 - smallLineSize) * c, 197 | yc - (r - 1 - smallLineSize) * s); 198 | poly[2 * i + 1] = QPointF(xc + (r - 1) * c, yc -(r - 1) * s); 199 | } 200 | } 201 | return poly; 202 | } 203 | 204 | // This will draw a nice and shiny QDial for us. We don't want 205 | // all the shinyness in QWindowsStyle, hence we place it here 206 | 207 | void drawDial(const QStyleOptionSlider *option, QPainter *painter) 208 | { 209 | QPalette pal = option->palette; 210 | QColor buttonColor = pal.button().color(); 211 | const int width = option->rect.width(); 212 | const int height = option->rect.height(); 213 | const bool enabled = option->state & QStyle::State_Enabled; 214 | qreal r = qMin(width, height) / 2; 215 | r -= r/50; 216 | const qreal penSize = r/20.0; 217 | 218 | painter->save(); 219 | painter->setRenderHint(QPainter::Antialiasing); 220 | 221 | // Draw notches 222 | if (option->subControls & QStyle::SC_DialTickmarks) { 223 | painter->setPen(option->palette.dark().color().darker(120)); 224 | painter->drawLines(QStyleHelper::calcLines(option)); 225 | } 226 | 227 | // Cache dial background 228 | BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("qdial")); 229 | p->setRenderHint(QPainter::Antialiasing); 230 | 231 | const qreal d_ = r / 6; 232 | const qreal dx = option->rect.x() + d_ + (width - 2 * r) / 2 + 1; 233 | const qreal dy = option->rect.y() + d_ + (height - 2 * r) / 2 + 1; 234 | 235 | QRectF br = QRectF(dx + 0.5, dy + 0.5, 236 | int(r * 2 - 2 * d_ - 2), 237 | int(r * 2 - 2 * d_ - 2)); 238 | buttonColor.setHsv(buttonColor .hue(), 239 | qMin(140, buttonColor .saturation()), 240 | qMax(180, buttonColor.value())); 241 | QColor shadowColor(0, 0, 0, 20); 242 | 243 | if (enabled) { 244 | // Drop shadow 245 | qreal shadowSize = qMax(1.0, penSize/2.0); 246 | QRectF shadowRect= br.adjusted(-2*shadowSize, -2*shadowSize, 247 | 2*shadowSize, 2*shadowSize); 248 | QRadialGradient shadowGradient(shadowRect.center().x(), 249 | shadowRect.center().y(), shadowRect.width()/2.0, 250 | shadowRect.center().x(), shadowRect.center().y()); 251 | shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40)); 252 | shadowGradient.setColorAt(qreal(1.0), Qt::transparent); 253 | p->setBrush(shadowGradient); 254 | p->setPen(Qt::NoPen); 255 | p->translate(shadowSize, shadowSize); 256 | p->drawEllipse(shadowRect); 257 | p->translate(-shadowSize, -shadowSize); 258 | 259 | // Main gradient 260 | QRadialGradient gradient(br.center().x() - br.width()/3, dy, 261 | br.width()*1.3, br.center().x(), 262 | br.center().y() - br.height()/2); 263 | gradient.setColorAt(0, buttonColor.lighter(110)); 264 | gradient.setColorAt(qreal(0.5), buttonColor); 265 | gradient.setColorAt(qreal(0.501), buttonColor.darker(102)); 266 | gradient.setColorAt(1, buttonColor.darker(115)); 267 | p->setBrush(gradient); 268 | } else { 269 | p->setBrush(Qt::NoBrush); 270 | } 271 | 272 | p->setPen(QPen(buttonColor.darker(280))); 273 | p->drawEllipse(br); 274 | p->setBrush(Qt::NoBrush); 275 | p->setPen(buttonColor.lighter(110)); 276 | p->drawEllipse(br.adjusted(1, 1, -1, -1)); 277 | 278 | if (option->state & QStyle::State_HasFocus) { 279 | QColor highlight = pal.highlight().color(); 280 | highlight.setHsv(highlight.hue(), 281 | qMin(160, highlight.saturation()), 282 | qMax(230, highlight.value())); 283 | highlight.setAlpha(127); 284 | p->setPen(QPen(highlight, 2.0)); 285 | p->setBrush(Qt::NoBrush); 286 | p->drawEllipse(br.adjusted(-1, -1, 1, 1)); 287 | } 288 | 289 | END_STYLE_PIXMAPCACHE 290 | 291 | QPointF dp = calcRadialPos(option, qreal(0.70)); 292 | buttonColor = buttonColor.lighter(104); 293 | buttonColor.setAlphaF(qreal(0.8)); 294 | const qreal ds = r/qreal(7.0); 295 | QRectF dialRect(dp.x() - ds, dp.y() - ds, 2*ds, 2*ds); 296 | QRadialGradient dialGradient(dialRect.center().x() + dialRect.width()/2, 297 | dialRect.center().y() + dialRect.width(), 298 | dialRect.width()*2, 299 | dialRect.center().x(), dialRect.center().y()); 300 | dialGradient.setColorAt(1, buttonColor.darker(140)); 301 | dialGradient.setColorAt(qreal(0.4), buttonColor.darker(120)); 302 | dialGradient.setColorAt(0, buttonColor.darker(110)); 303 | if (penSize > 3.0) { 304 | painter->setPen(QPen(QColor(0, 0, 0, 25), penSize)); 305 | painter->drawLine(calcRadialPos(option, qreal(0.90)), calcRadialPos(option, qreal(0.96))); 306 | } 307 | 308 | painter->setBrush(dialGradient); 309 | painter->setPen(QColor(255, 255, 255, 150)); 310 | painter->drawEllipse(dialRect.adjusted(-1, -1, 1, 1)); 311 | painter->setPen(QColor(0, 0, 0, 80)); 312 | painter->drawEllipse(dialRect); 313 | painter->restore(); 314 | } 315 | #endif //QT_NO_DIAL 316 | 317 | void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect, 318 | int left, int top, int right, 319 | int bottom) 320 | { 321 | QSize size = pixmap.size(); 322 | //painter->setRenderHint(QPainter::SmoothPixmapTransform); 323 | 324 | //top 325 | if (top > 0) { 326 | painter->drawPixmap(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), pixmap, 327 | QRect(left, 0, size.width() -right - left, top)); 328 | 329 | //top-left 330 | if (left > 0) 331 | painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap, 332 | QRect(0, 0, left, top)); 333 | 334 | //top-right 335 | if (right > 0) 336 | painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top(), right, top), pixmap, 337 | QRect(size.width() - right, 0, right, top)); 338 | } 339 | 340 | //left 341 | if (left > 0) 342 | painter->drawPixmap(QRect(rect.left(), rect.top()+top, left, rect.height() - top - bottom), pixmap, 343 | QRect(0, top, left, size.height() - bottom - top)); 344 | 345 | //center 346 | painter->drawPixmap(QRect(rect.left() + left, rect.top()+top, rect.width() -right - left, 347 | rect.height() - bottom - top), pixmap, 348 | QRect(left, top, size.width() -right -left, 349 | size.height() - bottom - top)); 350 | //right 351 | if (right > 0) 352 | painter->drawPixmap(QRect(rect.left() +rect.width() - right, rect.top()+top, right, rect.height() - top - bottom), pixmap, 353 | QRect(size.width() - right, top, right, size.height() - bottom - top)); 354 | 355 | //bottom 356 | if (bottom > 0) { 357 | painter->drawPixmap(QRect(rect.left() +left, rect.top() + rect.height() - bottom, 358 | rect.width() - right - left, bottom), pixmap, 359 | QRect(left, size.height() - bottom, 360 | size.width() - right - left, bottom)); 361 | //bottom-left 362 | if (left > 0) 363 | painter->drawPixmap(QRect(rect.left(), rect.top() + rect.height() - bottom, left, bottom), pixmap, 364 | QRect(0, size.height() - bottom, left, bottom)); 365 | 366 | //bottom-right 367 | if (right > 0) 368 | painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top() + rect.height() - bottom, right, bottom), pixmap, 369 | QRect(size.width() - right, size.height() - bottom, right, bottom)); 370 | 371 | } 372 | } 373 | 374 | QColor backgroundColor(const QPalette &pal, const QWidget* widget) 375 | { 376 | if (qobject_cast(widget) && widget->parent() && 377 | qobject_cast(widget->parent()->parent())) 378 | return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base); 379 | return pal.color(QPalette::Base); 380 | } 381 | 382 | QWindow *styleObjectWindow(QObject *so) 383 | { 384 | if (so) 385 | return so->property("_q_styleObjectWindow").value(); 386 | 387 | return 0; 388 | } 389 | 390 | } 391 | QT_END_NAMESPACE 392 | -------------------------------------------------------------------------------- /src/plugins/styles/shared/qstylehelper_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QtWidgets module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #ifndef QSTYLEHELPER_P_H 42 | #define QSTYLEHELPER_P_H 43 | 44 | // 45 | // W A R N I N G 46 | // ------------- 47 | // 48 | // This file is not part of the Qt API. It exists purely as an 49 | // implementation detail. This header file may change from version to 50 | // version without notice, or even be removed. 51 | // 52 | // We mean it. 53 | // 54 | 55 | #include "qhexstring_p.h" 56 | 57 | QT_BEGIN_NAMESPACE 58 | 59 | class QPainter; 60 | class QPixmap; 61 | class QStyleOptionSlider; 62 | class QStyleOption; 63 | class QWindow; 64 | 65 | namespace QStyleHelper 66 | { 67 | QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size); 68 | #ifndef QT_NO_DIAL 69 | qreal angle(const QPointF &p1, const QPointF &p2); 70 | QPolygonF calcLines(const QStyleOptionSlider *dial); 71 | int calcBigLineSize(int radius); 72 | void drawDial(const QStyleOptionSlider *dial, QPainter *painter); 73 | #endif //QT_NO_DIAL 74 | void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect, 75 | int left = 0, int top = 0, int right = 0, 76 | int bottom = 0); 77 | #ifndef QT_NO_ACCESSIBILITY 78 | bool isInstanceOf(QObject *obj, QAccessible::Role role); 79 | bool hasAncestor(QObject *obj, QAccessible::Role role); 80 | #endif 81 | QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0); 82 | QWindow *styleObjectWindow(QObject *so); 83 | } 84 | 85 | 86 | QT_END_NAMESPACE 87 | 88 | #endif // QSTYLEHELPER_P_H 89 | -------------------------------------------------------------------------------- /src/plugins/styles/shared/shared.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | DEPENDPATH += $$PWD 3 | 4 | HEADERS += \ 5 | $$PWD/qhexstring_p.h \ 6 | $$PWD/qstylecache_p.h \ 7 | $$PWD/qstylehelper_p.h 8 | 9 | SOURCES += \ 10 | $$PWD/qstylehelper.cpp 11 | -------------------------------------------------------------------------------- /src/plugins/styles/styles.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = \ 3 | cleanlooks \ 4 | motif \ 5 | plastique 6 | 7 | greaterThan(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 6) { 8 | # only 5.7 or later 9 | SUBDIRS += bb10style 10 | } 11 | 12 | packagesExist(gtk+-2.0 x11) { 13 | SUBDIRS += gtk2 14 | } 15 | -------------------------------------------------------------------------------- /src/src.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = plugins 3 | --------------------------------------------------------------------------------