@@ -29,43 +29,15 @@ pub use iced_layershell_macros::to_layer_message;
2929
3030pub use error:: Error ;
3131
32- use iced:: { Color , Element , Theme } ;
32+ use iced:: Element ;
3333use iced_futures:: Subscription ;
3434
3535pub use sandbox:: LayerShellSandbox ;
3636
3737pub type Result = std:: result:: Result < ( ) , error:: Error > ;
38- /// The appearance of a program.
39- #[ derive( Debug , Clone , Copy , PartialEq ) ]
40- pub struct Appearance {
41- /// The background [`Color`] of the application.
42- pub background_color : Color ,
43-
44- /// The default text [`Color`] of the application.
45- pub text_color : Color ,
46- }
47-
48- /// The default style of a [`Application`].
49- pub trait DefaultStyle {
50- /// Returns the default style of a [`Appearance`].
51- fn default_style ( & self ) -> Appearance ;
52- }
53-
54- impl DefaultStyle for Theme {
55- fn default_style ( & self ) -> Appearance {
56- default ( self )
57- }
58- }
38+ use iced:: theme:: Style as Appearance ;
5939
60- /// The default [`Appearance`] of a [`Application`] with the built-in [`Theme`].
61- pub fn default ( theme : & Theme ) -> Appearance {
62- let palette = theme. extended_palette ( ) ;
63-
64- Appearance {
65- background_color : palette. background . base . color ,
66- text_color : palette. background . base . text ,
67- }
68- }
40+ use iced:: theme:: Base as DefaultStyle ;
6941
7042// layershell application
7143pub trait Application : Sized {
@@ -129,7 +101,7 @@ pub trait Application: Sized {
129101 ///
130102 /// [`Theme`]: Self::Theme
131103 fn style ( & self , theme : & Self :: Theme ) -> Appearance {
132- theme. default_style ( )
104+ theme. base ( )
133105 }
134106
135107 /// Returns the event [`Subscription`] for the current state of the
@@ -308,7 +280,7 @@ pub trait MultiApplication: Sized {
308280 ///
309281 /// [`Theme`]: Self::Theme
310282 fn style ( & self , theme : & Self :: Theme ) -> Appearance {
311- theme. default_style ( )
283+ theme. base ( )
312284 }
313285
314286 /// Returns the event [`Subscription`] for the current state of the
@@ -447,7 +419,7 @@ mod tests {
447419 impl Application for TestApp {
448420 type Executor = iced:: executor:: Default ;
449421 type Message = TestMessage ;
450- type Theme = Theme ;
422+ type Theme = iced :: Theme ;
451423 type Flags = ( i32 , f64 , String ) ;
452424
453425 fn new ( flags : Self :: Flags ) -> ( Self , Task < Self :: Message > ) {
@@ -483,15 +455,6 @@ mod tests {
483455 }
484456 }
485457
486- // Test default appearance
487- #[ test]
488- fn test_default_appearance ( ) {
489- let theme = Theme :: default ( ) ;
490- let appearance = theme. default_style ( ) ;
491- assert_eq ! ( appearance. background_color, Color :: WHITE ) ;
492- assert_eq ! ( appearance. text_color, Color :: BLACK ) ;
493- }
494-
495458 // Test namespace
496459 #[ test]
497460 fn test_namespace ( ) {
0 commit comments