session menu

This commit is contained in:
end-4
2025-04-21 21:14:01 +02:00
parent dfc0a53a5f
commit 99b9de9d5c
7 changed files with 381 additions and 10 deletions
@@ -0,0 +1,65 @@
import "root:/modules/common"
import "root:/modules/common/widgets/"
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
Button {
id: button
property string buttonIcon
property string buttonText
property bool keyboardDown: false
implicitHeight: 120
implicitWidth: 120
PointingHandInteraction {}
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
keyboardDown = true
button.clicked()
event.accepted = true;
}
}
Keys.onReleased: (event) => {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
keyboardDown = false
event.accepted = true;
}
}
onClicked: {
console.log("Button clicked:", buttonText)
}
background: Rectangle {
anchors.fill: parent
radius: Appearance.rounding.full
color: (button.down || button.keyboardDown) ? Appearance.colors.colLayer2Active : ((button.hovered || button.focus) ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2)
Behavior on color {
ColorAnimation {
duration: Appearance.animation.elementDecel.duration
easing.type: Appearance.animation.elementDecel.type
}
}
}
contentItem: MaterialSymbol {
id: icon
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
text: buttonIcon
font.pixelSize: 40
}
StyledToolTip {
content: buttonText
}
}