Remove standard elements

This commit is contained in:
jaby 2025-02-02 21:12:37 +00:00
parent 89229c6e3b
commit f7ae70b901
1 changed files with 28 additions and 17 deletions

View File

@ -1,7 +1,16 @@
import { VRAMArea } from "../vram-components.slint";
import { Button, ComboBox, GroupBox, StandardListView } from "std-widgets.slint";
struct VRAMImage {
img: image,
x: int,
y: int,
}
export component MainTab inherits Rectangle {
in property <[StandardListViewItem]> vram_file_list: [];
in property <[VRAMImage]> vram_images: [];
width: group.width + group.x*2;
height: group.height + group.y*2 + 32px;
@ -12,26 +21,26 @@ export component MainTab inherits Rectangle {
VerticalLayout {
background_rect := Rectangle {
width: background_image.width + 8px;
height: background_image.height + 8px;
border-width: 4px;
width: background_image.width + root.get_border_width()*2px;
height: background_image.height + root.get_border_width()*2px;
border-width: root.get_border_width()*1px;
border-color: #404040;
background: #A0A0A0;
background_image := VRAMArea {
x: 4px;
y: 4px;
x: root.get_border_width()*1px;
y: root.get_border_width()*1px;
img: @image-url("../../../../../examples/PoolBox/assets/AllTheJaby.png");
img_x: 0;
img_y: 0;
}
// Extend these from input some how
/*VRAMArea {
x: 4px;
y: 4px;
img: @image-url("../../../../examples/PoolBox/assets/IMG_6921.png");
img_x: 80;
img_y: 80;
}*/
for vram_image[i] in root.vram_images: VRAMArea {
x: root.get_border_width()*1px;
y: root.get_border_width()*1px;
img: vram-image.img;
img_x: vram-image.x;
img_y: vram-image.y;
}
}
HorizontalLayout {
padding: 4px;
@ -43,10 +52,8 @@ export component MainTab inherits Rectangle {
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" },
];
model: root.vram_file_list;
}
HorizontalLayout {
padding: 4px;
@ -77,4 +84,8 @@ export component MainTab inherits Rectangle {
}
}
}
function get_border_width() -> int {
return 4;
}
}