summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/bb10style
diff options
context:
space:
mode:
authorVladimir Minenko <vminenko@blackberry.com>2014-10-16 11:31:25 +0200
committerVladimir Minenko <vminenko@blackberry.com>2014-11-07 16:35:47 +0100
commita3398c1824e8d290d346d1610b604370d2b252e0 (patch)
tree142a48d5ccf4c3d5951849f1eca2ccd6b244060a /src/plugins/styles/bb10style
parent190bfbae64006216b4114a02153c60d604ac24f7 (diff)
BlackBerry 10 specific widget style as a style plugin
- upstreaming the implementation of a BlackBerry 10 specific widget style - modfied to be integrated as a style plugin being a part of the QtBase - according docs are provided in QtDocs in another commit - attributing the excellent work at KDAB who was the original developer Change-Id: I57c548f6ec4cf02f125ee216f1ce1b764f29e8bb Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/styles/bb10style')
-rw-r--r--src/plugins/styles/bb10style/bb10lightstyle.qrc54
-rw-r--r--src/plugins/styles/bb10style/bb10style.pro28
-rw-r--r--src/plugins/styles/bb10style/bright/button/core_button_disabled.pngbin0 -> 1510 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/button/core_button_disabled_selected.pngbin0 -> 1782 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/button/core_button_enabled_selected.pngbin0 -> 1830 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/button/core_button_inactive.pngbin0 -> 2428 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/button/core_button_pressed.pngbin0 -> 3221 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/checkbox/core_checkbox_checked.pngbin0 -> 2048 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled.pngbin0 -> 935 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled_checked.pngbin0 -> 1702 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/checkbox/core_checkbox_enabled.pngbin0 -> 1082 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.pngbin0 -> 2776 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed_checked.pngbin0 -> 2652 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_button.pngbin0 -> 1605 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown.pngbin0 -> 1419 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown_pressed.pngbin0 -> 1404 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowup.pngbin0 -> 1398 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_disabled.pngbin0 -> 1587 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_pressed.pngbin0 -> 1801 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_checkmark.pngbin0 -> 1769 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_divider.pngbin0 -> 134 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_menu.pngbin0 -> 874 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_dropdown_menuup.pngbin0 -> 996 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/combobox/core_listitem_active.pngbin0 -> 182 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.pngbin0 -> 1315 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_disabled.pngbin0 -> 454 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.pngbin0 -> 394 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/listitem/core_listitem_active.pngbin0 -> 164 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/listitem/core_listitem_divider.pngbin0 -> 135 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.pngbin0 -> 1802 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_complete.pngbin0 -> 635 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_fill.pngbin0 -> 629 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vbg.pngbin0 -> 903 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vcomplete.pngbin0 -> 614 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vfill.pngbin0 -> 594 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_checked.pngbin0 -> 4471 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled.pngbin0 -> 3652 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled_checked.pngbin0 -> 4094 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.pngbin0 -> 4245 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.pngbin0 -> 5460 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.pngbin0 -> 1242 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar_v.pngbin0 -> 385 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_active.pngbin0 -> 1167 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_cache.pngbin0 -> 1154 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_disabled.pngbin0 -> 1134 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_enabled.pngbin0 -> 1049 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_handle.pngbin0 -> 2843 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_handle_disabled.pngbin0 -> 2708 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.pngbin0 -> 6577 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_inactive.pngbin0 -> 1162 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_vactive.pngbin0 -> 1077 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_vcache.pngbin0 -> 1063 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_vdisabled.pngbin0 -> 1064 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_venabled.pngbin0 -> 996 bytes
-rw-r--r--src/plugins/styles/bb10style/bright/slider/core_slider_vinactive.pngbin0 -> 1071 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/button/core_button_disabled.pngbin0 -> 1291 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/button/core_button_disabled_selected.pngbin0 -> 1655 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/button/core_button_enabled_selected.pngbin0 -> 1665 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/button/core_button_inactive.pngbin0 -> 2262 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/button/core_button_pressed.pngbin0 -> 2853 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/checkbox/core_checkbox_checked.pngbin0 -> 1947 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled.pngbin0 -> 787 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled_checked.pngbin0 -> 1578 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/checkbox/core_checkbox_enabled.pngbin0 -> 925 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.pngbin0 -> 2478 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed_checked.pngbin0 -> 2256 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_button.pngbin0 -> 1425 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown.pngbin0 -> 1404 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown_pressed.pngbin0 -> 1465 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowup.pngbin0 -> 1383 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_disabled.pngbin0 -> 1291 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_pressed.pngbin0 -> 1583 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_checkmark.pngbin0 -> 1588 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_divider.pngbin0 -> 134 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_menu.pngbin0 -> 662 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_dropdown_menuup.pngbin0 -> 688 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/combobox/core_listitem_active.pngbin0 -> 149 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.pngbin0 -> 1315 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_disabled.pngbin0 -> 454 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.pngbin0 -> 394 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/listitem/core_listitem_active.pngbin0 -> 164 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/listitem/core_listitem_divider.pngbin0 -> 136 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.pngbin0 -> 1724 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_complete.pngbin0 -> 635 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_fill.pngbin0 -> 658 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vbg.pngbin0 -> 815 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vcomplete.pngbin0 -> 614 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vfill.pngbin0 -> 602 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_checked.pngbin0 -> 4298 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled.pngbin0 -> 3125 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled_checked.pngbin0 -> 3539 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.pngbin0 -> 3968 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.pngbin0 -> 4777 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.pngbin0 -> 1245 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar_v.pngbin0 -> 369 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_active.pngbin0 -> 1160 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_cache.pngbin0 -> 1154 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_disabled.pngbin0 -> 1105 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_enabled.pngbin0 -> 983 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_handle.pngbin0 -> 3019 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_handle_disabled.pngbin0 -> 1715 bytes
-rwxr-xr-xsrc/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.pngbin0 -> 6593 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_inactive.pngbin0 -> 1158 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_vactive.pngbin0 -> 1066 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_vcache.pngbin0 -> 1058 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_vdisabled.pngbin0 -> 1009 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_venabled.pngbin0 -> 929 bytes
-rw-r--r--src/plugins/styles/bb10style/dark/slider/core_slider_vinactive.pngbin0 -> 1067 bytes
-rw-r--r--src/plugins/styles/bb10style/qbb10brightstyle.cpp352
-rw-r--r--src/plugins/styles/bb10style/qbb10brightstyle.h70
-rw-r--r--src/plugins/styles/bb10style/qbb10brightstyle.qrc57
-rw-r--r--src/plugins/styles/bb10style/qbb10darkstyle.cpp357
-rw-r--r--src/plugins/styles/bb10style/qbb10darkstyle.h70
-rw-r--r--src/plugins/styles/bb10style/qbb10darkstyle.qrc57
-rw-r--r--src/plugins/styles/bb10style/qbb10styleplugin.cpp74
-rw-r--r--src/plugins/styles/bb10style/qbb10styleplugin.h64
-rw-r--r--src/plugins/styles/bb10style/qbb10styleplugin.json3
-rw-r--r--src/plugins/styles/bb10style/qpixmapstyle.cpp994
-rw-r--r--src/plugins/styles/bb10style/qpixmapstyle.h236
119 files changed, 2416 insertions, 0 deletions
diff --git a/src/plugins/styles/bb10style/bb10lightstyle.qrc b/src/plugins/styles/bb10style/bb10lightstyle.qrc
new file mode 100644
index 0000000000..0777e009bb
--- /dev/null
+++ b/src/plugins/styles/bb10style/bb10lightstyle.qrc
@@ -0,0 +1,54 @@
+<RCC>
+ <qresource prefix="/">
+ <file>light/button/core_button_disabled.png</file>
+ <file>light/button/core_button_inactive.png</file>
+ <file>light/button/core_button_pressed.png</file>
+ <file>light/checkbox/core_checkbox_checked.png</file>
+ <file>light/checkbox/core_checkbox_disabled.png</file>
+ <file>light/checkbox/core_checkbox_disabledchecked.png</file>
+ <file>light/checkbox/core_checkbox_enabled.png</file>
+ <file>light/checkbox/core_checkbox_pressed.png</file>
+ <file>light/checkbox/core_checkbox_pressedchecked.png</file>
+ <file>light/radiobutton/core_radiobutton_checked.png</file>
+ <file>light/radiobutton/core_radiobutton_disabled.png</file>
+ <file>light/radiobutton/core_radiobutton_disabledchecked.png</file>
+ <file>light/radiobutton/core_radiobutton_enabled.png</file>
+ <file>light/radiobutton/core_radiobutton_pressed.png</file>
+ <file>light/slider/core_slider_active.png</file>
+ <file>light/slider/core_slider_disabled.png</file>
+ <file>light/slider/core_slider_handle.png</file>
+ <file>light/slider/core_slider_handle_disabled.png</file>
+ <file>light/slider/core_slider_handle_pressed.png</file>
+ <file>light/slider/core_slider_inactive.png</file>
+ <file>light/slider/core_slider_vactive.png</file>
+ <file>light/slider/core_slider_vdisabled.png</file>
+ <file>light/slider/core_slider_vinactive.png</file>
+ <file>light/slider/core_slider_black.png</file>
+ <file>light/slider/core_slider_enabled.png</file>
+ <file>light/slider/core_slider_vblack.png</file>
+ <file>light/slider/core_slider_venabled.png</file>
+ <file>light/button/core_button_active.png</file>
+ <file>light/lineedit/core_textinput_bg.png</file>
+ <file>light/lineedit/core_textinput_bg_disabled.png</file>
+ <file>light/lineedit/core_textinput_bg_focused.png</file>
+ <file>light/progressbar/core_progressindicator_bg.png</file>
+ <file>light/progressbar/core_progressindicator_complete.png</file>
+ <file>light/progressbar/core_progressindicator_fill.png</file>
+ <file>light/progressbar/core_progressindicator_vbg.png</file>
+ <file>light/progressbar/core_progressindicator_vcomplete.png</file>
+ <file>light/progressbar/core_progressindicator_vfill.png</file>
+ <file>light/combobox/core_dropdown_button.png</file>
+ <file>light/combobox/core_dropdown_button_arrowdown.png</file>
+ <file>light/combobox/core_dropdown_button_arrowdown_pressed.png</file>
+ <file>light/combobox/core_dropdown_button_arrowup.png</file>
+ <file>light/combobox/core_dropdown_button_disabled.png</file>
+ <file>light/combobox/core_dropdown_button_pressed.png</file>
+ <file>light/combobox/core_dropdown_checkmark.png</file>
+ <file>light/combobox/core_dropdown_divider.png</file>
+ <file>light/combobox/core_dropdown_menu.png</file>
+ <file>light/combobox/core_dropdown_menuup.png</file>
+ <file>light/combobox/core_listitem_active.png</file>
+ <file>light/listitem/core_listitem_active.png</file>
+ <file>light/listitem/core_listitem_divider.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/styles/bb10style/bb10style.pro b/src/plugins/styles/bb10style/bb10style.pro
new file mode 100644
index 0000000000..ad35df6de7
--- /dev/null
+++ b/src/plugins/styles/bb10style/bb10style.pro
@@ -0,0 +1,28 @@
+TARGET = bb10styleplugin
+
+PLUGIN_TYPE = styles
+PLUGIN_CLASS_NAME = BlackBerry10StylePlugin
+load(qt_plugin)
+
+INCLUDEPATH += $$PWD
+
+QT += widgets
+
+HEADERS += \
+ qpixmapstyle.h \
+ qbb10brightstyle.h \
+ qbb10darkstyle.h \
+ qbb10styleplugin.h
+
+SOURCES += \
+ qpixmapstyle.cpp \
+ qbb10brightstyle.cpp \
+ qbb10darkstyle.cpp \
+ qbb10styleplugin.cpp
+
+RESOURCES += \
+ qbb10brightstyle.qrc \
+ qbb10darkstyle.qrc
+
+OTHER_FILES += qbb10styleplugin.json
+
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_disabled.png b/src/plugins/styles/bb10style/bright/button/core_button_disabled.png
new file mode 100644
index 0000000000..578a2383b8
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/button/core_button_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_disabled_selected.png b/src/plugins/styles/bb10style/bright/button/core_button_disabled_selected.png
new file mode 100644
index 0000000000..7cd998af46
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/button/core_button_disabled_selected.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_enabled_selected.png b/src/plugins/styles/bb10style/bright/button/core_button_enabled_selected.png
new file mode 100644
index 0000000000..ff0850f616
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/button/core_button_enabled_selected.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_inactive.png b/src/plugins/styles/bb10style/bright/button/core_button_inactive.png
new file mode 100755
index 0000000000..7769f15e44
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/button/core_button_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_pressed.png b/src/plugins/styles/bb10style/bright/button/core_button_pressed.png
new file mode 100755
index 0000000000..59b5bfa7c2
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/button/core_button_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_checked.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_checked.png
new file mode 100644
index 0000000000..c59f60633c
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled.png
new file mode 100644
index 0000000000..49d9cfdf94
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled_checked.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled_checked.png
new file mode 100644
index 0000000000..35751553e1
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_disabled_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_enabled.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_enabled.png
new file mode 100644
index 0000000000..2a0c56b503
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_enabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png
new file mode 100755
index 0000000000..f1c2ee3bed
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed_checked.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed_checked.png
new file mode 100644
index 0000000000..d58df47cbf
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button.png
new file mode 100644
index 0000000000..1aa844309f
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown.png
new file mode 100644
index 0000000000..9ac049fb3d
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown_pressed.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown_pressed.png
new file mode 100644
index 0000000000..d11af56b71
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowdown_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowup.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowup.png
new file mode 100644
index 0000000000..d10779d8d7
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_arrowup.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_disabled.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_disabled.png
new file mode 100644
index 0000000000..f9e1c9465b
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_pressed.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_pressed.png
new file mode 100644
index 0000000000..27a321e387
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_button_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_checkmark.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_checkmark.png
new file mode 100644
index 0000000000..a8270aed56
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_checkmark.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_divider.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_divider.png
new file mode 100644
index 0000000000..0198293ad6
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_divider.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menu.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menu.png
new file mode 100644
index 0000000000..47e7b2d4b6
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menu.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menuup.png b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menuup.png
new file mode 100644
index 0000000000..2bde84e71d
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_dropdown_menuup.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/combobox/core_listitem_active.png b/src/plugins/styles/bb10style/bright/combobox/core_listitem_active.png
new file mode 100644
index 0000000000..4935d13c05
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/combobox/core_listitem_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png
new file mode 100755
index 0000000000..07b8ea21bf
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_disabled.png b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_disabled.png
new file mode 100644
index 0000000000..ab1083e9fa
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png
new file mode 100755
index 0000000000..55f8aee066
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png b/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png
new file mode 100755
index 0000000000..34daccc27e
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png b/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png
new file mode 100755
index 0000000000..7a1e22321d
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png
new file mode 100755
index 0000000000..3ff930dea7
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_complete.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_complete.png
new file mode 100644
index 0000000000..87974668ff
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_complete.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_fill.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_fill.png
new file mode 100644
index 0000000000..8ff257dad3
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_fill.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vbg.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vbg.png
new file mode 100644
index 0000000000..66cf8cac8f
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vbg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vcomplete.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vcomplete.png
new file mode 100644
index 0000000000..f18e0abafb
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vcomplete.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vfill.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vfill.png
new file mode 100644
index 0000000000..94e388a7aa
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_vfill.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_checked.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_checked.png
new file mode 100644
index 0000000000..5dc5e52d88
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled.png
new file mode 100644
index 0000000000..077aa79c65
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled_checked.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled_checked.png
new file mode 100644
index 0000000000..439499040a
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_disabled_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png
new file mode 100755
index 0000000000..cb4c6a8136
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png
new file mode 100755
index 0000000000..88fd1344d2
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png b/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png
new file mode 100755
index 0000000000..79154e0568
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar_v.png b/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar_v.png
new file mode 100644
index 0000000000..169a4e1656
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar_v.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_active.png b/src/plugins/styles/bb10style/bright/slider/core_slider_active.png
new file mode 100644
index 0000000000..c23c0ebc26
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_cache.png b/src/plugins/styles/bb10style/bright/slider/core_slider_cache.png
new file mode 100644
index 0000000000..6b7224d702
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_cache.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_disabled.png b/src/plugins/styles/bb10style/bright/slider/core_slider_disabled.png
new file mode 100644
index 0000000000..9de7567e68
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_enabled.png b/src/plugins/styles/bb10style/bright/slider/core_slider_enabled.png
new file mode 100644
index 0000000000..ad5c35076c
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_enabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_handle.png b/src/plugins/styles/bb10style/bright/slider/core_slider_handle.png
new file mode 100644
index 0000000000..076e272794
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_handle.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_handle_disabled.png b/src/plugins/styles/bb10style/bright/slider/core_slider_handle_disabled.png
new file mode 100644
index 0000000000..5989fcaaeb
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_handle_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png b/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png
new file mode 100755
index 0000000000..8cb79118b9
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_inactive.png b/src/plugins/styles/bb10style/bright/slider/core_slider_inactive.png
new file mode 100644
index 0000000000..8836534923
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_vactive.png b/src/plugins/styles/bb10style/bright/slider/core_slider_vactive.png
new file mode 100644
index 0000000000..03062326f2
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_vactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_vcache.png b/src/plugins/styles/bb10style/bright/slider/core_slider_vcache.png
new file mode 100644
index 0000000000..b0d94d7127
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_vcache.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_vdisabled.png b/src/plugins/styles/bb10style/bright/slider/core_slider_vdisabled.png
new file mode 100644
index 0000000000..ce99b1a3ac
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_vdisabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_venabled.png b/src/plugins/styles/bb10style/bright/slider/core_slider_venabled.png
new file mode 100644
index 0000000000..910b6627d4
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_venabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_vinactive.png b/src/plugins/styles/bb10style/bright/slider/core_slider_vinactive.png
new file mode 100644
index 0000000000..18a9819af8
--- /dev/null
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_vinactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_disabled.png b/src/plugins/styles/bb10style/dark/button/core_button_disabled.png
new file mode 100644
index 0000000000..79245dbf11
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/button/core_button_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_disabled_selected.png b/src/plugins/styles/bb10style/dark/button/core_button_disabled_selected.png
new file mode 100644
index 0000000000..5eb86b70f3
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/button/core_button_disabled_selected.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_enabled_selected.png b/src/plugins/styles/bb10style/dark/button/core_button_enabled_selected.png
new file mode 100644
index 0000000000..7b1a6ce40b
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/button/core_button_enabled_selected.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_inactive.png b/src/plugins/styles/bb10style/dark/button/core_button_inactive.png
new file mode 100755
index 0000000000..97842e1ac4
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/button/core_button_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_pressed.png b/src/plugins/styles/bb10style/dark/button/core_button_pressed.png
new file mode 100755
index 0000000000..c149b64a26
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/button/core_button_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_checked.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_checked.png
new file mode 100644
index 0000000000..5a8af33094
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled.png
new file mode 100644
index 0000000000..74a24522fa
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled_checked.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled_checked.png
new file mode 100644
index 0000000000..1e953221b6
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_disabled_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_enabled.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_enabled.png
new file mode 100644
index 0000000000..5e51e7f39b
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_enabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png
new file mode 100755
index 0000000000..507a77b3ea
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed_checked.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed_checked.png
new file mode 100644
index 0000000000..7fa85428a0
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button.png
new file mode 100644
index 0000000000..a68d93acb5
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown.png
new file mode 100644
index 0000000000..4c1d085360
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown_pressed.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown_pressed.png
new file mode 100644
index 0000000000..1ee578e07c
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowdown_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowup.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowup.png
new file mode 100644
index 0000000000..3239ef4bd6
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_arrowup.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_disabled.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_disabled.png
new file mode 100644
index 0000000000..af6793b87c
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_pressed.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_pressed.png
new file mode 100644
index 0000000000..df6d402554
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_button_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_checkmark.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_checkmark.png
new file mode 100644
index 0000000000..578c80aa5f
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_checkmark.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_divider.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_divider.png
new file mode 100644
index 0000000000..43b1025d36
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_divider.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menu.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menu.png
new file mode 100644
index 0000000000..1f52362050
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menu.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menuup.png b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menuup.png
new file mode 100644
index 0000000000..62c7a2e558
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_dropdown_menuup.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/combobox/core_listitem_active.png b/src/plugins/styles/bb10style/dark/combobox/core_listitem_active.png
new file mode 100644
index 0000000000..1df4a7aad9
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/combobox/core_listitem_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png
new file mode 100755
index 0000000000..07b8ea21bf
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_disabled.png b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_disabled.png
new file mode 100644
index 0000000000..6bcaf91f87
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png
new file mode 100755
index 0000000000..9b115897e8
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png b/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png
new file mode 100755
index 0000000000..52aa4e4aa2
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png b/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png
new file mode 100755
index 0000000000..39e3a8a4f5
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png
new file mode 100755
index 0000000000..95fcafb437
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_complete.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_complete.png
new file mode 100644
index 0000000000..e849c8f179
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_complete.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_fill.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_fill.png
new file mode 100644
index 0000000000..e8fd3b0173
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_fill.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vbg.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vbg.png
new file mode 100644
index 0000000000..1433f3ec33
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vbg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vcomplete.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vcomplete.png
new file mode 100644
index 0000000000..d750e4671c
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vcomplete.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vfill.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vfill.png
new file mode 100644
index 0000000000..2c3c0a5e6c
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_vfill.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_checked.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_checked.png
new file mode 100644
index 0000000000..1721586ac5
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled.png
new file mode 100644
index 0000000000..e646c9174b
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled_checked.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled_checked.png
new file mode 100644
index 0000000000..93b3118e8d
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_disabled_checked.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png
new file mode 100755
index 0000000000..fd61937d65
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png
new file mode 100755
index 0000000000..58a1a57b4c
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png b/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png
new file mode 100755
index 0000000000..384f60758a
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar_v.png b/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar_v.png
new file mode 100644
index 0000000000..2542f2acaf
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar_v.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_active.png b/src/plugins/styles/bb10style/dark/slider/core_slider_active.png
new file mode 100644
index 0000000000..6bdb413ced
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_cache.png b/src/plugins/styles/bb10style/dark/slider/core_slider_cache.png
new file mode 100644
index 0000000000..eea5b3d78e
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_cache.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_disabled.png b/src/plugins/styles/bb10style/dark/slider/core_slider_disabled.png
new file mode 100644
index 0000000000..6a233315e4
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_enabled.png b/src/plugins/styles/bb10style/dark/slider/core_slider_enabled.png
new file mode 100644
index 0000000000..2b297e5ca2
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_enabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_handle.png b/src/plugins/styles/bb10style/dark/slider/core_slider_handle.png
new file mode 100644
index 0000000000..fbd37e5584
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_handle.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_handle_disabled.png b/src/plugins/styles/bb10style/dark/slider/core_slider_handle_disabled.png
new file mode 100644
index 0000000000..49cb6a42a7
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_handle_disabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png b/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png
new file mode 100755
index 0000000000..803c374015
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_inactive.png b/src/plugins/styles/bb10style/dark/slider/core_slider_inactive.png
new file mode 100644
index 0000000000..08a1aecb6c
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_vactive.png b/src/plugins/styles/bb10style/dark/slider/core_slider_vactive.png
new file mode 100644
index 0000000000..c8e467d9e6
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_vactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_vcache.png b/src/plugins/styles/bb10style/dark/slider/core_slider_vcache.png
new file mode 100644
index 0000000000..ff160cbb1d
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_vcache.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_vdisabled.png b/src/plugins/styles/bb10style/dark/slider/core_slider_vdisabled.png
new file mode 100644
index 0000000000..27d348122b
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_vdisabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_venabled.png b/src/plugins/styles/bb10style/dark/slider/core_slider_venabled.png
new file mode 100644
index 0000000000..ff8a74a19f
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_venabled.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_vinactive.png b/src/plugins/styles/bb10style/dark/slider/core_slider_vinactive.png
new file mode 100644
index 0000000000..b2b19a5460
--- /dev/null
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_vinactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/qbb10brightstyle.cpp b/src/plugins/styles/bb10style/qbb10brightstyle.cpp
new file mode 100644
index 0000000000..8e6da406ea
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10brightstyle.cpp
@@ -0,0 +1,352 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbb10brightstyle.h"
+
+#include <QApplication>
+#include <QFont>
+#include <QStyleOption>
+#include <QProgressBar>
+#include <QComboBox>
+#include <QAbstractItemView>
+#include <QPainter>
+
+QT_BEGIN_NAMESPACE
+
+QBB10BrightStyle::QBB10BrightStyle() :
+ QPixmapStyle()
+{
+ addDescriptor(PB_Enabled,
+ QLatin1String("://bright/button/core_button_inactive.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_Checked,
+ QLatin1String("://bright/button/core_button_enabled_selected.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_Pressed,
+ QLatin1String("://bright/button/core_button_pressed.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_Disabled,
+ QLatin1String("://bright/button/core_button_disabled.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_PressedDisabled,
+ QLatin1String("://bright/button/core_button_disabled_selected.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+
+ addDescriptor(LE_Enabled,
+ QLatin1String("://bright/lineedit/core_textinput_bg.png"),
+ QMargins(8, 8, 8, 8));
+ addDescriptor(LE_Disabled,
+ QLatin1String("://bright/lineedit/core_textinput_bg_disabled.png"),
+ QMargins(8, 8, 8, 8));
+ addDescriptor(LE_Focused,
+ QLatin1String("://bright/lineedit/core_textinput_bg_highlight.png"),
+ QMargins(8, 8, 8, 8));
+
+ copyDescriptor(LE_Enabled, TE_Enabled);
+ copyDescriptor(LE_Disabled, TE_Disabled);
+ copyDescriptor(LE_Focused, TE_Focused);
+
+ addPixmap(CB_Enabled,
+ QLatin1String("://bright/checkbox/core_checkbox_enabled.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_Checked,
+ QLatin1String("://bright/checkbox/core_checkbox_checked.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_Pressed,
+ QLatin1String("://bright/checkbox/core_checkbox_pressed.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_PressedChecked,
+ QLatin1String("://bright/checkbox/core_checkbox_pressed_checked.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_Disabled,
+ QLatin1String("://bright/checkbox/core_checkbox_disabled.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_DisabledChecked,
+ QLatin1String("://bright/checkbox/core_checkbox_disabled_checked.png"),
+ QMargins(16, 16, 16, 16));
+
+ addPixmap(RB_Enabled,
+ QLatin1String("://bright/radiobutton/core_radiobutton_inactive.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_Checked,
+ QLatin1String("://bright/radiobutton/core_radiobutton_checked.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_Pressed,
+ QLatin1String("://bright/radiobutton/core_radiobutton_pressed.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_Disabled,
+ QLatin1String("://bright/radiobutton/core_radiobutton_disabled.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_DisabledChecked,
+ QLatin1String("://bright/radiobutton/core_radiobutton_disabled_checked.png"),
+ QMargins(16, 16, 16, 16));
+
+ addDescriptor(PB_HBackground,
+ QLatin1String("://bright/progressbar/core_progressindicator_bg.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_HContent,
+ QLatin1String("://bright/progressbar/core_progressindicator_fill.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_HComplete,
+ QLatin1String("://bright/progressbar/core_progressindicator_complete.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_VBackground,
+ QLatin1String("://bright/progressbar/core_progressindicator_vbg.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(PB_VContent,
+ QLatin1String("://bright/progressbar/core_progressindicator_vfill.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(PB_VComplete,
+ QLatin1String("://bright/progressbar/core_progressindicator_vcomplete.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+
+ addDescriptor(SG_HEnabled,
+ QLatin1String("://bright/slider/core_slider_enabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HDisabled,
+ QLatin1String("://bright/slider/core_slider_disabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HActiveEnabled,
+ QLatin1String("://bright/slider/core_slider_inactive.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HActivePressed,
+ QLatin1String("://bright/slider/core_slider_active.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HActiveDisabled,
+ QLatin1String("://bright/slider/core_slider_cache.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_VEnabled,
+ QLatin1String("://bright/slider/core_slider_venabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VDisabled,
+ QLatin1String("://bright/slider/core_slider_vdisabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VActiveEnabled,
+ QLatin1String("://bright/slider/core_slider_vinactive.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VActivePressed,
+ QLatin1String("://bright/slider/core_slider_vactive.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VActiveDisabled,
+ QLatin1String("://bright/slider/core_slider_vcache.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+
+ addPixmap(SH_HEnabled,
+ QLatin1String("://bright/slider/core_slider_handle.png"));
+ addPixmap(SH_HDisabled,
+ QLatin1String("://bright/slider/core_slider_handle_disabled.png"));
+ addPixmap(SH_HPressed,
+ QLatin1String("://bright/slider/core_slider_handle_pressed.png"));
+ addPixmap(SH_VEnabled,
+ QLatin1String("://bright/slider/core_slider_handle.png"));
+ addPixmap(SH_VDisabled,
+ QLatin1String("://bright/slider/core_slider_handle_disabled.png"));
+ addPixmap(SH_VPressed,
+ QLatin1String("://bright/slider/core_slider_handle_pressed.png"));
+
+ addDescriptor(DD_ButtonEnabled,
+ QLatin1String("://bright/combobox/core_dropdown_button.png"),
+ QMargins(14, 14, 14, 14),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(DD_ButtonDisabled,
+ QLatin1String("://bright/combobox/core_dropdown_button_disabled.png"),
+ QMargins(14, 14, 14, 14),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(DD_ButtonPressed,
+ QLatin1String("://bright/combobox/core_dropdown_button_pressed.png"),
+ QMargins(14, 14, 14, 14),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(DD_ItemSelected,
+ QLatin1String("://bright/combobox/core_listitem_active.png"));
+
+ addPixmap(DD_ArrowEnabled,
+ QLatin1String("://bright/combobox/core_dropdown_button_arrowdown.png"),
+ QMargins(35, 39, 35, 39));
+ copyPixmap(DD_ArrowEnabled, DD_ArrowDisabled);
+ addPixmap(DD_ArrowPressed,
+ QLatin1String("://bright/combobox/core_dropdown_button_arrowdown_pressed.png"),
+ QMargins(35, 39, 35, 39));
+ addPixmap(DD_ArrowOpen,
+ QLatin1String("://bright/combobox/core_dropdown_button_arrowup.png"),
+ QMargins(35, 39, 35, 39));
+ addDescriptor(DD_PopupDown,
+ QLatin1String("://bright/combobox/core_dropdown_menu.png"),
+ QMargins(12, 12, 12, 12),
+ QTileRules(Qt::StretchTile, Qt::StretchTile));
+ addDescriptor(DD_PopupUp,
+ QLatin1String("://bright/combobox/core_dropdown_menuup.png"),
+ QMargins(12, 12, 12, 12),
+ QTileRules(Qt::StretchTile, Qt::StretchTile));
+ addPixmap(DD_ItemSeparator,
+ QLatin1String("://bright/combobox/core_dropdown_divider.png"),
+ QMargins(5, 0, 5, 0));
+
+ addDescriptor(ID_Selected,
+ QLatin1String("://bright/listitem/core_listitem_active.png"));
+ addPixmap(ID_Separator,
+ QLatin1String("://bright/listitem/core_listitem_divider.png"));
+
+ addDescriptor(SB_Horizontal,
+ QLatin1String("://bright/scrollbar/core_scrollbar.png"),
+ QMargins(7, 8, 7, 8),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SB_Vertical,
+ QLatin1String("://bright/scrollbar/core_scrollbar_v.png"),
+ QMargins(8, 7, 8, 7),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+}
+
+QBB10BrightStyle::~QBB10BrightStyle()
+{
+}
+
+void QBB10BrightStyle::polish(QApplication *application)
+{
+ QPixmapStyle::polish(application);
+}
+
+void QBB10BrightStyle::polish(QWidget *widget)
+{
+ // Hide the text by default
+ if (QProgressBar *pb = qobject_cast<QProgressBar*>(widget))
+ pb->setTextVisible(false);
+
+ if (QComboBox *cb = qobject_cast<QComboBox*>(widget)) {
+ QAbstractItemView *list = cb->view();
+ QPalette p = list->palette();
+ p.setBrush(QPalette::HighlightedText, p.brush(QPalette::Text));
+ list->setPalette(p);
+ }
+
+ if (qobject_cast<QAbstractItemView*>(widget)) {
+ QPalette p = widget->palette();
+ p.setBrush(QPalette::Disabled, QPalette::HighlightedText, p.brush(QPalette::Text));
+ widget->setPalette(p);
+ }
+
+ QPixmapStyle::polish(widget);
+}
+
+QPalette QBB10BrightStyle::standardPalette() const
+{
+ QPalette p;
+
+ QColor color = QColor(38, 38, 38);
+ p.setBrush(QPalette::ButtonText, color);
+ p.setBrush(QPalette::WindowText, color);
+ p.setBrush(QPalette::Text, color);
+
+ color.setAlpha(179);
+ p.setBrush(QPalette::Disabled, QPalette::ButtonText, color);
+ p.setBrush(QPalette::Disabled, QPalette::WindowText, color);
+ p.setBrush(QPalette::Disabled, QPalette::Text, color);
+
+ p.setColor(QPalette::Window, QColor(248, 248, 248));
+
+ p.setBrush(QPalette::Highlight, QColor(0, 168, 223));
+ p.setBrush(QPalette::HighlightedText, QColor(250, 250,250));
+
+ return p;
+}
+
+void QBB10BrightStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ switch (element) {
+ case CE_PushButtonLabel:
+ {
+ const bool on = option->state & State_On || option->state & State_Sunken;
+ const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option);
+ QStyleOptionButton newOpt = *button;
+ if (on)
+ newOpt.palette.setBrush(QPalette::ButtonText, QColor(250, 250, 250));
+ QPixmapStyle::drawControl(CE_PushButtonLabel, &newOpt, painter, widget);
+ break;
+ }
+ case CE_ProgressBarLabel:
+ // Don't draw the progress bar label
+ break;
+ default:
+ QPixmapStyle::drawControl(element, option, painter, widget);
+ }
+}
+
+void QBB10BrightStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ QPixmapStyle::drawPrimitive(element, option, painter, widget);
+
+ if (element == PE_PanelItemViewItem) {
+ // Draw the checkbox for current item
+ if (widget->property("_pixmap_combobox_list").toBool()
+ && option->state & QStyle::State_Selected) {
+ QPixmap pix(QLatin1String("://bright/combobox/core_dropdown_checkmark.png"));
+ QRect rect = option->rect;
+ const int margin = rect.height() / 2;
+ QPoint pos(rect.right() - margin - pix.width() / 2,
+ rect.top() + margin - pix.height() / 2);
+ painter->drawPixmap(pos, pix);
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/styles/bb10style/qbb10brightstyle.h b/src/plugins/styles/bb10style/qbb10brightstyle.h
new file mode 100644
index 0000000000..4a63b1dc48
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10brightstyle.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBB10BRIGHTSTYLE_H
+#define QBB10BRIGHTSTYLE_H
+
+#include "qpixmapstyle.h"
+
+QT_BEGIN_NAMESPACE
+
+class QBB10BrightStyle : public QPixmapStyle
+{
+ Q_OBJECT
+
+public:
+ QBB10BrightStyle();
+ ~QBB10BrightStyle();
+
+ void polish(QApplication *application);
+ void polish(QWidget *widget);
+
+ QPalette standardPalette() const;
+
+ void drawControl(ControlElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget = 0) const;
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QBB10BRIGHTSTYLE_H
diff --git a/src/plugins/styles/bb10style/qbb10brightstyle.qrc b/src/plugins/styles/bb10style/qbb10brightstyle.qrc
new file mode 100644
index 0000000000..2172536fa3
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10brightstyle.qrc
@@ -0,0 +1,57 @@
+<RCC>
+ <qresource prefix="/">
+ <file>bright/button/core_button_disabled.png</file>
+ <file>bright/button/core_button_disabled_selected.png</file>
+ <file>bright/button/core_button_inactive.png</file>
+ <file>bright/button/core_button_enabled_selected.png</file>
+ <file>bright/button/core_button_pressed.png</file>
+ <file>bright/checkbox/core_checkbox_checked.png</file>
+ <file>bright/checkbox/core_checkbox_disabled.png</file>
+ <file>bright/checkbox/core_checkbox_disabled_checked.png</file>
+ <file>bright/checkbox/core_checkbox_enabled.png</file>
+ <file>bright/checkbox/core_checkbox_pressed.png</file>
+ <file>bright/checkbox/core_checkbox_pressed_checked.png</file>
+ <file>bright/combobox/core_dropdown_button.png</file>
+ <file>bright/combobox/core_dropdown_button_arrowdown.png</file>
+ <file>bright/combobox/core_dropdown_button_arrowdown_pressed.png</file>
+ <file>bright/combobox/core_dropdown_button_arrowup.png</file>
+ <file>bright/combobox/core_dropdown_button_disabled.png</file>
+ <file>bright/combobox/core_dropdown_button_pressed.png</file>
+ <file>bright/combobox/core_dropdown_checkmark.png</file>
+ <file>bright/combobox/core_dropdown_divider.png</file>
+ <file>bright/combobox/core_dropdown_menu.png</file>
+ <file>bright/combobox/core_dropdown_menuup.png</file>
+ <file>bright/combobox/core_listitem_active.png</file>
+ <file>bright/lineedit/core_textinput_bg.png</file>
+ <file>bright/lineedit/core_textinput_bg_disabled.png</file>
+ <file>bright/lineedit/core_textinput_bg_highlight.png</file>
+ <file>bright/listitem/core_listitem_active.png</file>
+ <file>bright/listitem/core_listitem_divider.png</file>
+ <file>bright/progressbar/core_progressindicator_bg.png</file>
+ <file>bright/progressbar/core_progressindicator_complete.png</file>
+ <file>bright/progressbar/core_progressindicator_fill.png</file>
+ <file>bright/progressbar/core_progressindicator_vbg.png</file>
+ <file>bright/progressbar/core_progressindicator_vcomplete.png</file>
+ <file>bright/progressbar/core_progressindicator_vfill.png</file>
+ <file>bright/radiobutton/core_radiobutton_checked.png</file>
+ <file>bright/radiobutton/core_radiobutton_disabled.png</file>
+ <file>bright/radiobutton/core_radiobutton_disabled_checked.png</file>
+ <file>bright/radiobutton/core_radiobutton_inactive.png</file>
+ <file>bright/radiobutton/core_radiobutton_pressed.png</file>
+ <file>bright/scrollbar/core_scrollbar.png</file>
+ <file>bright/scrollbar/core_scrollbar_v.png</file>
+ <file>bright/slider/core_slider_active.png</file>
+ <file>bright/slider/core_slider_cache.png</file>
+ <file>bright/slider/core_slider_disabled.png</file>
+ <file>bright/slider/core_slider_enabled.png</file>
+ <file>bright/slider/core_slider_handle.png</file>
+ <file>bright/slider/core_slider_handle_disabled.png</file>
+ <file>bright/slider/core_slider_handle_pressed.png</file>
+ <file>bright/slider/core_slider_inactive.png</file>
+ <file>bright/slider/core_slider_vactive.png</file>
+ <file>bright/slider/core_slider_vcache.png</file>
+ <file>bright/slider/core_slider_vdisabled.png</file>
+ <file>bright/slider/core_slider_venabled.png</file>
+ <file>bright/slider/core_slider_vinactive.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/styles/bb10style/qbb10darkstyle.cpp b/src/plugins/styles/bb10style/qbb10darkstyle.cpp
new file mode 100644
index 0000000000..85bf4a7917
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10darkstyle.cpp
@@ -0,0 +1,357 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbb10darkstyle.h"
+
+#include <QApplication>
+#include <QFont>
+#include <QStyleOption>
+#include <QProgressBar>
+#include <QComboBox>
+#include <QAbstractItemView>
+#include <QPainter>
+#include <QLineEdit>
+#include <QTextEdit>
+
+QT_BEGIN_NAMESPACE
+
+QBB10DarkStyle::QBB10DarkStyle() :
+ QPixmapStyle()
+{
+ addDescriptor(PB_Enabled,
+ QLatin1String("://dark/button/core_button_inactive.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_Checked,
+ QLatin1String("://dark/button/core_button_enabled_selected.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_Pressed,
+ QLatin1String("://dark/button/core_button_pressed.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_Disabled,
+ QLatin1String("://dark/button/core_button_disabled.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_PressedDisabled,
+ QLatin1String("://dark/button/core_button_disabled_selected.png"),
+ QMargins(13, 13, 13, 13),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+
+ addDescriptor(LE_Enabled,
+ QLatin1String("://dark/lineedit/core_textinput_bg.png"),
+ QMargins(8, 8, 8, 8));
+ addDescriptor(LE_Disabled,
+ QLatin1String("://dark/lineedit/core_textinput_bg_disabled.png"),
+ QMargins(8, 8, 8, 8));
+ addDescriptor(LE_Focused,
+ QLatin1String("://dark/lineedit/core_textinput_bg_highlight.png"),
+ QMargins(8, 8, 8, 8));
+
+ copyDescriptor(LE_Enabled, TE_Enabled);
+ copyDescriptor(LE_Disabled, TE_Disabled);
+ copyDescriptor(LE_Focused, TE_Focused);
+
+ addPixmap(CB_Enabled,
+ QLatin1String("://dark/checkbox/core_checkbox_enabled.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_Checked,
+ QLatin1String("://dark/checkbox/core_checkbox_checked.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_Pressed,
+ QLatin1String("://dark/checkbox/core_checkbox_pressed.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_PressedChecked,
+ QLatin1String("://dark/checkbox/core_checkbox_pressed_checked.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_Disabled,
+ QLatin1String("://dark/checkbox/core_checkbox_disabled.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(CB_DisabledChecked,
+ QLatin1String("://dark/checkbox/core_checkbox_disabled_checked.png"),
+ QMargins(16, 16, 16, 16));
+
+ addPixmap(RB_Enabled,
+ QLatin1String("://dark/radiobutton/core_radiobutton_inactive.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_Checked,
+ QLatin1String("://dark/radiobutton/core_radiobutton_checked.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_Pressed,
+ QLatin1String("://dark/radiobutton/core_radiobutton_pressed.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_Disabled,
+ QLatin1String("://dark/radiobutton/core_radiobutton_disabled.png"),
+ QMargins(16, 16, 16, 16));
+ addPixmap(RB_DisabledChecked,
+ QLatin1String("://dark/radiobutton/core_radiobutton_disabled_checked.png"),
+ QMargins(16, 16, 16, 16));
+
+ addDescriptor(PB_HBackground,
+ QLatin1String("://dark/progressbar/core_progressindicator_bg.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_HContent,
+ QLatin1String("://dark/progressbar/core_progressindicator_fill.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_HComplete,
+ QLatin1String("://dark/progressbar/core_progressindicator_complete.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(PB_VBackground,
+ QLatin1String("://dark/progressbar/core_progressindicator_vbg.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(PB_VContent,
+ QLatin1String("://dark/progressbar/core_progressindicator_vfill.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(PB_VComplete,
+ QLatin1String("://dark/progressbar/core_progressindicator_vcomplete.png"),
+ QMargins(10, 10, 10, 10),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+
+ addDescriptor(SG_HEnabled,
+ QLatin1String("://dark/slider/core_slider_enabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HDisabled,
+ QLatin1String("://dark/slider/core_slider_disabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HActiveEnabled,
+ QLatin1String("://dark/slider/core_slider_inactive.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HActivePressed,
+ QLatin1String("://dark/slider/core_slider_active.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_HActiveDisabled,
+ QLatin1String("://dark/slider/core_slider_cache.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SG_VEnabled,
+ QLatin1String("://dark/slider/core_slider_venabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VDisabled,
+ QLatin1String("://dark/slider/core_slider_vdisabled.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VActiveEnabled,
+ QLatin1String("://dark/slider/core_slider_vinactive.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VActivePressed,
+ QLatin1String("://dark/slider/core_slider_vactive.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+ addDescriptor(SG_VActiveDisabled,
+ QLatin1String("://dark/slider/core_slider_vcache.png"),
+ QMargins(50, 50, 50, 50),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+
+ addPixmap(SH_HEnabled,
+ QLatin1String("://dark/slider/core_slider_handle.png"));
+ addPixmap(SH_HDisabled,
+ QLatin1String("://dark/slider/core_slider_handle_disabled.png"));
+ addPixmap(SH_HPressed,
+ QLatin1String("://dark/slider/core_slider_handle_pressed.png"));
+ addPixmap(SH_VEnabled,
+ QLatin1String("://dark/slider/core_slider_handle.png"));
+ addPixmap(SH_VDisabled,
+ QLatin1String("://dark/slider/core_slider_handle_disabled.png"));
+ addPixmap(SH_VPressed,
+ QLatin1String("://dark/slider/core_slider_handle_pressed.png"));
+
+ addDescriptor(DD_ButtonEnabled,
+ QLatin1String("://dark/combobox/core_dropdown_button.png"),
+ QMargins(14, 14, 14, 14),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(DD_ButtonDisabled,
+ QLatin1String("://dark/combobox/core_dropdown_button_disabled.png"),
+ QMargins(14, 14, 14, 14),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(DD_ButtonPressed,
+ QLatin1String("://dark/combobox/core_dropdown_button_pressed.png"),
+ QMargins(14, 14, 14, 14),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(DD_ItemSelected,
+ QLatin1String("://dark/combobox/core_listitem_active.png"));
+ addPixmap(DD_ArrowEnabled,
+ QLatin1String("://dark/combobox/core_dropdown_button_arrowdown.png"),
+ QMargins(35, 39, 35, 39));
+ copyPixmap(DD_ArrowEnabled, DD_ArrowDisabled);
+ addPixmap(DD_ArrowPressed,
+ QLatin1String("://dark/combobox/core_dropdown_button_arrowdown_pressed.png"),
+ QMargins(35, 39, 35, 39));
+ addPixmap(DD_ArrowOpen,
+ QLatin1String("://dark/combobox/core_dropdown_button_arrowup.png"),
+ QMargins(35, 39, 35, 39));
+ addDescriptor(DD_PopupDown,
+ QLatin1String("://dark/combobox/core_dropdown_menu.png"),
+ QMargins(12, 12, 12, 12), QTileRules(Qt::StretchTile, Qt::StretchTile));
+ addDescriptor(DD_PopupUp,
+ QLatin1String("://dark/combobox/core_dropdown_menuup.png"),
+ QMargins(12, 12, 12, 12), QTileRules(Qt::StretchTile, Qt::StretchTile));
+ addPixmap(DD_ItemSeparator,
+ QLatin1String("://dark/combobox/core_dropdown_divider.png"),
+ QMargins(5, 0, 5, 0));
+
+ addDescriptor(ID_Selected,
+ QLatin1String("://dark/listitem/core_listitem_active.png"));
+ addPixmap(ID_Separator,
+ QLatin1String("://dark/listitem/core_listitem_divider.png"));
+
+ addDescriptor(SB_Horizontal,
+ QLatin1String("://dark/scrollbar/core_scrollbar.png"),
+ QMargins(7, 8, 7, 8),
+ QTileRules(Qt::RepeatTile, Qt::StretchTile));
+ addDescriptor(SB_Vertical,
+ QLatin1String("://dark/scrollbar/core_scrollbar_v.png"),
+ QMargins(8, 7, 8, 7),
+ QTileRules(Qt::StretchTile, Qt::RepeatTile));
+}
+
+QBB10DarkStyle::~QBB10DarkStyle()
+{
+}
+
+void QBB10DarkStyle::polish(QApplication *application)
+{
+ QPixmapStyle::polish(application);
+}
+
+void QBB10DarkStyle::polish(QWidget *widget)
+{
+ // Hide the text by default
+ if (QProgressBar *pb = qobject_cast<QProgressBar*>(widget))
+ pb->setTextVisible(false);
+
+ if (QComboBox *cb = qobject_cast<QComboBox*>(widget)) {
+ QAbstractItemView *list = cb->view();
+ QPalette p = list->palette();
+ p.setBrush(QPalette::HighlightedText, p.brush(QPalette::Text));
+ list->setPalette(p);
+ }
+
+ if (qobject_cast<QLineEdit*>(widget) || qobject_cast<QTextEdit*>(widget)) {
+ QPalette p = widget->palette();
+ p.setBrush(QPalette::Text, QColor(38, 38, 38));
+ widget->setPalette(p);
+ }
+
+ if (qobject_cast<QAbstractItemView*>(widget)) {
+ QPalette p = widget->palette();
+ p.setBrush(QPalette::Disabled, QPalette::HighlightedText, p.brush(QPalette::Text));
+ widget->setPalette(p);
+ }
+
+ QPixmapStyle::polish(widget);
+}
+
+QPalette QBB10DarkStyle::standardPalette() const
+{
+ QPalette p;
+
+ QColor color = QColor(250, 250, 250);
+ p.setBrush(QPalette::ButtonText, color);
+ p.setBrush(QPalette::WindowText, color);
+ p.setBrush(QPalette::Text, color);
+
+ color.setAlpha(179);
+ p.setBrush(QPalette::Disabled, QPalette::ButtonText, color);
+ p.setBrush(QPalette::Disabled, QPalette::WindowText, color);
+ p.setBrush(QPalette::Disabled, QPalette::Text, color);
+
+ p.setColor(QPalette::Window, QColor(18, 18, 18));
+
+ p.setBrush(QPalette::Highlight, QColor(0, 168, 223));
+ p.setBrush(QPalette::HighlightedText, QColor(250, 250,250));
+
+ return p;
+}
+
+void QBB10DarkStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ switch (element) {
+ case CE_PushButtonLabel:
+ {
+ const bool on = option->state & State_On || option->state & State_Sunken;
+ const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option);
+ QStyleOptionButton newOpt = *button;
+ if (on)
+ newOpt.palette.setBrush(QPalette::ButtonText, QColor(38, 38, 38));
+ QPixmapStyle::drawControl(CE_PushButtonLabel, &newOpt, painter, widget);
+ break;
+ }
+ case CE_ProgressBarLabel:
+ // Don't draw the progress bar label
+ break;
+ default:
+ QPixmapStyle::drawControl(element, option, painter, widget);
+ }
+}
+
+void QBB10DarkStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ QPixmapStyle::drawPrimitive(element, option, painter, widget);
+
+ if (element == PE_PanelItemViewItem) {
+ // Draw the checkbox for current item
+ if (widget->property("_pixmap_combobox_list").toBool()
+ && option->state & QStyle::State_Selected) {
+ QPixmap pix(QLatin1String("://dark/combobox/core_dropdown_checkmark.png"));
+ QRect rect = option->rect;
+ const int margin = rect.height() / 2;
+ QPoint pos(rect.right() - margin - pix.width() / 2,
+ rect.top() + margin - pix.height() / 2);
+ painter->drawPixmap(pos, pix);
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/styles/bb10style/qbb10darkstyle.h b/src/plugins/styles/bb10style/qbb10darkstyle.h
new file mode 100644
index 0000000000..1be7b0540c
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10darkstyle.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBB10DARKSTYLE_H
+#define QBB10DARKSTYLE_H
+
+#include "qpixmapstyle.h"
+
+QT_BEGIN_NAMESPACE
+
+class QBB10DarkStyle : public QPixmapStyle
+{
+ Q_OBJECT
+
+public:
+ QBB10DarkStyle();
+ ~QBB10DarkStyle();
+
+ void polish(QApplication *application);
+ void polish(QWidget *widget);
+
+ QPalette standardPalette() const;
+
+ void drawControl(ControlElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget = 0) const;
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QBB10DARKSTYLE_H
diff --git a/src/plugins/styles/bb10style/qbb10darkstyle.qrc b/src/plugins/styles/bb10style/qbb10darkstyle.qrc
new file mode 100644
index 0000000000..31a5236207
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10darkstyle.qrc
@@ -0,0 +1,57 @@
+<RCC>
+ <qresource prefix="/">
+ <file>dark/button/core_button_disabled.png</file>
+ <file>dark/button/core_button_disabled_selected.png</file>
+ <file>dark/button/core_button_inactive.png</file>
+ <file>dark/button/core_button_enabled_selected.png</file>
+ <file>dark/button/core_button_pressed.png</file>
+ <file>dark/checkbox/core_checkbox_checked.png</file>
+ <file>dark/checkbox/core_checkbox_disabled.png</file>
+ <file>dark/checkbox/core_checkbox_disabled_checked.png</file>
+ <file>dark/checkbox/core_checkbox_enabled.png</file>
+ <file>dark/checkbox/core_checkbox_pressed.png</file>
+ <file>dark/checkbox/core_checkbox_pressed_checked.png</file>
+ <file>dark/combobox/core_dropdown_button.png</file>
+ <file>dark/combobox/core_dropdown_button_arrowdown.png</file>
+ <file>dark/combobox/core_dropdown_button_arrowdown_pressed.png</file>
+ <file>dark/combobox/core_dropdown_button_arrowup.png</file>
+ <file>dark/combobox/core_dropdown_button_disabled.png</file>
+ <file>dark/combobox/core_dropdown_button_pressed.png</file>
+ <file>dark/combobox/core_dropdown_checkmark.png</file>
+ <file>dark/combobox/core_dropdown_divider.png</file>
+ <file>dark/combobox/core_dropdown_menu.png</file>
+ <file>dark/combobox/core_dropdown_menuup.png</file>
+ <file>dark/combobox/core_listitem_active.png</file>
+ <file>dark/lineedit/core_textinput_bg.png</file>
+ <file>dark/lineedit/core_textinput_bg_disabled.png</file>
+ <file>dark/lineedit/core_textinput_bg_highlight.png</file>
+ <file>dark/listitem/core_listitem_active.png</file>
+ <file>dark/listitem/core_listitem_divider.png</file>
+ <file>dark/progressbar/core_progressindicator_bg.png</file>
+ <file>dark/progressbar/core_progressindicator_complete.png</file>
+ <file>dark/progressbar/core_progressindicator_fill.png</file>
+ <file>dark/progressbar/core_progressindicator_vbg.png</file>
+ <file>dark/progressbar/core_progressindicator_vcomplete.png</file>
+ <file>dark/progressbar/core_progressindicator_vfill.png</file>
+ <file>dark/radiobutton/core_radiobutton_checked.png</file>
+ <file>dark/radiobutton/core_radiobutton_disabled.png</file>
+ <file>dark/radiobutton/core_radiobutton_disabled_checked.png</file>
+ <file>dark/radiobutton/core_radiobutton_inactive.png</file>
+ <file>dark/radiobutton/core_radiobutton_pressed.png</file>
+ <file>dark/scrollbar/core_scrollbar.png</file>
+ <file>dark/scrollbar/core_scrollbar_v.png</file>
+ <file>dark/slider/core_slider_active.png</file>
+ <file>dark/slider/core_slider_cache.png</file>
+ <file>dark/slider/core_slider_disabled.png</file>
+ <file>dark/slider/core_slider_enabled.png</file>
+ <file>dark/slider/core_slider_handle.png</file>
+ <file>dark/slider/core_slider_handle_disabled.png</file>
+ <file>dark/slider/core_slider_handle_pressed.png</file>
+ <file>dark/slider/core_slider_inactive.png</file>
+ <file>dark/slider/core_slider_vactive.png</file>
+ <file>dark/slider/core_slider_vcache.png</file>
+ <file>dark/slider/core_slider_vdisabled.png</file>
+ <file>dark/slider/core_slider_venabled.png</file>
+ <file>dark/slider/core_slider_vinactive.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/styles/bb10style/qbb10styleplugin.cpp b/src/plugins/styles/bb10style/qbb10styleplugin.cpp
new file mode 100644
index 0000000000..eba5e868a2
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10styleplugin.cpp
@@ -0,0 +1,74 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbb10styleplugin.h"
+#include "qbb10darkstyle.h"
+#include "qbb10brightstyle.h"
+
+QT_BEGIN_NAMESPACE
+
+QBB10StylePlugin::QBB10StylePlugin()
+{
+}
+
+QBB10StylePlugin::~QBB10StylePlugin()
+{
+}
+
+QStyle *QBB10StylePlugin::create(const QString &key)
+{
+ const QString keyLower(key.toLower());
+ if (keyLower == QLatin1String("bb10bright"))
+ return new QBB10BrightStyle;
+ else if (keyLower == QLatin1String("bb10dark"))
+ return new QBB10DarkStyle;
+
+ return 0;
+}
+
+QStringList QBB10StylePlugin::keys() const
+{
+ return QStringList() << QLatin1String("bb10bright") << QLatin1String("bb10dark");
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qbb10styleplugin.cpp"
diff --git a/src/plugins/styles/bb10style/qbb10styleplugin.h b/src/plugins/styles/bb10style/qbb10styleplugin.h
new file mode 100644
index 0000000000..2bc08d441c
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10styleplugin.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBB10STYLEPLUGIN_H
+#define QBB10STYLEPLUGIN_H
+
+#include <QStylePlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QBB10StylePlugin : public QStylePlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "qbb10styleplugin.json")
+
+public:
+ QBB10StylePlugin();
+ ~QBB10StylePlugin();
+
+ QStyle *create(const QString &key);
+ QStringList keys() const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QBB10STYLEPLUGIN_H
diff --git a/src/plugins/styles/bb10style/qbb10styleplugin.json b/src/plugins/styles/bb10style/qbb10styleplugin.json
new file mode 100644
index 0000000000..8f79b706c3
--- /dev/null
+++ b/src/plugins/styles/bb10style/qbb10styleplugin.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "bb10bright", "bb10dark" ]
+}
diff --git a/src/plugins/styles/bb10style/qpixmapstyle.cpp b/src/plugins/styles/bb10style/qpixmapstyle.cpp
new file mode 100644
index 0000000000..e80a1d991c
--- /dev/null
+++ b/src/plugins/styles/bb10style/qpixmapstyle.cpp
@@ -0,0 +1,994 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qpixmapstyle.h"
+
+#include <QDebug>
+#include <QTextEdit>
+#include <QStringBuilder>
+#include <QPainter>
+#include <QPixmapCache>
+#include <QStyleOption>
+#include <QString>
+#include <QProgressBar>
+#include <QSlider>
+#include <QEvent>
+#include <QComboBox>
+#include <QAbstractItemView>
+#include <QListView>
+#include <QTreeView>
+#include <QStyledItemDelegate>
+#include <QAbstractScrollArea>
+#include <QScrollBar>
+
+#include <qscroller.h>
+
+QT_BEGIN_NAMESPACE
+
+QPixmapStyle::QPixmapStyle() :
+ QCommonStyle()
+{
+}
+
+QPixmapStyle::~QPixmapStyle()
+{
+}
+
+void QPixmapStyle::polish(QApplication *application)
+{
+ QCommonStyle::polish(application);
+#if defined(Q_WS_WIN)
+ QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
+#endif
+}
+
+void QPixmapStyle::polish(QPalette &palette)
+{
+ palette = proxy()->standardPalette();
+}
+
+void QPixmapStyle::polish(QWidget *widget)
+{
+ // Don't fill the interior of the QTextEdit
+ if (qobject_cast<QTextEdit*>(widget)) {
+ QPalette p = widget->palette();
+ p.setBrush(QPalette::Base, Qt::NoBrush);
+ widget->setPalette(p);
+ }
+
+ if (QProgressBar *pb = qobject_cast<QProgressBar*>(widget)) {
+ // Center the text in the progress bar
+ pb->setAlignment(Qt::AlignCenter);
+ // Change the font size if needed, as it's used to compute the minimum size
+ QFont font = pb->font();
+ font.setPixelSize(m_descriptors.value(PB_HBackground).size.height()/2);
+ pb->setFont(font);
+ }
+
+ if (qobject_cast<QSlider*>(widget))
+ widget->installEventFilter(this);
+
+ if (QComboBox *cb = qobject_cast<QComboBox*>(widget)) {
+ widget->installEventFilter(this);
+ // NOTE: This will break if the private API of QComboBox changes drastically
+ // Make sure the popup is created so we can change the frame style
+ QAbstractItemView *list = cb->view();
+ list->setProperty("_pixmap_combobox_list", true);
+ list->setItemDelegate(new QStyledItemDelegate(list));
+ QPalette p = list->palette();
+ p.setBrush(QPalette::Active, QPalette::Base, QBrush(Qt::transparent) );
+ p.setBrush(QPalette::Active, QPalette::AlternateBase, QBrush(Qt::transparent) );
+ p.setBrush(QPalette::Inactive, QPalette::Base, QBrush(Qt::transparent) );
+ p.setBrush(QPalette::Inactive, QPalette::AlternateBase, QBrush(Qt::transparent) );
+ p.setBrush(QPalette::Disabled, QPalette::Base, QBrush(Qt::transparent) );
+ p.setBrush(QPalette::Disabled, QPalette::AlternateBase, QBrush(Qt::transparent) );
+ list->setPalette(p);
+
+ QFrame *frame = qobject_cast<QFrame*>(list->parent());
+ if (frame) {
+ const Descriptor &desc = m_descriptors.value(DD_PopupDown);
+ const Pixmap &pix = m_pixmaps.value(DD_ItemSeparator);
+ frame->setContentsMargins(pix.margins.left(), desc.margins.top(),
+ pix.margins.right(), desc.margins.bottom());
+ frame->setAttribute(Qt::WA_TranslucentBackground);
+#ifdef Q_WS_WIN
+ // FramelessWindowHint is needed on windows to make
+ // WA_TranslucentBackground work properly
+ frame->setWindowFlags(widget->windowFlags() | Qt::FramelessWindowHint);
+#endif
+ }
+ }
+
+ if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
+ widget->installEventFilter(this);
+
+ if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget)) {
+ scrollArea->viewport()->setAutoFillBackground(false);
+ if (QAbstractItemView *view = qobject_cast<QAbstractItemView*>(scrollArea)) {
+ view->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
+ view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
+ }
+ QScroller::grabGesture(scrollArea->viewport(), QScroller::LeftMouseButtonGesture);
+ }
+
+ if (qobject_cast<QScrollBar*>(widget))
+ widget->setAttribute(Qt::WA_OpaquePaintEvent, false);
+
+ QCommonStyle::polish(widget);
+}
+
+void QPixmapStyle::unpolish(QWidget *widget)
+{
+ if (qobject_cast<QSlider*>(widget) ||
+ qobject_cast<QComboBox*>(widget)) {
+ widget->removeEventFilter(this);
+ }
+
+ if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
+ widget->removeEventFilter(this);
+
+ if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget))
+ QScroller::ungrabGesture(scrollArea->viewport());
+
+ QCommonStyle::unpolish(widget);
+}
+
+void QPixmapStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ switch (element) {
+ case PE_FrameFocusRect: //disable focus rectangle
+ break;
+ case PE_PanelButtonBevel:
+ case PE_PanelButtonCommand:
+ drawPushButton(option, painter, widget);
+ break;
+ case PE_PanelLineEdit:
+ case PE_FrameLineEdit:
+ drawLineEdit(option, painter, widget);
+ break;
+ case PE_Frame:
+ case PE_FrameDefaultButton:
+ if (qobject_cast<const QTextEdit*>(widget))
+ drawTextEdit(option, painter, widget);
+ break;
+ case PE_IndicatorCheckBox:
+ drawCheckBox(option, painter, widget);
+ break;
+ case PE_IndicatorRadioButton:
+ drawRadioButton(option, painter, widget);
+ break;
+ case PE_PanelItemViewItem:
+ if (qobject_cast<const QListView*>(widget))
+ drawPanelItemViewItem(option, painter, widget);
+ else
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+ break;
+ default:
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+ }
+}
+
+void QPixmapStyle::drawControl(ControlElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ switch (element) {
+ case CE_ProgressBarGroove:
+ drawProgressBarBackground(option, painter, widget);
+ break;
+ case CE_ProgressBarLabel:
+ drawProgressBarLabel(option, painter, widget);
+ break;
+ case CE_ProgressBarContents:
+ drawProgressBarFill(option, painter, widget);
+ break;
+ case CE_ShapedFrame:
+ // NOTE: This will break if the private API of QComboBox changes drastically
+ if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0) {
+ const Descriptor &desc = m_descriptors.value(DD_PopupDown);
+ const Pixmap &pix = m_pixmaps.value(DD_ItemSeparator);
+ QRect rect = option->rect;
+ rect.adjust(-pix.margins.left(), -desc.margins.top(),
+ pix.margins.right(), desc.margins.bottom());
+ bool up = widget->property("_pixmapstyle_combobox_up").toBool();
+ drawCachedPixmap(up ? DD_PopupUp : DD_PopupDown, rect, painter);
+ }
+ else {
+ QCommonStyle::drawControl(element, option, painter, widget);
+ }
+ break;
+ default:
+ QCommonStyle::drawControl(element, option, painter, widget);
+ }
+}
+
+void QPixmapStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ switch (cc) {
+ case CC_Slider:
+ drawSlider(option, painter, widget);
+ break;
+ case CC_ComboBox:
+ drawComboBox(option, painter, widget);
+ break;
+ case CC_ScrollBar:
+ drawScrollBar(option, painter, widget);
+ break;
+ default:
+ QCommonStyle::drawComplexControl(cc, option, painter, widget);
+ }
+}
+
+QSize QPixmapStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const
+{
+ switch (type) {
+ case CT_PushButton:
+ return pushButtonSizeFromContents(option, contentsSize, widget);
+ case CT_LineEdit:
+ return lineEditSizeFromContents(option, contentsSize, widget);
+ case CT_ProgressBar:
+ return progressBarSizeFromContents(option, contentsSize, widget);
+ case CT_Slider:
+ return sliderSizeFromContents(option, contentsSize, widget);
+ case CT_ComboBox:
+ return comboBoxSizeFromContents(option, contentsSize, widget);
+ case CT_ItemViewItem:
+ return itemViewSizeFromContents(option, contentsSize, widget);
+ default: ;
+ }
+
+ return QCommonStyle::sizeFromContents(type, option, contentsSize, widget);
+}
+
+QRect QPixmapStyle::subElementRect(SubElement element, const QStyleOption *option,
+ const QWidget *widget) const
+{
+ switch (element) {
+ case SE_LineEditContents:
+ {
+ QRect rect = QCommonStyle::subElementRect(element, option, widget);
+ const Descriptor &desc = m_descriptors.value(LE_Enabled);
+ rect.adjust(desc.margins.left(), desc.margins.top(),
+ -desc.margins.right(), -desc.margins.bottom());
+ rect = visualRect(option->direction, option->rect, rect);
+ return rect;
+ }
+ default: ;
+ }
+
+ return QCommonStyle::subElementRect(element, option, widget);
+}
+
+QRect QPixmapStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *option,
+ SubControl sc, const QWidget *widget) const
+{
+ switch (cc) {
+ case CC_ComboBox:
+ return comboBoxSubControlRect(option, sc, widget);
+ case CC_ScrollBar:
+ return scrollBarSubControlRect(option, sc, widget);
+ default: ;
+ }
+
+ return QCommonStyle::subControlRect(cc, option, sc, widget);
+}
+
+int QPixmapStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
+ const QWidget *widget) const
+{
+ switch (metric) {
+ case PM_ButtonShiftHorizontal:
+ case PM_ButtonShiftVertical:
+ return 0;
+ case PM_DefaultFrameWidth:
+ if (qobject_cast<const QTextEdit*>(widget)) {
+ const Descriptor &desc = m_descriptors.value(LE_Enabled);
+ return qMax(qMax(desc.margins.left(), desc.margins.right()),
+ qMax(desc.margins.top(), desc.margins.bottom()));
+ }
+ return 0;
+ case PM_IndicatorWidth:
+ return m_pixmaps.value(CB_Enabled).pixmap.width();
+ case PM_IndicatorHeight:
+ return m_pixmaps.value(CB_Enabled).pixmap.height();
+ case PM_CheckBoxLabelSpacing:
+ {
+ const Pixmap &pix = m_pixmaps.value(CB_Enabled);
+ return qMax(qMax(pix.margins.left(), pix.margins.right()),
+ qMax(pix.margins.top(), pix.margins.bottom()));
+ }
+ case PM_ExclusiveIndicatorWidth:
+ return m_pixmaps.value(RB_Enabled).pixmap.width();
+ case PM_ExclusiveIndicatorHeight:
+ return m_pixmaps.value(RB_Enabled).pixmap.height();
+ case PM_RadioButtonLabelSpacing:
+ {
+ const Pixmap &pix = m_pixmaps.value(RB_Enabled);
+ return qMax(qMax(pix.margins.left(), pix.margins.right()),
+ qMax(pix.margins.top(), pix.margins.bottom()));
+ }
+ case PM_SliderThickness:
+ if (const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider*>(option)) {
+ const Descriptor desc = m_descriptors.value(slider->orientation == Qt::Horizontal
+ ? SG_HEnabled : SG_VEnabled);
+ return slider->orientation == Qt::Horizontal
+ ? desc.size.height() : desc.size.width();
+ }
+ break;
+ case PM_SliderControlThickness:
+ if (const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider*>(option)) {
+ const Pixmap pix = m_pixmaps.value(slider->orientation == Qt::Horizontal
+ ? SH_HEnabled : SH_VEnabled);
+ return slider->orientation == Qt::Horizontal
+ ? pix.pixmap.height() : pix.pixmap.width();
+ }
+ break;
+ case PM_SliderLength:
+ if (const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider*>(option)) {
+ const Pixmap pix = m_pixmaps.value(slider->orientation == Qt::Horizontal
+ ? SH_HEnabled : SH_VEnabled);
+ return slider->orientation == Qt::Horizontal
+ ? pix.pixmap.width() : pix.pixmap.height();
+ }
+ break;
+ case PM_ScrollBarExtent:
+ if (const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider*>(option)) {
+ const Descriptor desc = m_descriptors.value(slider->orientation == Qt::Horizontal
+ ? SB_Horizontal : SB_Vertical);
+ return slider->orientation == Qt::Horizontal
+ ? desc.size.height() : desc.size.width();
+ }
+ break;
+ case PM_ScrollBarSliderMin:
+ return 0;
+ default: ;
+ }
+
+ return QCommonStyle::pixelMetric(metric, option, widget);
+}
+
+int QPixmapStyle::styleHint(StyleHint hint, const QStyleOption *option,
+ const QWidget *widget, QStyleHintReturn *returnData) const
+{
+ switch (hint) {
+ case SH_EtchDisabledText:
+ return false;
+ case SH_ComboBox_Popup:
+ return false;
+ default: ;
+ }
+
+ return QCommonStyle::styleHint(hint, option, widget, returnData);
+}
+
+QStyle::SubControl QPixmapStyle::hitTestComplexControl(QStyle::ComplexControl control,
+ const QStyleOptionComplex *option,
+ const QPoint &pos,
+ const QWidget *widget) const
+{
+ const SubControl sc = QCommonStyle::hitTestComplexControl(control, option, pos, widget);
+ if (control == CC_ScrollBar) {
+ if (sc == SC_ScrollBarAddLine)
+ return SC_ScrollBarAddPage;
+ else if (sc == SC_ScrollBarSubLine)
+ return SC_ScrollBarSubPage;
+ }
+
+ return sc;
+}
+
+bool QPixmapStyle::eventFilter(QObject *watched, QEvent *event)
+{
+ if (QSlider *slider = qobject_cast<QSlider*>(watched)) {
+ switch (event->type()) {
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseMove:
+ slider->update();
+ break;
+ default: ;
+ }
+ }
+
+ if (QComboBox *comboBox = qobject_cast<QComboBox*>(watched)) {
+ switch (event->type()) {
+ case QEvent::MouseButtonPress:
+ event->ignore();
+ comboBox->setProperty("_pixmapstyle_combobox_pressed", true);
+ comboBox->repaint();
+ return true;
+ case QEvent::MouseButtonRelease:
+ comboBox->setProperty("_pixmapstyle_combobox_pressed", false);
+ comboBox->repaint();
+ if ( comboBox->view() ) {
+ if ( comboBox->view()->isVisible() || (!comboBox->isEnabled()))
+ comboBox->hidePopup();
+ else
+ comboBox->showPopup();
+ }
+ break;
+ default: ;
+ }
+ }
+
+ if (qstrcmp(watched->metaObject()->className(),"QComboBoxPrivateContainer") == 0) {
+ if (event->type() == QEvent::Show) {
+ QWidget *widget = qobject_cast<QWidget*>(watched);
+ int yPopup = widget->geometry().top();
+ int yCombo = widget->parentWidget()->mapToGlobal(QPoint(0, 0)).y();
+ QRect geom = widget->geometry();
+ const Descriptor &desc = m_descriptors.value(DD_ButtonEnabled);
+ const bool up = yPopup < yCombo;
+ geom.moveTop(geom.top() + (up ? desc.margins.top() : -desc.margins.bottom()));
+ widget->setGeometry(geom);
+ widget->setProperty("_pixmapstyle_combobox_up", up);
+ widget->parentWidget()->setProperty("_pixmapstyle_combobox_up", up);
+ }
+ }
+
+ return QCommonStyle::eventFilter(watched, event);
+}
+
+void QPixmapStyle::addDescriptor(QPixmapStyle::ControlDescriptor control, const QString &fileName,
+ QMargins margins, QTileRules tileRules)
+{
+ Descriptor desc;
+
+ QImage image(fileName);
+ if (image.isNull())
+ return;
+
+ desc.fileName = fileName;
+ desc.margins = margins;
+ desc.tileRules = tileRules;
+ desc.size = image.size();
+
+ m_descriptors[control] = desc;
+}
+
+void QPixmapStyle::copyDescriptor(QPixmapStyle::ControlDescriptor source,
+ QPixmapStyle::ControlDescriptor dest)
+{
+ m_descriptors[dest] = m_descriptors.value(source);
+}
+
+void QPixmapStyle::drawCachedPixmap(QPixmapStyle::ControlDescriptor control, const QRect &rect,
+ QPainter *p) const
+{
+ if (!m_descriptors.contains(control))
+ return;
+ const Descriptor &desc = m_descriptors.value(control);
+ const QPixmap pix = getCachedPixmap(control, desc, rect.size());
+ Q_ASSERT(!pix.isNull());
+ p->drawPixmap(rect, pix);
+}
+
+void QPixmapStyle::addPixmap(ControlPixmap control, const QString &fileName,
+ QMargins margins)
+{
+ Pixmap pix;
+
+ QPixmap image(fileName);
+ if (image.isNull())
+ return;
+
+ pix.pixmap = image;
+ pix.margins = margins;
+
+ m_pixmaps[control] = pix;
+}
+
+void QPixmapStyle::copyPixmap(QPixmapStyle::ControlPixmap source, QPixmapStyle::ControlPixmap dest)
+{
+ m_pixmaps[dest] = m_pixmaps.value(source);
+}
+
+void QPixmapStyle::drawPushButton(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ const bool checked = option->state & State_On;
+ const bool pressed = option->state & State_Sunken;
+ const bool enabled = option->state & State_Enabled;
+
+ ControlDescriptor control = PB_Enabled;
+ if (enabled)
+ control = pressed ? PB_Pressed : (checked ? PB_Checked : PB_Enabled);
+ else
+ control = checked ? PB_PressedDisabled : PB_Disabled;
+ drawCachedPixmap(control, option->rect, painter);
+}
+
+void QPixmapStyle::drawLineEdit(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ // Don't draw for the line edit inside a combobox
+ if (widget && qobject_cast<const QComboBox*>(widget->parentWidget()))
+ return;
+
+ const bool enabled = option->state & State_Enabled;
+ const bool focused = option->state & State_HasFocus;
+ ControlDescriptor control = enabled ? (focused ? LE_Focused : LE_Enabled) : LE_Disabled;
+ drawCachedPixmap(control, option->rect, painter);
+}
+
+void QPixmapStyle::drawTextEdit(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ const bool enabled = option->state & State_Enabled;
+ const bool focused = option->state & State_HasFocus;
+ ControlDescriptor control = enabled ? (focused ? TE_Focused : TE_Enabled) : TE_Disabled;
+ drawCachedPixmap(control, option->rect, painter);
+}
+
+void QPixmapStyle::drawCheckBox(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option);
+
+ const bool down = button->state & State_Sunken;
+ const bool enabled = button->state & State_Enabled;
+ const bool on = button->state & State_On;
+
+ ControlPixmap control;
+ if (enabled)
+ control = on ? (down ? CB_PressedChecked : CB_Checked) : (down ? CB_Pressed : CB_Enabled);
+ else
+ control = on ? CB_DisabledChecked : CB_Disabled;
+ painter->drawPixmap(button->rect, m_pixmaps.value(control).pixmap);
+}
+
+void QPixmapStyle::drawRadioButton(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option);
+
+ const bool down = button->state & State_Sunken;
+ const bool enabled = button->state & State_Enabled;
+ const bool on = button->state & State_On;
+
+ ControlPixmap control;
+ if (enabled)
+ control = on ? RB_Checked : (down ? RB_Pressed : RB_Enabled);
+ else
+ control = on ? RB_DisabledChecked : RB_Disabled;
+ painter->drawPixmap(button->rect, m_pixmaps.value(control).pixmap);
+}
+
+void QPixmapStyle::drawPanelItemViewItem(const QStyleOption *option, QPainter *painter,
+ const QWidget *widget) const
+{
+ ControlPixmap cp = ID_Separator;
+ ControlDescriptor cd = ID_Selected;
+
+ if (widget && widget->property("_pixmap_combobox_list").toBool()) {
+ cp = DD_ItemSeparator;
+ cd = DD_ItemSelected;
+ }
+
+ QPixmap pix = m_pixmaps.value(cp).pixmap;
+ QRect rect = option->rect;
+ rect.setBottom(rect.top() + pix.height()-1);
+ painter->drawPixmap(rect, pix);
+ if (option->state & QStyle::State_Selected) {
+ rect = option->rect;
+ rect.setTop(rect.top() + pix.height());
+ drawCachedPixmap(cd, rect, painter);
+ }
+}
+
+void QPixmapStyle::drawProgressBarBackground(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ bool vertical = false;
+ if (const QStyleOptionProgressBarV2 *pb2 =
+ qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ vertical = (pb2->orientation == Qt::Vertical);
+ }
+ drawCachedPixmap(vertical ? PB_VBackground : PB_HBackground, option->rect, painter);
+}
+
+void QPixmapStyle::drawProgressBarLabel(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ if (const QStyleOptionProgressBar *pb =
+ qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
+ bool vertical = false;
+ if (const QStyleOptionProgressBarV2 *pb2 =
+ qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ vertical = (pb2->orientation == Qt::Vertical);
+ }
+ if (!vertical) {
+ QPalette::ColorRole textRole = QPalette::ButtonText;
+ proxy()->drawItemText(painter, pb->rect,
+ Qt::AlignCenter | Qt::TextSingleLine, pb->palette,
+ pb->state & State_Enabled, pb->text, textRole);
+ }
+ }
+}
+
+void QPixmapStyle::drawProgressBarFill(const QStyleOption *option,
+ QPainter *painter, const QWidget *) const
+{
+ const QStyleOptionProgressBar *pbar =
+ qstyleoption_cast<const QStyleOptionProgressBar*>(option);
+ bool vertical = false;
+ bool flip = pbar->direction == Qt::RightToLeft;
+ if (const QStyleOptionProgressBarV2 *pb2 =
+ qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ vertical = (pb2->orientation == Qt::Vertical);
+ flip = flip ^ pb2->invertedAppearance;
+ }
+
+ if (pbar->progress == pbar->maximum) {
+ drawCachedPixmap(vertical ? PB_VComplete : PB_HComplete, option->rect, painter);
+
+ } else {
+ if (pbar->progress == 0)
+ return;
+ const int maximum = pbar->maximum;
+ const qreal ratio = qreal(vertical?option->rect.height():option->rect.width())/maximum;
+ const int progress = pbar->progress*ratio;
+
+ QRect optRect = option->rect;
+ if (vertical) {
+ if (flip)
+ optRect.setBottom(optRect.top()+progress-1);
+ else
+ optRect.setTop(optRect.bottom()-progress+1);
+ } else {
+ if (flip)
+ optRect.setLeft(optRect.right()-progress+1);
+ else
+ optRect.setRight(optRect.left()+progress-1);
+ }
+
+ drawCachedPixmap(vertical ? PB_VContent : PB_HContent, optRect, painter);
+ }
+}
+
+void QPixmapStyle::drawSlider(const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option);
+ if (!slider)
+ return;
+
+ const bool enabled = option->state & State_Enabled;
+ const bool pressed = option->state & State_Sunken;
+ const Qt::Orientation orient = slider->orientation;
+
+ const QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget);
+ if (option->subControls & SC_SliderGroove) {
+ QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget);
+ if (groove.isValid()) {
+ // Draw the background
+ ControlDescriptor control;
+ if (orient == Qt::Horizontal)
+ control = enabled ? SG_HEnabled : SG_HDisabled;
+ else
+ control = enabled ? SG_VEnabled : SG_VDisabled;
+ drawCachedPixmap(control, groove, painter);
+
+ // Draw the active part
+ if (orient == Qt::Horizontal) {
+ control = enabled ? (pressed ? SG_HActivePressed : SG_HActiveEnabled )
+ : SG_HActiveDisabled;
+ } else {
+ control = enabled ? (pressed ? SG_VActivePressed : SG_VActiveEnabled )
+ : SG_VActiveDisabled;
+ }
+ const Descriptor &desc = m_descriptors.value(control);
+ const QPixmap pix = getCachedPixmap(control, desc, groove.size());
+ if (!pix.isNull()) {
+ groove.setRight(orient == Qt::Horizontal
+ ? handle.center().x() : handle.center().y());
+ painter->drawPixmap(groove, pix, groove);
+ }
+ }
+ }
+ if (option->subControls & SC_SliderHandle) {
+ if (handle.isValid()) {
+ ControlPixmap pix;
+ if (orient == Qt::Horizontal)
+ pix = enabled ? (pressed ? SH_HPressed : SH_HEnabled) : SH_HDisabled;
+ else
+ pix = enabled ? (pressed ? SH_VPressed : SH_VEnabled) : SH_VDisabled;
+ painter->drawPixmap(handle, m_pixmaps.value(pix).pixmap);
+ }
+ }
+}
+
+void QPixmapStyle::drawComboBox(const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ const bool enabled = option->state & State_Enabled;
+ const bool pressed = widget->property("_pixmapstyle_combobox_pressed").toBool();
+ const bool opened = option->state & State_On;
+
+ ControlDescriptor control =
+ enabled ? (pressed ? DD_ButtonPressed : DD_ButtonEnabled) : DD_ButtonDisabled;
+ drawCachedPixmap(control, option->rect, painter);
+
+ ControlPixmap cp = enabled ? (opened ? DD_ArrowOpen
+ : (pressed ? DD_ArrowPressed : DD_ArrowEnabled))
+ : DD_ArrowDisabled;
+ Pixmap pix = m_pixmaps.value(cp);
+ QRect rect = comboBoxSubControlRect(option, SC_ComboBoxArrow, widget);
+ painter->drawPixmap(rect, pix.pixmap);
+}
+
+void QPixmapStyle::drawScrollBar(const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ if (const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider*>(option)) {
+ // Do not draw the scrollbar
+ if (slider->minimum == slider->maximum)
+ return;
+
+ QRect rect = scrollBarSubControlRect(option, SC_ScrollBarSlider, widget);
+ ControlDescriptor control = slider->orientation == Qt::Horizontal
+ ? SB_Horizontal : SB_Vertical;
+ drawCachedPixmap(control, rect, painter);
+ }
+}
+
+QSize QPixmapStyle::pushButtonSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize,
+ const QWidget *widget) const
+{
+ const Descriptor &desc = m_descriptors.value(PB_Enabled);
+ const int bm = proxy()->pixelMetric(PM_ButtonMargin, option, widget);
+
+ int w = contentsSize.width();
+ int h = contentsSize.height();
+ w += desc.margins.left() + desc.margins.right() + bm;
+ h += desc.margins.top() + desc.margins.bottom() + bm;
+
+ return computeSize(desc, w, h);
+}
+
+QSize QPixmapStyle::lineEditSizeFromContents(const QStyleOption *,
+ const QSize &contentsSize, const QWidget *) const
+{
+ const Descriptor &desc = m_descriptors.value(LE_Enabled);
+ const int border = 2 * proxy()->pixelMetric(PM_DefaultFrameWidth);
+
+ int w = contentsSize.width() + border + desc.margins.left() + desc.margins.right();
+ int h = contentsSize.height() + border + desc.margins.top() + desc.margins.bottom();
+
+ return computeSize(desc, w, h);
+}
+
+QSize QPixmapStyle::progressBarSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize,
+ const QWidget *widget) const
+{
+ bool vertical = false;
+ if (const QStyleOptionProgressBarV2 *pb2 =
+ qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
+ vertical = (pb2->orientation == Qt::Vertical);
+ }
+ QSize result = QCommonStyle::sizeFromContents(CT_Slider, option, contentsSize, widget);
+ if (vertical) {
+ const Descriptor desc = m_descriptors.value(PB_VBackground);
+ return QSize(desc.size.height(), result.height());
+ } else {
+ const Descriptor desc = m_descriptors.value(PB_HBackground);
+ return QSize(result.width(), desc.size.height());
+ }
+}
+
+QSize QPixmapStyle::sliderSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize,
+ const QWidget *widget) const
+{
+ const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option);
+ if (!slider)
+ return QSize();
+
+ QSize result = QCommonStyle::sizeFromContents(CT_Slider, option, contentsSize, widget);
+
+ const Descriptor desc = m_descriptors.value(slider->orientation == Qt::Horizontal
+ ? SG_HEnabled : SG_VEnabled);
+
+ if (slider->orientation == Qt::Horizontal)
+ return QSize(result.width(), desc.size.height());
+ else
+ return QSize(desc.size.width(), result.height());
+}
+
+QSize QPixmapStyle::comboBoxSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize,
+ const QWidget *widget) const
+{
+ const Descriptor &desc = m_descriptors.value(DD_ButtonEnabled);
+
+ QSize result = QCommonStyle::sizeFromContents(CT_ComboBox, option, contentsSize, widget);
+ return computeSize(desc, result.width(), result.height());
+}
+
+QSize QPixmapStyle::itemViewSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize,
+ const QWidget *widget) const
+{
+ QSize size = QCommonStyle::sizeFromContents(CT_ItemViewItem, option, contentsSize, widget);
+
+ ControlPixmap cp = ID_Separator;
+ ControlDescriptor cd = ID_Selected;
+ if (widget && widget->property("_pixmap_combobox_list").toBool()) {
+ cp = DD_ItemSeparator;
+ cd = DD_ItemSelected;
+ }
+
+ const Descriptor &desc = m_descriptors.value(cd);
+ const Pixmap &pix = m_pixmaps.value(cp);
+ size.setHeight(qMax(size.height(),
+ desc.size.height() + pix.pixmap.height()));
+ return size;
+}
+
+QRect QPixmapStyle::comboBoxSubControlRect(const QStyleOptionComplex *option,
+ QStyle::SubControl sc, const QWidget *) const
+{
+ QRect r = option->rect; // Default size
+ const Pixmap &pix = m_pixmaps.value(DD_ArrowEnabled);
+ const Descriptor &desc = m_descriptors.value(DD_ButtonEnabled);
+
+ switch (sc) {
+ case SC_ComboBoxArrow:
+ r.setRect(r.right() - pix.margins.right() - pix.pixmap.width(),
+ r.top() + pix.margins.top(),
+ pix.pixmap.width(), pix.pixmap.height());
+ break;
+ case SC_ComboBoxEditField:
+ r.adjust(desc.margins.left(), desc.margins.right(),
+ -desc.margins.right(), -desc.margins.bottom());
+ r.setRight(r.right() - pix.margins.right() - pix.margins.left() - pix.pixmap.width());
+ break;
+ default:
+ break;
+ }
+
+ r = visualRect(option->direction, option->rect, r);
+ return r;
+}
+
+QRect QPixmapStyle::scrollBarSubControlRect(const QStyleOptionComplex *option,
+ QStyle::SubControl sc, const QWidget *) const
+{
+ if (const QStyleOptionSlider *slider =
+ qstyleoption_cast<const QStyleOptionSlider*>(option)) {
+ int length = (slider->orientation == Qt::Horizontal)
+ ? slider->rect.width() : slider->rect.height();
+ int page = length * slider->pageStep
+ / (slider->maximum - slider->minimum + slider->pageStep);
+ int pos = length * slider->sliderValue
+ / (slider->maximum - slider->minimum + slider->pageStep);
+ pos = qMin(pos+page, length) - page;
+
+ QRect rect = slider->rect;
+
+ if (slider->orientation == Qt::Horizontal) {
+ switch (sc) {
+ case SC_ScrollBarAddPage:
+ rect.setLeft(pos+page);
+ return rect;
+ case SC_ScrollBarSubPage:
+ rect.setRight(pos);
+ return rect;
+ case SC_ScrollBarGroove:
+ return rect;
+ case SC_ScrollBarSlider:
+ rect.setLeft(pos);
+ rect.setRight(pos+page);
+ return rect;
+ default: ;
+ }
+ } else {
+ switch (sc) {
+ case SC_ScrollBarAddPage:
+ rect.setTop(pos+page);
+ return rect;
+ case SC_ScrollBarSubPage:
+ rect.setBottom(pos);
+ return rect;
+ case SC_ScrollBarGroove:
+ return rect;
+ case SC_ScrollBarSlider:
+ rect.setTop(pos);
+ rect.setBottom(pos+page);
+ return rect;
+ default: ;
+ }
+ }
+ }
+ return QRect();
+}
+
+static QPixmap scale(int w, int h, const QPixmap &pixmap, const QPixmapStyle::Descriptor &desc)
+{
+ QPixmap result(w, h);
+ {
+ const QColor transparent(0, 0, 0, 0);
+ result.fill( transparent );
+ QPainter p( &result );
+ const QMargins margins = desc.margins;
+ qDrawBorderPixmap(&p, result.rect(), margins, pixmap,
+ pixmap.rect(), margins, desc.tileRules);
+ }
+ return result;
+}
+
+QPixmap QPixmapStyle::getCachedPixmap(ControlDescriptor control, const Descriptor &desc,
+ const QSize &size) const
+{
+ const QString sizeString = QString::number(size.width()) % QLatin1Char('*')
+ % QString::number(size.height());
+ const QString key = QLatin1String(metaObject()->className()) % QString::number(control)
+ % QLatin1Char('@') % sizeString;
+
+ QPixmap result;
+
+ if (!QPixmapCache::find( key, &result)) {
+ QPixmap source(desc.fileName);
+ result = scale(size.width(), size.height(), source, desc);
+ QPixmapCache::insert(key, result);
+ }
+ return result;
+}
+
+QSize QPixmapStyle::computeSize(const QPixmapStyle::Descriptor &desc, int width, int height) const
+{
+ if (desc.tileRules.horizontal != Qt::RepeatTile)
+ width = qMax(width, desc.size.width());
+ if (desc.tileRules.vertical != Qt::RepeatTile)
+ height = qMax(height, desc.size.height());
+ return QSize(width, height);
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/styles/bb10style/qpixmapstyle.h b/src/plugins/styles/bb10style/qpixmapstyle.h
new file mode 100644
index 0000000000..d4a223aab8
--- /dev/null
+++ b/src/plugins/styles/bb10style/qpixmapstyle.h
@@ -0,0 +1,236 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPIXMAPSTYLE_H
+#define QPIXMAPSTYLE_H
+
+#include <QCommonStyle>
+#include <QString>
+#include <QPixmap>
+#include <QMargins>
+#include <QTileRules>
+#include <QHash>
+#include <QPainter>
+
+QT_BEGIN_NAMESPACE
+
+class QPixmapStyle : public QCommonStyle
+{
+ Q_OBJECT
+
+public:
+ struct Descriptor {
+ QString fileName;
+ QSize size;
+ QMargins margins;
+ QTileRules tileRules;
+ };
+
+ enum ControlDescriptor {
+ BG_Background=0,
+ LE_Enabled, // QLineEdit
+ LE_Disabled,
+ LE_Focused,
+ PB_Enabled, // QPushButton
+ PB_Pressed,
+ PB_PressedDisabled,
+ PB_Checked,
+ PB_Disabled,
+ TE_Enabled, // QTextEdit
+ TE_Disabled,
+ TE_Focused,
+ PB_HBackground, // Horizontal QProgressBar
+ PB_HContent,
+ PB_HComplete,
+ PB_VBackground, // Vertical QProgressBar
+ PB_VContent,
+ PB_VComplete,
+ SG_HEnabled, // Horizontal QSlider groove
+ SG_HDisabled,
+ SG_HActiveEnabled,
+ SG_HActivePressed,
+ SG_HActiveDisabled,
+ SG_VEnabled, // Vertical QSlider groove
+ SG_VDisabled,
+ SG_VActiveEnabled,
+ SG_VActivePressed,
+ SG_VActiveDisabled,
+ DD_ButtonEnabled, // QComboBox (DropDown)
+ DD_ButtonDisabled,
+ DD_ButtonPressed,
+ DD_PopupDown,
+ DD_PopupUp,
+ DD_ItemSelected,
+ ID_Selected, // QStyledItemDelegate
+ SB_Horizontal, // QScrollBar
+ SB_Vertical
+ };
+
+ struct Pixmap {
+ QPixmap pixmap;
+ QMargins margins;
+ };
+ enum ControlPixmap {
+ CB_Enabled, // QCheckBox
+ CB_Checked,
+ CB_Pressed,
+ CB_PressedChecked,
+ CB_Disabled,
+ CB_DisabledChecked,
+ RB_Enabled, // QRadioButton
+ RB_Checked,
+ RB_Pressed,
+ RB_Disabled,
+ RB_DisabledChecked,
+ SH_HEnabled, // Horizontal QSlider handle
+ SH_HDisabled,
+ SH_HPressed,
+ SH_VEnabled, // Vertical QSlider handle
+ SH_VDisabled,
+ SH_VPressed,
+ DD_ArrowEnabled, // QComboBox (DropDown) arrow
+ DD_ArrowDisabled,
+ DD_ArrowPressed,
+ DD_ArrowOpen,
+ DD_ItemSeparator,
+ ID_Separator // QStyledItemDelegate separator
+ };
+
+public:
+ QPixmapStyle();
+ ~QPixmapStyle();
+
+ void polish(QApplication *application);
+ void polish(QPalette &palette);
+ void polish(QWidget *widget);
+ void unpolish(QWidget *widget);
+
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget = 0) const;
+ void drawControl(ControlElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget = 0) const;
+ void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget=0) const;
+
+ QSize sizeFromContents(ContentsType type, const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget = 0) const;
+ QRect subElementRect(SubElement element, const QStyleOption *option,
+ const QWidget *widget = 0) const;
+ QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *option,
+ SubControl sc, const QWidget *widget = 0) const;
+
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
+ const QWidget *widget = 0) const;
+ int styleHint(StyleHint hint, const QStyleOption *option,
+ const QWidget *widget, QStyleHintReturn *returnData) const;
+ SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option,
+ const QPoint &pos, const QWidget *widget) const;
+
+ bool eventFilter(QObject *watched, QEvent *event);
+
+protected:
+ void addDescriptor(ControlDescriptor control, const QString &fileName,
+ QMargins margins = QMargins(),
+ QTileRules tileRules = QTileRules(Qt::RepeatTile, Qt::RepeatTile));
+ void copyDescriptor(ControlDescriptor source, ControlDescriptor dest);
+ void drawCachedPixmap(ControlDescriptor control, const QRect &rect, QPainter *p) const;
+
+ void addPixmap(ControlPixmap control, const QString &fileName,
+ QMargins margins = QMargins());
+ void copyPixmap(ControlPixmap source, ControlPixmap dest);
+
+ void drawPushButton(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawLineEdit(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawTextEdit(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawCheckBox(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawRadioButton(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawPanelItemViewItem(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawProgressBarBackground(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawProgressBarLabel(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawProgressBarFill(const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawSlider(const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawComboBox(const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const;
+ void drawScrollBar(const QStyleOptionComplex *option,
+ QPainter *painter, const QWidget *widget) const;
+
+ QSize pushButtonSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const;
+ QSize lineEditSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const;
+ QSize progressBarSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const;
+ QSize sliderSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const;
+ QSize comboBoxSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const;
+ QSize itemViewSizeFromContents(const QStyleOption *option,
+ const QSize &contentsSize, const QWidget *widget) const;
+
+ QRect comboBoxSubControlRect(const QStyleOptionComplex *option,
+ SubControl sc, const QWidget *widget) const;
+ QRect scrollBarSubControlRect(const QStyleOptionComplex *option,
+ SubControl sc, const QWidget *widget) const;
+
+private:
+ QPixmap getCachedPixmap(ControlDescriptor control,
+ const Descriptor &desc, const QSize &size) const;
+
+ QSize computeSize(const Descriptor &desc, int width, int height) const;
+
+private:
+ QHash<ControlDescriptor, Descriptor> m_descriptors;
+ QHash<ControlPixmap, Pixmap> m_pixmaps;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPIXMAPSTYLE_H