11import QtQuick
2- import QtQuick.Controls
3- import QtQuick.Window
42
53import ComponentLibrary
64import QmlMobileScanner
@@ -12,10 +10,10 @@ Rectangle {
1210 anchors .bottom : parent .bottom
1311
1412 z: 10
15- width: isHdpi ? 72 : 80
13+ width: isHdpi ? 220 : 240
1614 color: Theme .colorSidebar
1715
18- // //////////////////////////////////////////////////////////////////////////
16+ // //////////
1917
2018 DragHandler {
2119 // Drag on the sidebar to drag the whole window // Qt 5.15+
@@ -24,101 +22,102 @@ Rectangle {
2422 target: null
2523 }
2624
27- // //////////////////////////////////////////////////////////////////////////
25+ // //////////
2826
29- // MENUS up
30-
31- Column {
27+ Column { // top menu
3228 anchors .top : parent .top
33- anchors .topMargin : 20
29+ anchors .topMargin : 16
3430 anchors .left : parent .left
35- anchors .leftMargin : 0
31+ anchors .leftMargin : 12
3632 anchors .right : parent .right
37- anchors .rightMargin : 0
38-
39- spacing: 0
33+ anchors .rightMargin : 12
34+ spacing: 8
4035
41- DesktopSidebarItem {
36+ DesktopSidebarMenu {
37+ text: qsTr (" Scanner" )
4238 source: " qrc:/IconLibrary/material-icons/duotone/qr_code_scanner.svg"
43- sourceSize: 40
44-
45- highlightMode: " background"
46- highlighted: (appContent .state === " ScreenBarcodeReader" )
47-
48- indicatorVisible: false
49- indicatorSource: " qrc:/IconLibrary/material-symbols/media/camera.svg"
39+ checked: (appContent .state === " ScreenBarcodeReader" )
5040
5141 onClicked: screenBarcodeReader .loadScreen ()
5242 }
53- DesktopSidebarItem {
43+ DesktopSidebarMenu {
44+ text: qsTr (" Generator" )
5445 source: " qrc:/IconLibrary/material-icons/duotone/qr_code_2.svg"
55- sourceSize: 40
56-
57- highlightMode: " background"
58- highlighted: (appContent .state === " ScreenBarcodeWriter" )
46+ checked: (appContent .state === " ScreenBarcodeWriter" )
5947
6048 onClicked: screenBarcodeWriter .loadScreen ()
6149 }
62- DesktopSidebarItem {
50+ DesktopSidebarMenu {
51+ text: qsTr (" Barcode history" )
6352 source: " qrc:/IconLibrary/material-icons/duotone/list.svg"
64- sourceSize: 40
65-
66- highlightMode: " background"
67- highlighted: (appContent .state === " ScreenBarcodeHistory" )
53+ checked: (appContent .state === " ScreenBarcodeHistory" )
6854
6955 onClicked: screenBarcodeHistory .loadScreen ()
7056 }
7157 }
7258
73- // MENUS down
59+ // //////////
7460
75- Column {
61+ Column { // bottom menu
7662 anchors .left : parent .left
77- anchors .leftMargin : 0
63+ anchors .leftMargin : 12
7864 anchors .right : parent .right
79- anchors .rightMargin : 0
65+ anchors .rightMargin : 12
8066 anchors .bottom : parent .bottom
81- anchors .bottomMargin : 20
82-
83- spacing: 0
67+ anchors .bottomMargin : 16
68+ spacing: 8
8469
85- DesktopSidebarItem {
70+ DesktopSidebarMenu {
71+ text: qsTr (" Settings" )
8672 source: " qrc:/IconLibrary/material-icons/duotone/tune.svg"
87- sourceSize: 40
88-
89- highlightMode: (Theme .sidebarSelector ) ? " indicator" : " background"
90- highlighted: appContent .state === " ScreenSettings"
73+ checked: (appContent .state === " ScreenSettings" )
9174
9275 onClicked: screenSettings .loadScreen ()
9376 }
94- DesktopSidebarItem {
95- source: " qrc:/IconLibrary/material-icons/duotone/info.svg"
96- sourceSize: 40
9777
98- highlightMode: (Theme .sidebarSelector ) ? " indicator" : " background"
99- highlighted: (appContent .state === " ScreenAbout" ||
100- appContent .state === " ScreenAboutFormats" ||
101- appContent .state === " ScreenAboutPermissions" )
78+ DesktopSidebarMenu {
79+ text: qsTr (" About" )
80+ source: " qrc:/IconLibrary/material-icons/duotone/info.svg"
81+ checked: (appContent .state === " ScreenAbout" ||
82+ appContent .state === " ScreenAboutFormats" ||
83+ appContent .state === " ScreenAboutPermissions" )
10284
10385 onClicked: screenAbout .loadScreen ()
10486 }
105- DesktopSidebarItem {
87+
88+ DesktopSidebarMenu {
89+ text: qsTr (" Exit" )
10690 source: " qrc:/IconLibrary/material-icons/duotone/exit_to_app.svg"
107- sourceSize: 40
108- highlightMode: " circle"
109- onClicked: appWindow .close ()
91+ onClicked: Qt .quit ()
11092 }
11193 }
11294
113- //
95+ // //////////
11496
115- Rectangle {
97+ Rectangle { // border
11698 anchors .top : parent .top
11799 anchors .right : parent .right
118100 anchors .bottom : parent .bottom
101+
119102 width: 2
120- color: Theme .colorSidebarHighlight
103+ opacity: 1.0
104+ color: Theme .colorSeparator
105+ }
106+
107+ Rectangle { // fake shadow
108+ anchors .top : parent .top
109+ anchors .left : parent .right
110+ anchors .bottom : parent .bottom
111+
112+ width: 8
113+ opacity: 0.333
114+
115+ gradient: Gradient {
116+ orientation: Gradient .Horizontal
117+ GradientStop { position: 0.0 ; color: Theme .colorSeparator ; }
118+ GradientStop { position: 1.0 ; color: " transparent" ; }
119+ }
121120 }
122121
123- // //////////////////////////////////////////////////////////////////////////
122+ // //////////
124123}
0 commit comments