mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-01 08:07:23 +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.
28 lines
No EOL
735 B
Text
28 lines
No EOL
735 B
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { Theme } from "../theme.slint";
|
|
import { StateLayer } from "../components/state_layer.slint";
|
|
|
|
export component FloatButton {
|
|
in property <image> icon <=> i-icon.source;
|
|
in property <bool> enabled <=> i-state-layer.enabled;
|
|
|
|
callback clicked <=> i-state-layer.clicked;
|
|
|
|
min_width: 50px;
|
|
min_height: 50px;
|
|
|
|
i-container := Rectangle {
|
|
background: Theme.palette.heliotrope-gradient;
|
|
border-radius: max(self.width, self.height) / 2;
|
|
|
|
i-icon := Image {
|
|
colorize: Theme.palette.white;
|
|
}
|
|
}
|
|
|
|
i-state-layer := StateLayer {
|
|
border-radius: i-container.border-radius;
|
|
}
|
|
} |