mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-24 01:02:38 +00:00
These are showing off use-cases for Slint, but they're not examples showing individual Slint features. Also removed the old printerdemo while at it.
38 lines
980 B
Text
38 lines
980 B
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { Theme } from "../theme.slint";
|
|
|
|
export component RadioButton {
|
|
in property <bool> checked;
|
|
|
|
callback clicked <=> i-touch-area.clicked;
|
|
|
|
states [
|
|
checked when checked : {
|
|
i-container.border-color: Theme.palette.lemon-green;
|
|
i-indicator.background: Theme.palette.lemon-green;
|
|
}
|
|
]
|
|
|
|
min-height: 18px;
|
|
width: self.height;
|
|
|
|
i-container := Rectangle {
|
|
border-color: Theme.palette.slint-blue-300;
|
|
border-width: 2px;
|
|
border-radius: self.height / 2;
|
|
|
|
animate border-color { duration: Theme.durations.fast; }
|
|
|
|
i-indicator := Rectangle {
|
|
height: parent.height - 4 * parent.border-width;
|
|
width: self.height;
|
|
border-radius: self.height / 2;
|
|
|
|
animate background { duration: Theme.durations.fast; }
|
|
}
|
|
}
|
|
|
|
i-touch-area := TouchArea {}
|
|
}
|