File tree 4 files changed +20
-11
lines changed
4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,7 @@ fn app_view() -> impl IntoView {
72
72
} )
73
73
. keyboard_navigable ( ) ,
74
74
)
75
- . style ( |s| {
76
- s. class ( LabelClass , |s| {
77
- s. apply ( LabelCustomStyle :: new ( ) . selectable ( false ) . style ( ) )
78
- } )
79
- } ) ,
75
+ . style ( |s| s. custom_style_class ( |s : LabelCustomStyle | s. selectable ( false ) ) ) ,
80
76
)
81
77
. style ( |s| {
82
78
s. size ( 100 . pct ( ) , 100 . pct ( ) )
Original file line number Diff line number Diff line change @@ -2593,6 +2593,21 @@ pub trait CustomStyle: Default + Clone + Into<Style> + From<Style> {
2593
2593
}
2594
2594
self_style. into ( )
2595
2595
}
2596
+
2597
+ fn apply_if ( self , cond : bool , style : impl FnOnce ( Self ) -> Self ) -> Self {
2598
+ if cond {
2599
+ style ( self )
2600
+ } else {
2601
+ self
2602
+ }
2603
+ }
2604
+ fn transition < P : StyleProp > ( self , _prop : P , transition : Transition ) -> Self {
2605
+ let mut self_style: Style = self . into ( ) ;
2606
+ self_style
2607
+ . map
2608
+ . insert ( P :: prop_ref ( ) . info ( ) . transition_key , Rc :: new ( transition) ) ;
2609
+ self_style. into ( )
2610
+ }
2596
2611
}
2597
2612
2598
2613
pub trait CustomStylable < S : CustomStyle + ' static > : IntoView < V = Self :: DV > + Sized {
Original file line number Diff line number Diff line change @@ -556,11 +556,6 @@ impl LabelCustomStyle {
556
556
self = Self ( self . 0 . set ( CursorColor , color) ) ;
557
557
self
558
558
}
559
-
560
- /// Get the inner style
561
- pub fn style ( self ) -> Style {
562
- self . 0
563
- }
564
559
}
565
560
impl Default for LabelCustomStyle {
566
561
fn default ( ) -> Self {
Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ impl Default for WindowConfig {
53
53
transparent : false ,
54
54
fullscreen : None ,
55
55
window_icon : None ,
56
- title : "Floem window" . to_owned ( ) ,
56
+ title : std:: env:: current_exe ( )
57
+ . ok ( )
58
+ . and_then ( |p| p. file_name ( ) . map ( |f| f. to_string_lossy ( ) . into_owned ( ) ) )
59
+ . unwrap_or ( "Floem Window" . to_string ( ) ) ,
57
60
enabled_buttons : WindowButtons :: all ( ) ,
58
61
resizable : true ,
59
62
undecorated : false ,
You can’t perform that action at this time.
0 commit comments