slint/demos/energy-monitor/ui/widgets/menu_button.slint
Simon Hausmann a98d4709be Move printer demo and energy-monitor into new top-level demos/ folder
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.
2024-10-25 12:09:32 +02:00

31 lines
No EOL
785 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 MenuButton {
callback clicked <=> i-state-layer.clicked;
min-width: 100px;
min-height: 32px;
opacity: root.visible ? 1.0 : 0.0;
animate opacity { duration: Theme.durations.fast; }
i-container := Rectangle {
background: Theme.palette.heliotrope-gradient;
border-radius: root.height / 2;
Rectangle {
width: 55px;
height: 5px;
background: Theme.palette.white;
border-radius: 3px;
}
}
i-state-layer := StateLayer {
border-radius: i-container.border-radius;
}
}