import { Frame, FrameTitle, RibStrip, ShallowPanel, InsetPanel, ListFrame, SubheaderFrame, TabbedPaneFrame, Panel } from "../../../src/view/widgets/frame.slint";
import { Pieces } from "../../../src/view/widgets/pieces.slint";
import { Nine, Label, Theme } from "../../../src/view/widgets/base.slint";
import { Button } from "../../../src/view/widgets/button.slint";
import { ToolButton } from "../../../src/view/widgets/tool-button.slint";
import { TableHeader, TableRow, EmptyList, SortArrow } from "../../../src/view/widgets/table.slint";
import { InfoTable } from "../../../src/view/widgets/info-table.slint";
import { Link, DependencyLine } from "../../../src/view/widgets/link.slint";
import { ThumbnailFrame } from "../../../src/view/widgets/thumbnail.slint";
import { SearchField, TextField } from "../../../src/view/widgets/text-field.slint";
import { Dropdown } from "../../../src/view/widgets/dropdown.slint";
import { FilterHeading, FilterRow, BanToggle, FilterColumn } from "../../../src/view/widgets/filter.slint";
import { Scrollbar } from "../../../src/view/widgets/scrollbar.slint";
import { ErrorBanner } from "../../../src/view/widgets/banner.slint";
export component StateCase inherits Window {
in property <string> widget: "button";
in property <string> state: "default";
in property <string> kind: "grey";
in property <string> text: "Changelog";
in property <string> icon-name: "search";
in property <bool> enabled: true;
in property <bool> focused: false;
in property <bool> caret: false;
in property <bool> open: false;
in property <bool> excluded: false;
in property <int> px: 4; in property <int> py: 4;
in property <int> ww: 108; in property <int> hh: 28;
background: root.widget == "field" ? #403f40 : #242324;
if root.widget == "search": SubheaderFrame { x: 0px; y: 0px; width: 400px; height: 36px; }
if root.widget == "button" && root.state == "hovered" && root.kind == "grey": Frame { x: -100px; y: -100px; width: 400px; height: 100px; }
if root.widget == "button": Button { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: root.hh * 1px; text: root.text; kind: root.kind; state: root.state; enabled: root.enabled; }
if root.widget == "tool": ToolButton { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: root.hh * 1px; icon: root.icon-name; kind: root.kind; state: root.state; enabled: root.enabled; }
if root.widget == "search": SearchField { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: 28px; text: root.text; focused: root.focused; caret: root.caret; }
if root.widget == "link": Link { x: root.px * 1px; y: root.py * 1px; text: root.text; }
if root.widget == "panel": Panel { x: 4px; y: 4px; width: root.ww * 1px; height: root.hh * 1px; }
if root.widget == "sort": SortArrow { x: 4px; y: 4px; ascending: true; }
if root.widget == "dependency": DependencyLine { x: 4px; y: 4px; height: 28px; text: root.text; underline: true; }
if root.widget == "filters": FilterColumn { x: 4px; y: 4px; width: 160px; items:[{heading:true,text:"Categories",count:"",checked:false,excluded:false,expansion:false},{heading:false,text:"Content",count:"0",checked:true,excluded:false,expansion:false},{heading:false,text:"Internal",count:"0",checked:false,excluded:true,expansion:false}]; }
if root.widget == "field": TextField { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: 28px; text: root.text; focused: root.focused; }
if root.widget == "dropdown": Dropdown { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: 28px; items:["Relevance","Downloads","Recently updated","Trending"]; open: root.open; state: root.state; }
if root.widget == "row": TableRow { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: 28px; text: root.text; version: "0.7.0"; state: root.state; }
if root.widget == "header": Nine { x: (root.px - 4) * 1px; y: -104px; width: (root.ww + 8) * 1px; height: 308px; source: Pieces.mod-thumbnail-image-default-base; }
if root.widget == "header": TableHeader { x: root.px * 1px; y: root.py * 1px; width: root.ww * 1px; height: 28px; check-state: root.state; }
if root.widget == "ban": BanToggle { x: root.px * 1px; y: root.py * 1px; width: 16px; height: 16px; state: root.state; excluded: root.excluded; }
if root.widget == "scroll": Scrollbar { x: root.px * 1px; y: root.py * 1px; width: 12px; height: root.hh * 1px; thumb-height: 60px; state: root.state; }
if root.widget == "header": TableRow { x: root.px * 1px; y: (root.py + 28) * 1px; width: root.ww * 1px; height: 28px; state: "default"; }
if root.widget == "row" || root.widget == "header": Nine { x: root.px * 1px; y: -100px; width: root.ww * 1px; height: 300px; source: Pieces.scroll-pane-default-shadow; }
}