@ -206,12 +206,12 @@ extern "C" fn new_confirm_action(n_args: usize, args: *const Obj, kwargs: *mut M
let mut paragraphs = Paragraphs ::new ( ) ;
if ! reverse {
paragraphs = paragraphs
. add ::< theme ::TTDefaultText > ( theme ::FON T_BOLD, action )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description ) ;
. add ( theme ::TEX T_BOLD, action )
. add ( theme ::TEX T_NORMAL, description ) ;
} else {
paragraphs = paragraphs
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description )
. add ::< theme ::TTDefaultText > ( theme ::FON T_BOLD, action ) ;
. add ( theme ::TEX T_NORMAL, description )
. add ( theme ::TEX T_BOLD, action ) ;
}
paragraphs
} ;
@ -246,9 +246,9 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
let hold : bool = kwargs . get_or ( Qstr ::MP_QSTR_hold , false ) ? ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description )
. add ::< theme ::TTDefaultText > ( theme ::FON T_BOLD, extra )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, data ) ;
. add ( theme ::TEX T_NORMAL, description )
. add ( theme ::TEX T_BOLD, extra )
. add ( theme ::TEX T_MONO, data ) ;
let obj = if hold {
LayoutObj ::new (
@ -302,8 +302,8 @@ extern "C" fn new_confirm_output(n_args: usize, args: *const Obj, kwargs: *mut M
let verb = "NEXT" ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, value ) ;
. add ( theme ::TEX T_NORMAL, description )
. add ( theme ::TEX T_MONO, value ) ;
let buttons = Button ::cancel_confirm (
Button ::with_icon ( theme ::ICON_CANCEL ) ,
@ -326,8 +326,8 @@ extern "C" fn new_confirm_total(n_args: usize, args: *const Obj, kwargs: *mut Ma
let value : StrBuffer = kwargs . get ( Qstr ::MP_QSTR_value ) ? . try_into ( ) ? ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, value ) ;
. add ( theme ::TEX T_NORMAL, description )
. add ( theme ::TEX T_MONO, value ) ;
let obj = LayoutObj ::new (
Frame ::new ( title , SwipeHoldPage ::new ( paragraphs , theme ::BG ) ) . into_child ( ) ,
@ -343,10 +343,10 @@ extern "C" fn new_confirm_joint_total(n_args: usize, args: *const Obj, kwargs: *
let total_amount : StrBuffer = kwargs . get ( Qstr ::MP_QSTR_total_amount ) ? . try_into ( ) ? ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "You are contributing:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, spending_amount )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "To the total amount:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, total_amount ) ;
. add ( theme ::TEX T_NORMAL, "You are contributing:" . into ( ) )
. add ( theme ::TEX T_MONO, spending_amount )
. add ( theme ::TEX T_NORMAL, "To the total amount:" . into ( ) )
. add ( theme ::TEX T_MONO, total_amount ) ;
let obj = LayoutObj ::new (
Frame ::new (
@ -374,13 +374,13 @@ extern "C" fn new_confirm_modify_output(n_args: usize, args: *const Obj, kwargs:
} ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "Address:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, address )
. add ( theme ::TEX T_NORMAL, "Address:" . into ( ) )
. add ( theme ::TEX T_MONO, address )
// FIXME pagebreak
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, amount_change )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "New amount:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, amount_new ) ;
. add ( theme ::TEX T_NORMAL, description . into ( ) )
. add ( theme ::TEX T_MONO, amount_change )
. add ( theme ::TEX T_NORMAL, "New amount:" . into ( ) )
. add ( theme ::TEX T_MONO, amount_new ) ;
let buttons = Button ::cancel_confirm (
Button ::with_icon ( theme ::ICON_CANCEL ) ,
@ -413,10 +413,10 @@ extern "C" fn new_confirm_modify_fee(n_args: usize, args: *const Obj, kwargs: *m
} ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, description . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, change )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "\nTransaction fee:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_MONO, total_fee_new ) ;
. add ( theme ::TEX T_NORMAL, description . into ( ) )
. add ( theme ::TEX T_MONO, change )
. add ( theme ::TEX T_NORMAL, "\nTransaction fee:" . into ( ) )
. add ( theme ::TEX T_MONO, total_fee_new ) ;
let buttons = Button ::cancel_confirm (
Button ::with_icon ( theme ::ICON_CANCEL ) ,
@ -481,14 +481,13 @@ extern "C" fn new_confirm_payment_request(
let description : StrBuffer = kwargs . get ( Qstr ::MP_QSTR_description ) ? . try_into ( ) ? ;
let memos : Obj = kwargs . get ( Qstr ::MP_QSTR_memos ) ? ;
let mut paragraphs =
Paragraphs ::new ( ) . add ::< theme ::TTDefaultText > ( theme ::FONT_NORMAL , description ) ;
let mut paragraphs = Paragraphs ::new ( ) . add ( theme ::TEXT_NORMAL , description ) ;
let mut iter_buf = IterBuf ::new ( ) ;
let iter = Iter ::try_from_obj_with_buf ( memos , & mut iter_buf ) ? ;
for memo in iter {
let text : StrBuffer = memo . try_into ( ) ? ;
paragraphs = paragraphs . add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, text ) ;
paragraphs = paragraphs . add ( theme ::TEX T_NORMAL, text ) ;
}
let buttons = Button ::cancel_info_confirm ( "CONFIRM" , "DETAILS" ) ;
@ -512,12 +511,12 @@ extern "C" fn new_confirm_coinjoin(n_args: usize, args: *const Obj, kwargs: *mut
let max_feerate : StrBuffer = kwargs . get ( Qstr ::MP_QSTR_max_feerate ) ? . try_into ( ) ? ;
let paragraphs = Paragraphs ::new ( )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "Coin name:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_BOLD, coin_name )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "Maximum rounds:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_BOLD, max_rounds )
. add ::< theme ::TTDefaultText > ( theme ::FON T_NORMAL, "Maximum mining fee:" . into ( ) )
. add ::< theme ::TTDefaultText > ( theme ::FON T_BOLD, max_feerate ) ;
. add ( theme ::TEX T_NORMAL, "Coin name:" . into ( ) )
. add ( theme ::TEX T_BOLD, coin_name )
. add ( theme ::TEX T_NORMAL, "Maximum rounds:" . into ( ) )
. add ( theme ::TEX T_BOLD, max_rounds )
. add ( theme ::TEX T_NORMAL, "Maximum mining fee:" . into ( ) )
. add ( theme ::TEX T_BOLD, max_feerate ) ;
let obj = LayoutObj ::new (
Frame ::new (
@ -761,7 +760,9 @@ mod tests {
let buttons =
Button ::cancel_confirm ( Button ::with_text ( "Left" ) , Button ::with_text ( "Right" ) , 1 ) ;
let mut layout = Dialog ::new (
FormattedText ::new ::< theme ::TTDefaultText > (
FormattedText ::new (
theme ::TEXT_NORMAL ,
theme ::FORMATTED ,
"Testing text layout, with some text, and some more text. And {param}" ,
)
. with ( "param" , "parameters!" ) ,