slint/demos/usecases/ui/widgets/icon_button.slint
FloVanGH d3c56e1f1f
added usecases demo (#7603)
* [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>
2025-02-12 08:59:33 +00:00

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;
}
}
}