@@ -6,6 +6,7 @@ use floem::{
66 new_window,
77 peniko:: Color ,
88 prelude:: * ,
9+ style:: Style ,
910 text:: Alignment ,
1011 theme:: StyleThemeExt ,
1112 view:: ViewId ,
@@ -101,11 +102,11 @@ impl Spot {
101102 s. width_full ( )
102103 . padding ( 18.0 )
103104 . row_gap ( 10.0 )
105+ . border_color ( self . accent . with_alpha ( 0.25 ) )
106+ . border ( 1.0 )
104107 . with_theme ( move |s, t| {
105108 s. border_radius ( t. border_radius ( ) )
106109 . background ( t. bg_elevated ( ) )
107- . border_color ( self . accent . with_alpha ( 0.25 ) )
108- . border ( 1.0 )
109110 } )
110111 } )
111112 . debug_name ( "content" ) ;
@@ -220,7 +221,7 @@ impl Spot {
220221 . with_theme ( |s, t| {
221222 s. border_radius ( t. border_radius ( ) )
222223 . background ( t. bg_elevated ( ) )
223- . border ( 1.0 )
224+ . apply ( Style :: new ( ) . border ( 1.0 ) )
224225 . border_color ( t. border ( ) )
225226 } )
226227 } )
@@ -279,11 +280,11 @@ impl Spot {
279280 . padding ( 22.0 )
280281 . max_width ( 400 )
281282 . with_theme ( move |s, t| {
282- let semantic = result. color ( t ) ;
283+ let semantic = t . def ( move |theme| result. color ( & theme ) ) ;
283284 s. border_radius ( t. border_radius ( ) )
284285 . background ( t. bg_elevated ( ) )
285- . border ( 1.0 )
286- . border_color ( semantic. with_alpha ( 0.3 ) )
286+ . apply ( Style :: new ( ) . border ( 1.0 ) )
287+ . border_color ( semantic. map ( |color| color . with_alpha ( 0.3 ) ) )
287288 } )
288289 } )
289290 . debug_name ( "result_body" ) ;
@@ -724,7 +725,7 @@ fn home_screen() -> impl IntoView {
724725 s. padding ( 22.0 ) . row_gap ( 10.0 ) . with_theme ( |s, t| {
725726 s. border_radius ( t. border_radius ( ) )
726727 . background ( t. bg_elevated ( ) )
727- . border ( 1.0 )
728+ . apply ( Style :: new ( ) . border ( 1.0 ) )
728729 . border_color ( t. border ( ) )
729730 } )
730731 } )
@@ -763,9 +764,9 @@ fn floating_action_button() -> impl IntoView {
763764 . font_bold ( )
764765 . justify_center ( )
765766 . with_theme ( |s, t| {
766- s. border_radius ( 999.0 )
767- . background ( t. bg_elevated ( ) . with_alpha ( 0.96 ) )
768- . border ( 1.0 )
767+ s. apply ( Style :: new ( ) . border_radius ( 999.0 ) )
768+ . background ( t. def ( |theme| theme . bg_elevated ( ) . with_alpha ( 0.96 ) ) )
769+ . apply ( Style :: new ( ) . border ( 1.0 ) )
769770 . border_color ( t. border ( ) )
770771 . color ( t. primary ( ) )
771772 } )
@@ -785,7 +786,7 @@ fn quick_action_sheet(button_id: ViewId) -> impl IntoView {
785786 . style ( move |s| {
786787 s. absolute ( )
787788 . inset ( 0.0 )
788- . with_theme ( |s, t| s. background ( t. text ( ) . with_alpha ( 0.18 ) ) )
789+ . with_theme ( |s, t| s. background ( t. def ( |theme| theme . text ( ) . with_alpha ( 0.18 ) ) ) )
789790 } )
790791 . debug_name ( "backdrop" ) ;
791792
@@ -821,7 +822,7 @@ fn quick_action_sheet(button_id: ViewId) -> impl IntoView {
821822 . with_theme ( |s, t| {
822823 s. border_radius ( t. border_radius ( ) )
823824 . background ( t. bg_elevated ( ) )
824- . border ( 1.0 )
825+ . apply ( Style :: new ( ) . border ( 1.0 ) )
825826 . border_color ( t. border ( ) )
826827 } )
827828 } )
@@ -858,8 +859,9 @@ fn payment_badge(result: PaymentResult) -> impl IntoView {
858859 . border_radius ( 999.0 )
859860 . font_bold ( )
860861 . with_theme ( move |s, t| {
861- let semantic = result. color ( t) ;
862- s. background ( semantic. with_alpha ( 0.14 ) ) . color ( semantic)
862+ let semantic = t. def ( move |theme| result. color ( & theme) ) ;
863+ s. background ( semantic. clone ( ) . map ( |color| color. with_alpha ( 0.14 ) ) )
864+ . color ( semantic)
863865 } )
864866 } )
865867 . debug_name ( "payment_badge" )
0 commit comments