From 112e61e92dda4f3a848a0a831898341ab16552d5 Mon Sep 17 00:00:00 2001 From: jaby Date: Mon, 27 Jan 2025 20:57:23 +0000 Subject: [PATCH] Support about tab --- src/Tools/tim_tool/ui/about-tab.slint | 10 ++++++++++ src/Tools/tim_tool/ui/app-window.slint | 13 +++++++++---- src/Tools/tim_tool/ui/main-tab.slint | 18 +++++++++++++++++- src/Tools/tim_tool/ui/vram-components.slint | 1 + 4 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 src/Tools/tim_tool/ui/about-tab.slint diff --git a/src/Tools/tim_tool/ui/about-tab.slint b/src/Tools/tim_tool/ui/about-tab.slint new file mode 100644 index 00000000..039aeb1a --- /dev/null +++ b/src/Tools/tim_tool/ui/about-tab.slint @@ -0,0 +1,10 @@ +import { AboutSlint } from "std-widgets.slint"; +export component AboutTab { + VerticalLayout { + AboutSlint {} + Text { + x: 8pt; + text: "TIM_Tool Version 0.1.0"; + } + } +} \ No newline at end of file diff --git a/src/Tools/tim_tool/ui/app-window.slint b/src/Tools/tim_tool/ui/app-window.slint index de85ffaf..892e3803 100644 --- a/src/Tools/tim_tool/ui/app-window.slint +++ b/src/Tools/tim_tool/ui/app-window.slint @@ -1,5 +1,6 @@ -import { MainTab } from "./main-tab.slint"; -import { FileTab } from "./file-tab.slint"; +import { AboutTab } from "./about-tab.slint"; +import { FileTab } from "./file-tab.slint"; +import { MainTab } from "./main-tab.slint"; import { TabWidget } from "std-widgets.slint"; export component MainWindow inherits Window { @@ -14,18 +15,22 @@ export component MainWindow inherits Window { current-index: 1; Tab { - title: "File Bah"; + title: "File"; FileTab { x: 0px; y: 0px; } } - test := Tab { + Tab { title: "VRAM Layout"; tab := MainTab { x: 0px; y: 0px; } } + Tab { + title: "About"; + AboutTab {} + } } } \ No newline at end of file diff --git a/src/Tools/tim_tool/ui/main-tab.slint b/src/Tools/tim_tool/ui/main-tab.slint index 63eabee1..07fc348f 100644 --- a/src/Tools/tim_tool/ui/main-tab.slint +++ b/src/Tools/tim_tool/ui/main-tab.slint @@ -1,5 +1,5 @@ import { VRAMArea } from "./vram-components.slint"; -import { GroupBox } from "std-widgets.slint"; +import { GroupBox, StandardListView } from "std-widgets.slint"; export component MainTab inherits Rectangle { width: group.width + group.x*2; @@ -32,6 +32,22 @@ export component MainTab inherits Rectangle { img_y: 80; }*/ } + HorizontalLayout { + GroupBox { + title: "Added Files"; + StandardListView { + width: background_image.width/2; + height: 128px; + model: [ { text: "Blue"}, { text: "Red" }, { text: "Green" }, + { text: "Yellow" }, { text: "Black"}, { text: "White"}, + { text: "Magenta" }, { text: "Cyan" }, + ]; + } + } + GroupBox { + title: "Current File"; + } + } } } } \ No newline at end of file diff --git a/src/Tools/tim_tool/ui/vram-components.slint b/src/Tools/tim_tool/ui/vram-components.slint index 216a91de..b7b869df 100644 --- a/src/Tools/tim_tool/ui/vram-components.slint +++ b/src/Tools/tim_tool/ui/vram-components.slint @@ -1,3 +1,4 @@ +// TODO: Maybe make them inherit Windows...? component VRAMSegment inherits Rectangle { in property img; in property clip_x;