@@ -12,10 +12,9 @@ use iced_layershell::{
1212 reexport:: { Anchor , KeyboardInteractivity , Layer } ,
1313 settings:: { LayerShellSettings , Settings } ,
1414} ;
15+ use oxiced:: theme:: theme:: { get_derived_iced_theme, OXITHEME } ;
1516use oxiced:: {
16- theme:: get_theme,
1717 widgets:: {
18- common:: { darken_color, lighten_color} ,
1918 oxi_button:: { self , ButtonVariant } ,
2019 } ,
2120} ;
@@ -74,12 +73,12 @@ impl TryInto<LayershellCustomActions> for Message {
7473}
7574
7675fn box_style ( theme : & Theme ) -> Style {
77- let palette = theme . extended_palette ( ) ;
76+ let palette = OXITHEME ;
7877 Style {
79- background : Some ( iced:: Background :: Color ( darken_color (
80- palette. background . base . color ,
81- ) ) ) ,
82- border : iced:: border:: rounded ( 10.0 ) ,
78+ background : Some ( iced:: Background :: Color (
79+ palette. base
80+ ) ) ,
81+ border : iced:: border:: color ( palette . primary ) . width ( 2.0 ) . rounded ( palette . border_radius ) ,
8382 ..container:: rounded_box ( theme)
8483 }
8584}
@@ -153,7 +152,10 @@ fn mk_button<'a>(
153152 focused_action : & Action ,
154153) -> Element < ' a , Message > {
155154 let handle = iced:: widget:: svg:: Handle :: from_path ( svg_path ( asset) ) ;
156- let svg = iced:: widget:: svg ( handle) . content_fit ( iced:: ContentFit :: Contain ) ;
155+ let svg = iced:: widget:: svg ( handle) . content_fit ( iced:: ContentFit :: Contain ) . style ( move |_, _| {
156+ let palette = OXITHEME ;
157+ iced:: widget:: svg:: Style { color : Some ( palette. primary ) }
158+ } ) ;
157159 let is_focused = focused_action == & action;
158160 oxiced:: widgets:: oxi_button:: button (
159161 iced:: widget:: row!( svg)
@@ -166,14 +168,16 @@ fn mk_button<'a>(
166168 . height ( Length :: Fill )
167169 . width ( Length :: Fill )
168170 . style ( move |theme, status| {
169- let palette = theme . extended_palette ( ) . primary ;
170- let default_style = oxi_button:: primary_button ( theme, status) ;
171+ let palette = OXITHEME ;
172+ let default_style = oxi_button:: row_entry ( theme, status) ;
171173 let background = if status == Status :: Hovered {
172- default_style. background
173- } else if status != Status :: Hovered && is_focused {
174- default_style. background
174+ Some ( iced:: Background :: Color ( palette. primary_bg_active ) )
175+ } else if status == Status :: Pressed {
176+ Some ( iced:: Background :: Color ( palette. primary_bg_active ) )
177+ } else if is_focused {
178+ Some ( iced:: Background :: Color ( palette. primary_bg_hover ) )
175179 } else {
176- Some ( iced:: Background :: Color ( lighten_color ( palette. base . color ) ) )
180+ Some ( iced:: Background :: Color ( palette. primary_bg ) )
177181 } ;
178182 iced:: widget:: button:: Style {
179183 background,
@@ -192,7 +196,7 @@ impl Application for OxiShut {
192196 fn new ( _flags : ( ) ) -> ( Self , Task < Message > ) {
193197 (
194198 Self {
195- theme : get_theme ( ) ,
199+ theme : get_derived_iced_theme ( ) ,
196200 focused_action : Action :: ShutDown ,
197201 } ,
198202 Task :: none ( ) ,
@@ -270,11 +274,11 @@ impl Application for OxiShut {
270274 }
271275
272276 // remove the annoying background color
273- fn style ( & self , theme : & Self :: Theme ) -> iced_layershell:: Appearance {
274- let palette = theme . extended_palette ( ) ;
277+ fn style ( & self , _ : & Self :: Theme ) -> iced_layershell:: Appearance {
278+ let palette = OXITHEME ;
275279 iced_layershell:: Appearance {
276280 background_color : iced:: Color :: TRANSPARENT ,
277- text_color : palette. background . base . text ,
281+ text_color : palette. text
278282 }
279283 }
280284
0 commit comments