mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-27 22:04:08 +00:00

* [autofix.ci] apply automated fixes * Update demos/usecases/esp-idf/README.md Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev> * Update demos/usecases/esp-idf/rust-toolchain.toml Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
26 lines
644 B
Text
26 lines
644 B
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { Palette } from "std-widgets.slint";
|
|
import { StateContainer } from "container.slint";
|
|
|
|
export component IconButton {
|
|
callback clicked <=> state-container.clicked;
|
|
|
|
in property <image> icon <=> icon.source;
|
|
|
|
width: self.height;
|
|
min-height: 32px;
|
|
|
|
vertical-stretch: 0;
|
|
horizontal-stretch: 0;
|
|
|
|
state-container := StateContainer {
|
|
background: transparent;
|
|
border-radius: max(self.width, self.height) / 2;
|
|
icon := Image {
|
|
height: 16px;
|
|
colorize: Palette.foreground;
|
|
}
|
|
}
|
|
}
|