style: handle keyboard focus

This commit is contained in:
outfoxxed 2025-01-07 20:25:36 -08:00
parent 56e611961a
commit c63f0e7c9b
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
2 changed files with 21 additions and 1 deletions

View file

@ -63,5 +63,15 @@ T.Button {
const base = HyprlandStyle.flat(HyprlandStyle.lightenOrDarken(control.palette.button, 1.4), control.flat);
return HyprlandStyle.overlay(base, control.palette.highlight, highlightTint);
}
Rectangle {
anchors.fill: parent
anchors.margins: -1
radius: parent.radius + 1
color: "transparent"
MotionBehavior on border.color { ColorAnimation { duration: 60 } }
border.color: control.visualFocus ? Qt.alpha(control.palette.highlight, 0.8) : "transparent"
}
}
}

View file

@ -30,7 +30,7 @@ T.CheckBox {
implicitHeight: 16
x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: Math.round(control.topPadding + (control.availableHeight - height) / 2)
y: Math.floor(control.topPadding + (control.availableHeight - height) / 2)
radius: {
switch (HyprlandStyle.roundness) {
@ -65,5 +65,15 @@ T.CheckBox {
checkState: control.checkState
color: control.palette.buttonText
}
Rectangle {
anchors.fill: parent
anchors.margins: -1
radius: parent.radius + 1
color: "transparent"
MotionBehavior on border.color { ColorAnimation { duration: 60 } }
border.color: control.visualFocus ? Qt.alpha(control.palette.highlight, 0.8) : "transparent"
}
}
}