Skip to content

Commit

Permalink
Work on the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Nov 16, 2024
1 parent 788f5d4 commit d20b237
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
26 changes: 14 additions & 12 deletions qml/DesktopSidebar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Rectangle {
anchors.bottom: parent.bottom

z: 10
width: isHdpi ? 220 : 240
width: isHdpi ? 220 : 256
color: Theme.colorSidebar

////////////
Expand Down Expand Up @@ -40,32 +40,34 @@ Rectangle {
spacing: 6

DesktopSidebarMenu {
text: "Desktop"
text: qsTr("Desktop")
source: "qrc:/assets/icons/material-symbols/hardware/computer.svg"
checked: (appContent.state === "DesktopComponents")

onClicked: screenDesktopComponents.loadScreen()
}
DesktopSidebarMenu {
text: "Mobile"
text: qsTr("Mobile")
source: "qrc:/assets/icons/material-symbols/hardware/smartphone-fill.svg"
checked: (appContent.state === "MobileComponents")

onClicked: screenMobileComponents.loadScreen()
}
DesktopSidebarSubMenu {
text: "Tools"
source: "qrc:/assets/icons/material-icons/duotone/touch_app.svg"
text: qsTr("Tools")
source: "qrc:/assets/icons/material-symbols/build-fill.svg"

checked: (appContent.state === "Playground" ||
appContent.state === "HostInfos" ||
appContent.state === "FontInfos")
onClicked: screenPlayground.loadScreen()

submenus: [
{ text: "playground", onClicked: function() { screenPlayground.loadScreen() } },
{ text: "host", onClicked: function() { screenHostInfos.loadScreen() } },
{ text: "fonts", onClicked: function() { screenFontInfos.loadScreen() } }
{ text: qsTr("Playground"), onClicked: function() { screenPlayground.loadScreen() } },
{ text: qsTr("Host info"), onClicked: function() { screenHostInfos.loadScreen() } },
{ text: qsTr("Fonts info"), onClicked: function() { screenFontInfos.loadScreen() } }
]

onClicked: screenPlayground.loadScreen()
}
}

Expand All @@ -81,23 +83,23 @@ Rectangle {
spacing: 6

DesktopSidebarMenu {
text: "Settings"
text: qsTr("Settings")
source: "qrc:/assets/icons/material-icons/duotone/tune.svg"
checked: (appContent.state === "Settings")

onClicked: screenSettings.loadScreen()
}

DesktopSidebarMenu {
text: "Settings"
text: qsTr("About")
source: "qrc:/assets/icons/material-icons/duotone/info.svg"
checked: (appContent.state === "About")

onClicked: screenAbout.loadScreen()
}

DesktopSidebarMenu {
text: "Exit"
text: qsTr("Exit")
source: "qrc:/assets/icons/material-icons/duotone/exit_to_app.svg"
onClicked: Qt.quit()
}
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/ComponentLibrary/menus/DesktopSidebarMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ButtonImpl {
text: sidebarMenu.text
font.bold: checked

source: "qrc:/assets/icons/material-symbols/hardware/smartphone-fill.svg"
source: "qrc:/assets/icons/material-symbols/menu.svg"
sourceSize: 20

property color color: checked ? Theme.colorPrimary : Theme.colorSidebarContent
Expand Down
6 changes: 4 additions & 2 deletions thirdparty/ComponentLibrary/menus/DesktopSidebarSubMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Column {

DesktopSidebarMenu {
text: sidebarSubMenu.text
source: sidebarSubMenu.source
checked: sidebarSubMenu.checked
onClicked: sidebarSubMenu.clicked()
}
Expand All @@ -45,8 +46,9 @@ Column {
font.bold: checked
//visible: sidebarSubMenu.checked

source: "qrc:/assets/icons/material-symbols/arrow_right.svg"
sourceSize: 20
source: checked ? "qrc:/assets/icons/material-symbols/circle-fill.svg"
: "qrc:/assets/icons/material-symbols/circle.svg"
sourceSize: 12

checked: sidebarSubMenu.checked && sidebarSubMenu.selected === index
onClicked: {
Expand Down

0 comments on commit d20b237

Please sign in to comment.