mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-26 13:24:08 +00:00

* [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
44 lines
1.1 KiB
Text
44 lines
1.1 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { Palette, VerticalBox } from "std-widgets.slint";
|
|
import { UsecasesPalette } from "styling.slint";
|
|
|
|
export component StateContainer inherits Rectangle {
|
|
callback clicked <=> touch-area.clicked;
|
|
|
|
in property <bool> checked;
|
|
|
|
background: Palette.alternate-background;
|
|
border-radius: 8px;
|
|
|
|
touch-area := TouchArea {}
|
|
|
|
state-layer := Rectangle {
|
|
border-radius: root.border-radius;
|
|
|
|
states [
|
|
pressed when touch-area.pressed : {
|
|
state-layer.background: UsecasesPalette.state-pressed;
|
|
}
|
|
hover when touch-area.has-hover : {
|
|
state-layer.background: UsecasesPalette.state-hover;
|
|
}
|
|
checked when root.checked : {
|
|
state-layer.background: UsecasesPalette.state-selected;
|
|
}
|
|
]
|
|
}
|
|
|
|
@children
|
|
}
|
|
|
|
export component Container inherits Rectangle {
|
|
background: Palette.alternate-background;
|
|
border-radius: 8px;
|
|
border-width: 1px;
|
|
|
|
VerticalBox {
|
|
@children
|
|
}
|
|
}
|