Remove standard elements
This commit is contained in:
parent
89229c6e3b
commit
f7ae70b901
|
@ -1,7 +1,16 @@
|
||||||
import { VRAMArea } from "../vram-components.slint";
|
import { VRAMArea } from "../vram-components.slint";
|
||||||
import { Button, ComboBox, GroupBox, StandardListView } from "std-widgets.slint";
|
import { Button, ComboBox, GroupBox, StandardListView } from "std-widgets.slint";
|
||||||
|
|
||||||
|
struct VRAMImage {
|
||||||
|
img: image,
|
||||||
|
x: int,
|
||||||
|
y: int,
|
||||||
|
}
|
||||||
|
|
||||||
export component MainTab inherits Rectangle {
|
export component MainTab inherits Rectangle {
|
||||||
|
in property <[StandardListViewItem]> vram_file_list: [];
|
||||||
|
in property <[VRAMImage]> vram_images: [];
|
||||||
|
|
||||||
width: group.width + group.x*2;
|
width: group.width + group.x*2;
|
||||||
height: group.height + group.y*2 + 32px;
|
height: group.height + group.y*2 + 32px;
|
||||||
|
|
||||||
|
@ -12,26 +21,26 @@ export component MainTab inherits Rectangle {
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
background_rect := Rectangle {
|
background_rect := Rectangle {
|
||||||
width: background_image.width + 8px;
|
width: background_image.width + root.get_border_width()*2px;
|
||||||
height: background_image.height + 8px;
|
height: background_image.height + root.get_border_width()*2px;
|
||||||
border-width: 4px;
|
border-width: root.get_border_width()*1px;
|
||||||
border-color: #404040;
|
border-color: #404040;
|
||||||
background: #A0A0A0;
|
background: #A0A0A0;
|
||||||
background_image := VRAMArea {
|
background_image := VRAMArea {
|
||||||
x: 4px;
|
x: root.get_border_width()*1px;
|
||||||
y: 4px;
|
y: root.get_border_width()*1px;
|
||||||
img: @image-url("../../../../../examples/PoolBox/assets/AllTheJaby.png");
|
img: @image-url("../../../../../examples/PoolBox/assets/AllTheJaby.png");
|
||||||
img_x: 0;
|
img_x: 0;
|
||||||
img_y: 0;
|
img_y: 0;
|
||||||
}
|
}
|
||||||
// Extend these from input some how
|
|
||||||
/*VRAMArea {
|
for vram_image[i] in root.vram_images: VRAMArea {
|
||||||
x: 4px;
|
x: root.get_border_width()*1px;
|
||||||
y: 4px;
|
y: root.get_border_width()*1px;
|
||||||
img: @image-url("../../../../examples/PoolBox/assets/IMG_6921.png");
|
img: vram-image.img;
|
||||||
img_x: 80;
|
img_x: vram-image.x;
|
||||||
img_y: 80;
|
img_y: vram-image.y;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
@ -43,10 +52,8 @@ export component MainTab inherits Rectangle {
|
||||||
StandardListView {
|
StandardListView {
|
||||||
width: background_image.width/2;
|
width: background_image.width/2;
|
||||||
height: 128px;
|
height: 128px;
|
||||||
model: [ { text: "Blue"}, { text: "Red" }, { text: "Green" },
|
|
||||||
{ text: "Yellow" }, { text: "Black"}, { text: "White"},
|
model: root.vram_file_list;
|
||||||
{ text: "Magenta" }, { text: "Cyan" },
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
@ -77,4 +84,8 @@ export component MainTab inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_border_width() -> int {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue