Begin implmenting keyboard power states

This commit is contained in:
Luke D. Jones
2024-03-09 21:00:16 +13:00
parent efcad3f6f9
commit ca41bd59de
17 changed files with 1224 additions and 473 deletions

View File

@@ -4,11 +4,13 @@
import { StyleMetrics } from "std-widgets.slint";
component SideBarItem inherits Rectangle {
padding: 10px;
in property <bool> selected;
in property <bool> has-focus;
in-out property <string> text<=> label.text;
callback clicked<=>touch.clicked;
min-height: self.visible ? l.preferred-height : 0px;
min-height: self.visible ? l.preferred-height + 10px : 0px;
// min-width: self.visible ? l.preferred-width + 10px : 0px;
states [
pressed when touch.pressed: {
state.opacity: 0.8;
@@ -30,6 +32,7 @@ component SideBarItem inherits Rectangle {
background: StyleMetrics.window-background;
animate opacity { duration: 150ms; }
animate border-width { duration: 150ms; }
height: l.preferred-height;
}
l := HorizontalLayout {
@@ -102,7 +105,7 @@ export component SideBar inherits Rectangle {
}
navigation := VerticalLayout {
spacing: 10px;
// spacing: 10px;
alignment: start;
vertical-stretch: 0;
for item[index] in root.model: SideBarItem {