welcome screen centered

This commit is contained in:
aOK 2023-12-12 16:26:54 +03:00
parent 92776105b3
commit b7b73490c5
3 changed files with 11 additions and 13 deletions

View file

@ -18,7 +18,7 @@ cargo run --profile=small
# Android # Android
cargo makepad android run --release cargo makepad android run --release
cargo makepad android run -p simplestacknavigation --release
# IOS Simulator # IOS Simulator
cargo makepad apple ios --org=my.test --app=makepad-template run-sim --release cargo makepad apple ios --org=my.test --app=makepad-template run-sim --release

View file

@ -38,6 +38,10 @@ live_design!{
App = {{App}} { App = {{App}} {
ui: <Window>{ ui: <Window>{
window: {
position: vec2(0, 0),
// inner_size: vec2(360, 800)
},
show_bg: true show_bg: true
width: Fill, width: Fill,
height: Fill height: Fill
@ -148,13 +152,5 @@ impl AppMain for App{
&actions, &actions,
&self.navigation_destinations &self.navigation_destinations
); );
if self.ui.button(id!(button1)).clicked(&actions) {
log!("BUTTON CLICKED {}", self.counter);
self.counter += 1;
let label = self.ui.label(id!(label1));
label.set_text_and_redraw(cx,&format!("Counter: {}", self.counter));
}
} }
} }

View file

@ -49,11 +49,12 @@ live_design! {
height: Fill height: Fill
show_bg: false show_bg: false
// align:{ x: 0.5 } // align:{ x: 0.5 }
align: {x: 0.5, y: 0.5}
container = <RoundedView> { container = <RoundedView> {
width: Fit width: 360
height: Fill height: 400
// flow: Down // flow: Down
align: {x: 0.5, y: 0.0} align: {x: 0.5, y: 0.5}
// margin: {left: 200.0, right: 200.0, top: 100.0, bottom: 100.0} // margin: {left: 200.0, right: 200.0, top: 100.0, bottom: 100.0}
spacing: 2.0 spacing: 2.0
draw_bg: { draw_bg: {
@ -65,7 +66,8 @@ live_design! {
<View> { <View> {
width: Fit, height: Fill width: Fit, height: Fill
flow: Down, flow: Down,
align: {x: 0, y: 0.5}, padding: {top: 5., left: 10., right: 10.}, spacing: 20. align: {x: 0, y: 0.5},
padding: {top: 5., left: 10., right: 10.}, spacing: 20.
username = <Label> { username = <Label> {
// padding: {top: 50., left: 140.} // padding: {top: 50., left: 140.}
draw_text:{ draw_text:{