Use common StackView

This commit is contained in:
Yuri Becker
2025-04-03 13:06:37 +02:00
parent f172468ba6
commit 3083406b1b
35 changed files with 131 additions and 277 deletions

View File

@@ -6,6 +6,8 @@ import QtQuick.Templates as T
T.ToolButton {
id: control
property string target
checkable: true
icon.color: Colors.foreground
icon.height: 36
@@ -18,16 +20,16 @@ T.ToolButton {
readonly property color color: control.checked ? Colors.primaryShade : control.hovered ? Colors.primary : Colors.foreground
IconLabel {
icon.color: parent.color
icon.source: control.icon.source
icon.height: control.icon.height
icon.width: control.icon.width
color: parent.color
icon.color: parent.color
icon.height: control.icon.height
icon.source: control.icon.source
icon.width: control.icon.width
x: parent.width * .5 - width * .5
}
Label {
font: Typography.small
color: parent.color
font: Typography.small
text: control.text
x: parent.width * .5 - width * .5
}
@@ -49,4 +51,12 @@ T.ToolButton {
onPressed: mouse => mouse.accepted = false
}
onClicked: {
if(!target) {
console.warn(`BarButton with text ${this.text} has no target.`)
return
}
contentStack.replace(target)
}
}