Sketch-out VRAM-Area
This commit is contained in:
@@ -1,19 +1,38 @@
|
||||
import { Button, VerticalBox } from "std-widgets.slint";
|
||||
component VRAMSegment inherits Rectangle {
|
||||
in property <int> area_overlap_width;
|
||||
in property <int> area_overlap_height;
|
||||
|
||||
export component AppWindow inherits Window {
|
||||
in-out property <int> counter: 42;
|
||||
callback request-increase-value();
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: "Counter: \{root.counter}";
|
||||
}
|
||||
width: 64px;
|
||||
height: 256px;
|
||||
background: #37f560;
|
||||
|
||||
Button {
|
||||
checked: false;
|
||||
text: "Increase value";
|
||||
clicked => {
|
||||
root.request-increase-value();
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: 0px;
|
||||
y: 0px;
|
||||
width: area_overlap_width > 64 ? 64px : area_overlap_width*1px;
|
||||
height: area_overlap_height > 256 ? 256px : area_overlap_height*1px;
|
||||
background: #d7e609;
|
||||
}
|
||||
}
|
||||
|
||||
component VRAMArea inherits Rectangle {
|
||||
in property <int> display_area_width;
|
||||
in property <int> display_area_height;
|
||||
|
||||
for idx in 16 : VRAMSegment {
|
||||
x: mod(idx,8)*(64+1)*1px;
|
||||
y: floor(idx/8)*(256+1)*1px;
|
||||
|
||||
area_overlap_width: parent.display_area_width - (mod(idx,8)*64);
|
||||
area_overlap_height: parent.display_area_height - (256*floor(idx/8));
|
||||
}
|
||||
}
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
VRAMArea {
|
||||
x: 0;
|
||||
y: 0;
|
||||
display_area_width: 32+64+3;
|
||||
display_area_height: 256+128;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user