mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
implement keyboard control for fluent widget
This commit is contained in:
parent
b884a4ca19
commit
103b069dde
1 changed files with 9 additions and 1 deletions
|
@ -163,7 +163,15 @@ export SpinBox := FocusScope {
|
|||
: has-focus ? Palette.themeSecondary
|
||||
: Palette.neutralDark;
|
||||
}
|
||||
|
||||
|
||||
key-pressed(event) => {
|
||||
if (enabled && event.text == Keys.UpArrow && value < maximum) {
|
||||
value += 1;
|
||||
} else if (enabled && event.text == Keys.DownArrow && value > minimum) {
|
||||
value -= 1;
|
||||
}
|
||||
accept
|
||||
}
|
||||
}
|
||||
|
||||
export Slider := Rectangle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue