slint/internal/compiler/widgets/fluent-base/progressindicator.slint
Florian Blasius 6da8120dfa
added palette global (#3984)
* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>


---------

Co-authored-by: Florian Blasius <florian.blasius@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
Co-authored-by: Florian Blasius <flovansl@fedora.fritz.box>
2023-12-11 14:44:05 +00:00

33 lines
1,009 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
import { FluentPalette } from "styling.slint";
export component ProgressIndicator {
in property <float> progress;
in property <bool> indeterminate;
min-height: 3px;
horizontal-stretch: 1;
vertical-stretch: 0;
accessible-role: none;
accessible-value: root.progress;
Rectangle {
clip: true;
i-rail := Rectangle {
height: 1px;
background: FluentPalette.border;
border-radius: 1px;
}
i-track := Rectangle {
width: !root.indeterminate ? parent.width * min(1, max(0, root.progress)) : parent.width;
height: 100%;
x: !root.indeterminate ? 0px : -parent.width + (parent.width * mod(animation-tick(), 2s) / 1s);
border-radius: 3px;
background: FluentPalette.accent-background;
}
}
}