1
+ use include_gif:: include_gif;
1
2
use ledger_device_sdk:: io;
2
3
use ledger_device_sdk:: ui:: {
3
- bagls, gadgets,
4
- layout:: { self , Draw , StringPlace } ,
4
+ bagls,
5
+ bitmaps:: { Glyph , DASHBOARD_X } ,
6
+ gadgets,
7
+ layout:: Draw ,
5
8
screen_util,
6
9
} ;
7
10
use ledger_secure_sdk_sys:: buttons:: ButtonEvent ;
@@ -26,47 +29,32 @@ fn show_ui_common(draw: fn() -> ()) {
26
29
27
30
fn show_ui_welcome ( ) {
28
31
show_ui_common ( || {
29
- let mut lines = [
30
- bagls:: Label :: from_const ( "Alephium" ) ,
31
- bagls:: Label :: from_const ( "ready" ) ,
32
- ] ;
33
- lines[ 0 ] . bold = true ;
34
- lines. place ( layout:: Location :: Middle , layout:: Layout :: Centered , false ) ;
32
+ const APP_ICON : Glyph = Glyph :: from_include ( include_gif ! ( "alph_14x14.gif" ) ) ;
33
+ gadgets:: Page :: from ( ( [ "Alephium " , "is ready" ] , & APP_ICON ) ) . place ( ) ;
35
34
} ) ;
36
35
}
37
36
38
37
fn show_ui_blind_signing ( ) {
39
38
show_ui_common ( || {
40
- let mut lines = [
41
- bagls:: Label :: from_const ( "Blind Signing" ) ,
42
- bagls:: Label :: from_const ( if is_blind_signing_enabled ( ) {
43
- "enabled"
44
- } else {
45
- "disabled"
46
- } ) ,
47
- ] ;
48
- lines[ 0 ] . bold = true ;
49
- lines. place ( layout:: Location :: Middle , layout:: Layout :: Centered , false ) ;
39
+ let label = if is_blind_signing_enabled ( ) {
40
+ "enabled"
41
+ } else {
42
+ "disabled"
43
+ } ;
44
+ gadgets:: Page :: from ( ( [ "Blind Signing" , label] , false ) ) . place ( ) ;
50
45
} ) ;
51
46
}
52
47
53
48
fn show_ui_version ( ) {
54
49
show_ui_common ( || {
55
50
const VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
56
- let mut lines = [
57
- bagls:: Label :: from_const ( "Version" ) ,
58
- bagls:: Label :: from_const ( VERSION ) ,
59
- ] ;
60
- lines[ 0 ] . bold = true ;
61
- lines. place ( layout:: Location :: Middle , layout:: Layout :: Centered , false ) ;
51
+ gadgets:: Page :: from ( ( [ "Version" , VERSION ] , false ) ) . place ( ) ;
62
52
} ) ;
63
53
}
64
54
65
55
fn show_ui_quit ( ) {
66
56
show_ui_common ( || {
67
- let mut lines = [ bagls:: Label :: from_const ( "Quit" ) ] ;
68
- lines[ 0 ] . bold = true ;
69
- lines. place ( layout:: Location :: Middle , layout:: Layout :: Centered , false ) ;
57
+ gadgets:: Page :: from ( ( "Quit" , & DASHBOARD_X ) ) . place ( ) ;
70
58
} ) ;
71
59
}
72
60
0 commit comments