File tree 3 files changed +21
-20
lines changed
3 files changed +21
-20
lines changed Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
- slint_build:: compile ( "ui/appwindow.slint" ) . unwrap ( ) ;
2
+ let config = slint_build:: CompilerConfiguration :: new ( ) . with_style ( "fluent" . into ( ) ) ;
3
+ slint_build:: compile_with_config ( "ui/appwindow.slint" , config) . unwrap ( ) ;
3
4
}
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ fn main() -> Result<(), slint::PlatformError> {
22
22
set_config ( config) ;
23
23
let app = ui_handle. unwrap ( ) ;
24
24
if get_config ( ) . enabled {
25
- app. set_state ( "Stop " . into ( ) )
25
+ app. set_state ( "🚫 " . into ( ) )
26
26
} else {
27
- app. set_state ( "Start " . into ( ) )
27
+ app. set_state ( "🚀 " . into ( ) )
28
28
}
29
29
}
30
30
} ) ;
@@ -49,7 +49,6 @@ fn main() -> Result<(), slint::PlatformError> {
49
49
str_seconds = "0" . to_owned ( ) + & * str_seconds
50
50
}
51
51
52
- println ! ( "{:?}" , time_seconds) ;
53
52
slint:: invoke_from_event_loop ( move || {
54
53
ui. unwrap ( )
55
54
. set_time ( ( str_minutes. to_string ( ) + ":" + & * str_seconds) . into ( ) )
@@ -67,7 +66,6 @@ fn main() -> Result<(), slint::PlatformError> {
67
66
if str_seconds. len ( ) < 2 {
68
67
str_seconds = "0" . to_owned ( ) + & * str_seconds
69
68
}
70
- println ! ( "{:?}" , time_seconds) ;
71
69
slint:: invoke_from_event_loop ( move || {
72
70
ui. unwrap ( )
73
71
. set_time ( ( str_minutes. to_string ( ) + ":" + & * str_seconds) . into ( ) )
Original file line number Diff line number Diff line change 1
- import { Button , VerticalBox } from "std-widgets.slint" ;
1
+ import { Button } from "std-widgets.slint" ;
2
2
import "./assets/font.ttf" ;
3
3
4
4
export component AppWindow inherits Window {
5
5
width : 300px ;
6
6
height : 400px ;
7
7
in-out property <string > time : "25:00" ;
8
- in-out property <string > state : "Start " ;
8
+ in-out property <string > state : "🚀 " ;
9
9
callback start-timer ();
10
- // VerticalLayout {
11
- Text {
12
- text : time;
13
- font-size : 70px ;
14
- // y: 0px;
15
- font-family : "Bebas Neue" ;
16
- }
17
- Button {
18
- text : state;
19
- y : 250px ;
20
- clicked => {start-timer()}
21
- }
10
+ title : "Timer" ;
11
+ Text {
12
+ text : time;
13
+ font-size : 70px ;
14
+ y : 150px ;
15
+ font-family : "Bebas Neue" ;
22
16
}
23
- //}
24
17
18
+ Button {
19
+ text : state;
20
+ y : 250px ;
21
+ width : 100px ;
22
+ clicked => {
23
+ start-timer()
24
+ }
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments