diff --git a/src/app.rs b/src/app.rs index 6eab0a5..0e572a0 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2817,7 +2817,7 @@ impl Application for App { .on_middle_press(|entity| { cosmic::Action::App(Message::NavMenuAction(NavMenuAction::OpenInNewTab(entity))) }) - .context_menu(self.nav_context_menu(self.nav_bar_context_id)) + .context_menu(self.nav_context_menu()) .close_icon(icon::from_name("media-eject-symbolic").size(16).icon()) .into_container(); @@ -2832,8 +2832,8 @@ impl Application for App { fn nav_context_menu( &self, - entity: widget::nav_bar::Id, ) -> Option>>> { + let entity = self.nav_bar_context_id; let favorite_index_opt = self.nav_model.data::(entity); let location_opt = self.nav_model.data::(entity); @@ -4885,6 +4885,7 @@ impl Application for App { commands.push(self.update(Message::CheckClipboard)); commands.push(self.update(Message::Surface( cosmic::surface::action::app_popup( + |_: &Self| cosmic::surface::action::LiveSettings::default(), move |app: &mut Self| -> SctkPopupSettings { let anchor_rect = Rectangle { x: point.x as i32, diff --git a/src/dialog.rs b/src/dialog.rs index b8d592a..c760472 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -1801,6 +1801,7 @@ impl Application for App { let autosize_id = widget::Id::unique(); commands.push(self.update(Message::Surface( cosmic::surface::action::app_popup( + |_: &Self| cosmic::surface::action::LiveSettings::default(), move |app: &mut Self| -> SctkPopupSettings { let anchor_rect = Rectangle { x: point.x as i32, diff --git a/src/menu.rs b/src/menu.rs index 6e29b6b..0937595 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -70,7 +70,7 @@ pub fn context_menu<'a>( String::new() }; fn key_style(theme: &cosmic::Theme) -> TextStyle { - let mut color = theme.cosmic().background.component.on; + let mut color = theme.cosmic().background(false).component.on; color.alpha *= 0.75; TextStyle { color: Some(color.into()), @@ -78,7 +78,7 @@ pub fn context_menu<'a>( } } fn disabled_style(theme: &cosmic::Theme) -> TextStyle { - let mut color = theme.cosmic().background.component.on; + let mut color = theme.cosmic().background(false).component.on; color.alpha *= 0.5; TextStyle { color: Some(color.into()), @@ -442,7 +442,7 @@ pub fn context_menu<'a>( //TODO: move style to libcosmic .style(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background.component; + let component = &cosmic.background(false).component; container::Style { icon_color: Some(component.on.into()), text_color: Some(component.on.into()), @@ -836,7 +836,7 @@ pub fn location_context_menu<'a>(ancestor_index: usize) -> Element<'a, tab::Mess .padding(1) .style(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background.component; + let component = &cosmic.background(false).component; container::Style { icon_color: Some(component.on.into()), text_color: Some(component.on.into()), diff --git a/src/tab.rs b/src/tab.rs index 82055eb..dc3d925 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -181,7 +181,7 @@ fn button_appearance( appearance.icon_color = Some(Color::from(cosmic.on_bg_component_color())); appearance.text_color = Some(Color::from(cosmic.on_bg_component_color())); if cut { - appearance.text_color = Some(Color::from(cosmic.background.component.on_disabled)); + appearance.text_color = Some(Color::from(cosmic.background(false).component.on_disabled)); } else { appearance.text_color = Some(Color::from(cosmic.on_bg_component_color())); } @@ -192,12 +192,12 @@ fn button_appearance( appearance.background = Some(Color::from(cosmic.bg_color()).into()); appearance.icon_color = Some(Color::from(cosmic.on_bg_color())); if cut { - appearance.text_color = Some(Color::from(cosmic.background.component.disabled)); + appearance.text_color = Some(Color::from(cosmic.background(false).component.disabled)); } else { appearance.text_color = Some(Color::from(cosmic.on_bg_color())); } } else if cut { - appearance.text_color = Some(Color::from(cosmic.background.component.on_disabled)); + appearance.text_color = Some(Color::from(cosmic.background(false).component.on_disabled)); } if focused && accent { appearance.outline_width = 1.0;