mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-02 21:03:00 +00:00
49 lines
1.5 KiB
Text
49 lines
1.5 KiB
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
|
|
|
|
// cSpell: ignore Heade
|
|
|
|
import { ScrollView, Button, HorizontalBox } from "std-widgets.slint";
|
|
import { HeaderBar } from "header-bar.slint";
|
|
import { Spinner } from "spinner.slint";
|
|
|
|
export component PreviewUi inherits Window {
|
|
in property<component-factory> preview-area <=> i-preview-area-container.component-factory;
|
|
callback design-mode-changed(/* enabled */ bool);
|
|
|
|
in property <bool> is-busy;
|
|
|
|
min-width: min(i-scroll-view.viewport-width, 100px);
|
|
min-height: min(i-scroll-view.viewport-height, 100px);
|
|
|
|
VerticalLayout {
|
|
HeaderBar {
|
|
i-pick-button := Button {
|
|
icon: self.checked ? @image-url("assets/colorize-light.svg") :
|
|
@image-url("assets/colorize.svg");
|
|
checkable: true;
|
|
|
|
clicked => {
|
|
root.design-mode-changed(self.checked);
|
|
}
|
|
}
|
|
|
|
if (root.is-busy) : Spinner {}
|
|
}
|
|
|
|
HorizontalLayout {
|
|
padding: 1px;
|
|
|
|
i-scroll-view := ScrollView {
|
|
// viewport-width: i-preview-area-container.width;
|
|
// viewport-height: i-preview-area-container.height;
|
|
|
|
HorizontalBox {
|
|
Rectangle {
|
|
i-preview-area-container := ComponentContainer { }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|