diff options
-rw-r--r-- | examples/quickcontrols2/gallery/gallery.cpp | 3 | ||||
-rw-r--r-- | examples/quickcontrols2/gallery/gallery.pro | 3 | ||||
-rw-r--r-- | examples/quickcontrols2/gallery/gallery.qml | 16 | ||||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20/+material/back.png (renamed from examples/quickcontrols2/gallery/images/+material/back.png) | bin | 219 -> 219 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20/+material/drawer.png (renamed from examples/quickcontrols2/gallery/images/+material/drawer.png) | bin | 213 -> 213 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20/+material/menu.png (renamed from examples/quickcontrols2/gallery/images/+material/menu.png) | bin | 232 -> 232 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20/back.png (renamed from examples/quickcontrols2/gallery/images/back.png) | bin | 220 -> 220 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer.png) | bin | 123 -> 123 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png (renamed from examples/quickcontrols2/gallery/images/menu.png) | bin | 123 -> 123 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/back.png (renamed from examples/quickcontrols2/gallery/images/+material/back@2x.png) | bin | 299 -> 299 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/drawer.png (renamed from examples/quickcontrols2/gallery/images/+material/drawer@2x.png) | bin | 286 -> 286 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/menu.png (renamed from examples/quickcontrols2/gallery/images/+material/menu@2x.png) | bin | 366 -> 366 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png (renamed from examples/quickcontrols2/gallery/images/back@2x.png) | bin | 289 -> 289 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer@2x.png) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png (renamed from examples/quickcontrols2/gallery/images/menu@2x.png) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/back.png (renamed from examples/quickcontrols2/gallery/images/+material/back@3x.png) | bin | 344 -> 344 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/drawer.png (renamed from examples/quickcontrols2/gallery/images/+material/drawer@3x.png) | bin | 345 -> 345 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/menu.png (renamed from examples/quickcontrols2/gallery/images/+material/menu@3x.png) | bin | 499 -> 499 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png (renamed from examples/quickcontrols2/gallery/images/back@3x.png) | bin | 351 -> 351 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer@3x.png) | bin | 130 -> 130 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png (renamed from examples/quickcontrols2/gallery/images/menu@3x.png) | bin | 193 -> 193 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/back.png (renamed from examples/quickcontrols2/gallery/images/+material/back@4x.png) | bin | 473 -> 473 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/drawer.png (renamed from examples/quickcontrols2/gallery/images/+material/drawer@4x.png) | bin | 420 -> 420 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/menu.png (renamed from examples/quickcontrols2/gallery/images/+material/menu@4x.png) | bin | 642 -> 642 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png (renamed from examples/quickcontrols2/gallery/images/back@4x.png) | bin | 452 -> 452 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer@4x.png) | bin | 131 -> 131 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png (renamed from examples/quickcontrols2/gallery/images/menu@4x.png) | bin | 223 -> 223 bytes | |||
-rw-r--r-- | examples/quickcontrols2/gallery/icons/gallery/index.theme | 24 |
28 files changed, 32 insertions, 14 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.cpp b/examples/quickcontrols2/gallery/gallery.cpp index 7b70f1c8..b4d59685 100644 --- a/examples/quickcontrols2/gallery/gallery.cpp +++ b/examples/quickcontrols2/gallery/gallery.cpp @@ -53,6 +53,7 @@ #include <QQmlContext> #include <QSettings> #include <QQuickStyle> +#include <QIcon> int main(int argc, char *argv[]) { @@ -62,6 +63,8 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); + QIcon::setThemeName("gallery"); + QSettings settings; QString style = QQuickStyle::name(); if (!style.isEmpty()) diff --git a/examples/quickcontrols2/gallery/gallery.pro b/examples/quickcontrols2/gallery/gallery.pro index 45496a35..705eeae0 100644 --- a/examples/quickcontrols2/gallery/gallery.pro +++ b/examples/quickcontrols2/gallery/gallery.pro @@ -8,8 +8,9 @@ SOURCES += \ RESOURCES += \ gallery.qml \ qtquickcontrols2.conf \ + icons/gallery/index.theme \ + $$files(icons/*.png, true) \ $$files(images/*.png) \ - $$files(images/+material/*.png) \ $$files(pages/*.qml) target.path = $$[QT_INSTALL_EXAMPLES]/quickcontrols2/gallery diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index 9f253ab3..5344b74e 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -50,7 +50,7 @@ import QtQuick 2.9 import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.2 +import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.1 import QtQuick.Controls.Universal 2.1 import Qt.labs.settings 1.0 @@ -89,12 +89,7 @@ ApplicationWindow { anchors.fill: parent ToolButton { - contentItem: Image { - fillMode: Image.Pad - horizontalAlignment: Image.AlignHCenter - verticalAlignment: Image.AlignVCenter - source: stackView.depth > 1 ? "images/back.png" : "images/drawer.png" - } + icon.name: stackView.depth > 1 ? "back" : "drawer" onClicked: { if (stackView.depth > 1) { stackView.pop() @@ -116,12 +111,7 @@ ApplicationWindow { } ToolButton { - contentItem: Image { - fillMode: Image.Pad - horizontalAlignment: Image.AlignHCenter - verticalAlignment: Image.AlignVCenter - source: "images/menu.png" - } + icon.name: "menu" onClicked: optionsMenu.open() Menu { diff --git a/examples/quickcontrols2/gallery/images/+material/back.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/+material/back.png Binary files differindex ebc1000f..ebc1000f 100644 --- a/examples/quickcontrols2/gallery/images/+material/back.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/+material/back.png diff --git a/examples/quickcontrols2/gallery/images/+material/drawer.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/+material/drawer.png Binary files differindex 615cc817..615cc817 100644 --- a/examples/quickcontrols2/gallery/images/+material/drawer.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/+material/drawer.png diff --git a/examples/quickcontrols2/gallery/images/+material/menu.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/+material/menu.png Binary files differindex f02429e9..f02429e9 100644 --- a/examples/quickcontrols2/gallery/images/+material/menu.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/+material/menu.png diff --git a/examples/quickcontrols2/gallery/images/back.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/back.png Binary files differindex db43e273..db43e273 100644 --- a/examples/quickcontrols2/gallery/images/back.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png Binary files differindex 1e974efa..1e974efa 100644 --- a/examples/quickcontrols2/gallery/images/drawer.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png Binary files differindex a10473d9..a10473d9 100644 --- a/examples/quickcontrols2/gallery/images/menu.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png diff --git a/examples/quickcontrols2/gallery/images/+material/back@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/back.png Binary files differindex cf6163c8..cf6163c8 100644 --- a/examples/quickcontrols2/gallery/images/+material/back@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/back.png diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/drawer.png Binary files differindex b1dd106d..b1dd106d 100644 --- a/examples/quickcontrols2/gallery/images/+material/drawer@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/drawer.png diff --git a/examples/quickcontrols2/gallery/images/+material/menu@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/menu.png Binary files differindex 9309ad9a..9309ad9a 100644 --- a/examples/quickcontrols2/gallery/images/+material/menu@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/+material/menu.png diff --git a/examples/quickcontrols2/gallery/images/back@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png Binary files differindex c55ab315..c55ab315 100644 --- a/examples/quickcontrols2/gallery/images/back@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png Binary files differindex eba3b6cc..eba3b6cc 100644 --- a/examples/quickcontrols2/gallery/images/drawer@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png Binary files differindex 649c2a08..649c2a08 100644 --- a/examples/quickcontrols2/gallery/images/menu@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png diff --git a/examples/quickcontrols2/gallery/images/+material/back@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/back.png Binary files differindex 96376a5a..96376a5a 100644 --- a/examples/quickcontrols2/gallery/images/+material/back@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/back.png diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/drawer.png Binary files differindex 289889bf..289889bf 100644 --- a/examples/quickcontrols2/gallery/images/+material/drawer@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/drawer.png diff --git a/examples/quickcontrols2/gallery/images/+material/menu@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/menu.png Binary files differindex 7bddf71f..7bddf71f 100644 --- a/examples/quickcontrols2/gallery/images/+material/menu@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/+material/menu.png diff --git a/examples/quickcontrols2/gallery/images/back@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png Binary files differindex b228eb87..b228eb87 100644 --- a/examples/quickcontrols2/gallery/images/back@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png Binary files differindex 3584ed6d..3584ed6d 100644 --- a/examples/quickcontrols2/gallery/images/drawer@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png Binary files differindex 9554b695..9554b695 100644 --- a/examples/quickcontrols2/gallery/images/menu@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png diff --git a/examples/quickcontrols2/gallery/images/+material/back@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/back.png Binary files differindex 578ac14f..578ac14f 100644 --- a/examples/quickcontrols2/gallery/images/+material/back@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/back.png diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/drawer.png Binary files differindex 215e6a82..215e6a82 100644 --- a/examples/quickcontrols2/gallery/images/+material/drawer@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/drawer.png diff --git a/examples/quickcontrols2/gallery/images/+material/menu@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/menu.png Binary files differindex e5c23a3b..e5c23a3b 100644 --- a/examples/quickcontrols2/gallery/images/+material/menu@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/+material/menu.png diff --git a/examples/quickcontrols2/gallery/images/back@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png Binary files differindex dd157e78..dd157e78 100644 --- a/examples/quickcontrols2/gallery/images/back@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png Binary files differindex 60d93aff..60d93aff 100644 --- a/examples/quickcontrols2/gallery/images/drawer@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png Binary files differindex 187c171c..187c171c 100644 --- a/examples/quickcontrols2/gallery/images/menu@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png diff --git a/examples/quickcontrols2/gallery/icons/gallery/index.theme b/examples/quickcontrols2/gallery/icons/gallery/index.theme new file mode 100644 index 00000000..a1bcd5e0 --- /dev/null +++ b/examples/quickcontrols2/gallery/icons/gallery/index.theme @@ -0,0 +1,24 @@ +[Icon Theme] +Name=Gallery +Comment=Qt Quick Controls 2 Gallery Example Icon Theme + +Directories=20x20,20x20@2,20x20@3,20x20@4 + +[20x20] +Size=20 +Type=Fixed + +[20x20@2] +Size=20 +Scale=2 +Type=Fixed + +[20x20@3] +Size=20 +Scale=3 +Type=Fixed + +[20x20@4] +Size=20 +Scale=4 +Type=Fixed |