Fix up Menu

This commit is contained in:
Yuri Becker
2025-03-25 12:28:30 +01:00
parent 445c183e71
commit 309f1f58d7
8 changed files with 217 additions and 296 deletions

View File

@@ -10,40 +10,43 @@ T.ToolButton {
icon.color: Colors.foreground
icon.height: 36
icon.width: 36
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding)
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
implicitHeight: 90
implicitWidth: 100
topPadding: 20
background: Rectangle {
id: mainrect
border.color: control.palette.highlight
border.width: control.visualFocus ? 2 : 0
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0)
implicitHeight: control.height
implicitWidth: control.width
visible: !control.flat || control.down || control.checked || control.highlighted
x: control.left
y: control.top
Rectangle {
color: "yellow"
implicitHeight: control.height
implicitWidth: 6
x: mainrect.left
y: mainrect.top
}
}
contentItem: Column {
readonly property color color: control.checked ? Colors.primaryShade : control.hovered ? Colors.primary : Colors.foreground
IconLabel {
icon: control.icon
icon.color: parent.color
icon.source: control.icon.source
icon.height: control.icon.height
icon.width: control.icon.width
color: parent.color
x: parent.width * .5 - width * .5
}
Label {
color: Colors.foreground
font: Typography.dash
font: Typography.small
color: parent.color
text: control.text
x: parent.width * .5 - width * .5
}
}
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: control.checked ? Colors.primaryShade : Colors.primary
implicitWidth: 6
visible: control.checked || control.hovered
}
MouseArea {
id: mouseArea
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onPressed: mouse => mouse.accepted = false
}
}