waffles: ctrl alt del menu

This commit is contained in:
end-4
2025-12-06 23:14:08 +01:00
parent 80a7804ade
commit 13968db31c
29 changed files with 578 additions and 90 deletions
@@ -0,0 +1,54 @@
pragma ComponentBehavior: Bound
import QtQuick
import qs
import qs.modules.waffle.looks
WTextButton {
id: root
implicitWidth: 135
implicitHeight: 40
horizontalPadding: 5
property bool keyboardDown: false
property alias focusRingRadius: focusRing.radius
Keys.onPressed: event => {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
keyboardDown = true;
event.accepted = true;
}
}
Keys.onReleased: event => {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
keyboardDown = false;
root.clicked();
event.accepted = true;
}
}
contentItem: Item {
id: contentItem
implicitWidth: buttonText.implicitWidth
WText {
id: buttonText
anchors.fill: parent
color: (root.pressed || root.keyboardDown) ? Looks.colors.fg1 : Looks.colors.fg
text: root.text
font.pixelSize: Looks.font.pixelSize.large
}
}
Rectangle {
id: focusRing
visible: root.focus
anchors {
fill: parent
margins: -4
}
color: "transparent"
border.width: 2
border.color: "#ffffff"
}
}