mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-29 03:02:06 +00:00
45 lines
1.7 KiB
Text
45 lines
1.7 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
import { Group, GroupHeader } from "../components/group.slint";
|
|
import { ExpandableListView } from "../components/expandable-listview.slint";
|
|
import { Icons, EditorSizeSettings, ConsoleStyles, EditorSpaceSettings } from "../components/styling.slint";
|
|
import { Api, ComponentListItem, ComponentItem, DiagnosticSummary } from "../api.slint";
|
|
import { ViewHeader } from "../components/widgets/basics.slint";
|
|
import { IconButton } from "../components/icon-button.slint";
|
|
import { Palette, LineEdit } from "std-widgets.slint";
|
|
|
|
export component LibraryView {
|
|
in property <[ComponentListItem]> known-components <=> component-list-view.known-components;
|
|
|
|
in property <bool> preview-area-is-current <=> component-list-view.preview-is-current;
|
|
|
|
in-out property <ComponentItem> visible-component <=> component-list-view.visible-component;
|
|
|
|
in-out property <bool> library-visible: false;
|
|
|
|
callback show-preview-for <=> component-list-view.show-preview-for;
|
|
|
|
width: EditorSizeSettings.side-bar-width;
|
|
min-height: side-bar.min-height;
|
|
side-bar := Group {
|
|
width: 100%;
|
|
height: 100%;
|
|
opacity: root.preview-area-is-current ? 1 : 0.3;
|
|
|
|
ViewHeader {
|
|
header-text: @tr("Library");
|
|
hide-parent() => {
|
|
root.library-visible = false;
|
|
Api.library-search("");
|
|
}
|
|
search-edited(text) => {
|
|
Api.library-search(text);
|
|
}
|
|
}
|
|
|
|
component-list-view := ExpandableListView {
|
|
vertical-stretch: 1;
|
|
}
|
|
}
|
|
}
|