Add padding to GUI to align it to the screen
This commit is contained in:
parent
f7fbe366f6
commit
3b88ae8316
|
|
@ -1,40 +1,50 @@
|
||||||
import { Button, VerticalBox, LineEdit, GridBox } from "std-widgets.slint";
|
import { Button, VerticalBox, LineEdit, GridBox } from "std-widgets.slint";
|
||||||
|
|
||||||
export component AppWindow inherits Window {
|
export component AppWindow inherits Window {
|
||||||
y: 0px;
|
|
||||||
in-out property <int> counter: 42;
|
|
||||||
default-font-family: "IBM Plex Sans";
|
default-font-family: "IBM Plex Sans";
|
||||||
default-font-size: 16pt;
|
default-font-size: 16pt;
|
||||||
|
height: 368px;
|
||||||
|
width: 960px;
|
||||||
|
in-out property <int> counter: 42;
|
||||||
callback request-increase-value();
|
callback request-increase-value();
|
||||||
GridBox {
|
VerticalBox {
|
||||||
height: 240px;
|
|
||||||
padding: 0px;
|
|
||||||
padding-top: 8px;
|
|
||||||
width: 960px;
|
width: 960px;
|
||||||
VerticalBox {
|
height: 368px;
|
||||||
Text {
|
padding: 0px;
|
||||||
text: "Counter: \{root.counter}";
|
// These off-by-one values might be caused by incorrect timings.
|
||||||
}
|
padding-top: 121px;
|
||||||
|
padding-bottom: 7px;
|
||||||
|
Rectangle {
|
||||||
|
background: #2c82ff;
|
||||||
|
border-color: #ffcf00;
|
||||||
|
border-width: 1px;
|
||||||
|
GridBox {
|
||||||
|
VerticalBox {
|
||||||
|
Text {
|
||||||
|
text: "Counter: \{root.counter}";
|
||||||
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Increase value";
|
text: "Increase value";
|
||||||
clicked => {
|
clicked => {
|
||||||
root.request-increase-value();
|
root.request-increase-value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LineEdit {
|
||||||
|
input-type: InputType.password;
|
||||||
|
text: "LineEdit";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Button";
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Button";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LineEdit {
|
|
||||||
input-type: InputType.password;
|
|
||||||
text: "LineEdit";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
text: "Button";
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
text: "Button";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue