Add custom theme

This commit is contained in:
Agel committed 2026-04-14 20:52:07 +02:00
1 parent 598566c2a4
commit 96b7838a4b
9 files changed
+636 -31

No files matched your search

+11
View File
@@ -98,6 +98,17 @@ Rectangle {
onClicked: ThemeManager.setLightTheme()
}
SideBarButton {
iconText: "\ue40a"
title: "Custom Theme"
rightIconText: "\ue3c9"
onClicked: ThemeManager.setCustomTheme()
onRightIconClicked: {
ThemeManager.setCustomTheme()
sidebar.navigateTo("customTheme")
}
}
// Divider
Rectangle {
width: parent.width
+40 -2
View File
@@ -10,11 +10,16 @@ Rectangle {
property string iconText: ""
property string title: ""
property string rightIconText: ""
signal clicked()
signal rightIconClicked()
Row {
anchors.fill: parent
anchors.left: parent.left
anchors.leftMargin: 16
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: 16
Text {
@@ -33,9 +38,42 @@ Rectangle {
}
}
// Optional right icon zone — zero-width when unused
Rectangle {
id: rightIconZone
visible: root.rightIconText !== ""
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: visible ? 44 : 0
color: "transparent"
Text {
anchors.centerIn: parent
text: root.rightIconText
font.family: "Material Icons Outlined"
font.pixelSize: 18
color: rightIconArea.containsMouse
? Qt.lighter(ThemeManager.currentTheme.sidebarButtonText, 1.3)
: ThemeManager.currentTheme.sidebarButtonText
}
MouseArea {
id: rightIconArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.rightIconClicked()
}
}
// Main click area stops before the right icon zone
MouseArea {
id: mouseArea
anchors.fill: parent
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width - rightIconZone.width
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()