summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2025-11-06 15:00:54 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2025-12-02 09:32:56 +0000
commit0ed42f0fca999622b9b6b8971855dab655fe4832 (patch)
treeac8b8052934765eebc4ef508a96ff0a6ee220987
parent7c3417bbb9ee3fca2f0771a73bb4fa92518e9f39 (diff)
Add quit button
Add button in settings to quit the application. Useful when using launcher in fullscreen to get back into desktop. Quit icon from iconpacks.net, no license restrictions. Change-Id: I5afe35523068fddd579b456f106fb4a864f55cc6 Reviewed-by: Ari Parkkila <ari.parkkila@qt.io>
-rw-r--r--QtLauncher/CMakeLists.txt1
-rw-r--r--QtLauncher/Header.qml15
-rw-r--r--QtLauncher/icons/quit_icon.svg7
3 files changed, 23 insertions, 0 deletions
diff --git a/QtLauncher/CMakeLists.txt b/QtLauncher/CMakeLists.txt
index a2f4871..a97aa75 100644
--- a/QtLauncher/CMakeLists.txt
+++ b/QtLauncher/CMakeLists.txt
@@ -52,6 +52,7 @@ set(icons
"icons/settings_icon.svg"
"icons/grid_icon.svg"
"icons/touch_icon.svg"
+ "icons/quit_icon.svg"
)
add_subdirectory(QtImageProviders)
diff --git a/QtLauncher/Header.qml b/QtLauncher/Header.qml
index 64150df..adea718 100644
--- a/QtLauncher/Header.qml
+++ b/QtLauncher/Header.qml
@@ -143,6 +143,21 @@ Item {
height: parent.height
color: "white"
}
+
+ SettingsButton {
+ id: quit
+ source: "icons/quit_icon.svg"
+
+ onClicked: {
+ Qt.quit()
+ }
+ }
+
+ Rectangle {
+ width: 2
+ height: parent.height
+ color: "white"
+ }
}
}
diff --git a/QtLauncher/icons/quit_icon.svg b/QtLauncher/icons/quit_icon.svg
new file mode 100644
index 0000000..968cc18
--- /dev/null
+++ b/QtLauncher/icons/quit_icon.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
+<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
+ <path d="M 69.313 54.442 c -0.397 0 -0.798 -0.118 -1.147 -0.363 c -0.904 -0.636 -1.122 -1.883 -0.487 -2.786 l 10.118 -14.399 L 67.679 22.495 c -0.635 -0.904 -0.417 -2.151 0.487 -2.786 c 0.904 -0.637 2.151 -0.417 2.786 0.486 l 10.926 15.549 c 0.484 0.69 0.484 1.61 0 2.3 L 70.952 53.592 C 70.563 54.146 69.943 54.442 69.313 54.442 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
+ <path d="M 57.693 30.092 c 1.104 0 2 -0.896 2 -2 V 2 c 0 -1.104 -0.896 -2 -2 -2 H 9.759 C 9.746 0 9.735 0.003 9.722 0.004 C 9.685 0.004 9.648 0.012 9.611 0.015 c -0.122 0.009 -0.24 0.027 -0.354 0.057 C 9.211 0.083 9.168 0.098 9.124 0.113 C 9.011 0.151 8.903 0.198 8.8 0.255 C 8.775 0.269 8.747 0.274 8.723 0.289 c -0.012 0.007 -0.02 0.018 -0.031 0.025 c -0.13 0.083 -0.252 0.177 -0.36 0.287 C 8.313 0.62 8.299 0.643 8.281 0.662 C 8.196 0.757 8.12 0.859 8.053 0.969 C 8.029 1.009 8.008 1.05 7.987 1.091 C 7.935 1.192 7.893 1.297 7.858 1.407 C 7.845 1.449 7.83 1.489 7.82 1.532 C 7.783 1.683 7.759 1.838 7.759 2 v 69.787 c 0 0.17 0.028 0.333 0.068 0.49 c 0.011 0.043 0.025 0.083 0.039 0.124 c 0.04 0.123 0.091 0.239 0.152 0.35 c 0.019 0.033 0.034 0.068 0.054 0.1 c 0.086 0.135 0.185 0.26 0.3 0.371 c 0.022 0.021 0.047 0.037 0.07 0.058 c 0.102 0.09 0.214 0.169 0.333 0.237 c 0.021 0.012 0.037 0.03 0.058 0.042 l 31.016 16.213 C 40.139 89.925 40.457 90 40.775 90 c 0.359 0 0.718 -0.097 1.036 -0.289 c 0.598 -0.362 0.964 -1.012 0.964 -1.711 V 73.787 h 14.918 c 1.104 0 2 -0.896 2 -2 V 45 c 0 -1.104 -0.896 -2 -2 -2 s -2 0.896 -2 2 v 24.787 H 42.775 V 18.213 c 0 -0.745 -0.414 -1.428 -1.074 -1.772 L 17.902 4 h 37.791 v 24.092 C 55.693 29.196 56.589 30.092 57.693 30.092 z M 38.775 84.698 L 11.759 70.576 V 5.302 l 27.016 14.122 V 84.698 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
+ <path d="M 80.241 38.894 H 47.536 c -1.104 0 -2 -0.896 -2 -2 s 0.896 -2 2 -2 h 32.705 c 1.104 0 2 0.896 2 2 S 81.346 38.894 80.241 38.894 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
+</g>
+</svg> \ No newline at end of file