mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-02 01:23:23 +00:00
First commit
This commit is contained in:
commit
dd0c8c326a
16 changed files with 534 additions and 0 deletions
34
ToggleButton.slint
Normal file
34
ToggleButton.slint
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { Palette } from "Palette.slint";
|
||||
import { VText } from "Text.slint";
|
||||
|
||||
export component ToggleButton inherits Rectangle {
|
||||
|
||||
in property text <=> text-component.text;
|
||||
in property text-color <=> text-component.color;
|
||||
in property text-alignment <=> text-component.horizontal-alignment;
|
||||
in property<bool> active: false;
|
||||
callback clicked;
|
||||
|
||||
|
||||
background: root.active ? Palette.control-background
|
||||
: ta.has-hover ? Palette.control-background.transparentize(0.5)
|
||||
: Colors.transparent;
|
||||
border-radius: 4px;
|
||||
|
||||
ta := TouchArea {
|
||||
mouse-cursor: pointer;
|
||||
clicked => {
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
|
||||
VerticalLayout {
|
||||
padding: 8px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
text-component := VText {
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue