diff --git a/src/app.rs b/src/app.rs index 659b827..b2d6490 100644 --- a/src/app.rs +++ b/src/app.rs @@ -4496,9 +4496,10 @@ impl Application for App { use cctk::wayland_protocols::xdg::shell::client::xdg_positioner::{ Anchor, Gravity, }; - use cosmic::iced::runtime::platform_specific::wayland::popup::{ + use cosmic::{iced::runtime::platform_specific::wayland::popup::{ SctkPopupSettings, SctkPositioner, - }; + }, widget::menu::StyleSheet as _}; + let window_id = WindowId::unique(); self.windows.insert( window_id, @@ -4508,10 +4509,24 @@ impl Application for App { )), ); commands.push(self.update(Message::CheckClipboard)); + let t = self.core.system_theme(); + let styling = t.appearance( + &cosmic::theme::menu_bar::MenuBarStyle::Default, + false, + ); + let rad = styling.menu_border_radius; + commands.push(self.update(Message::Surface( cosmic::surface::action::app_popup( - |_| Default::default(), - move |app: &mut Self| -> SctkPopupSettings { + move |_| cosmic::surface::action::LiveSettings { + corners: Some(iced::runtime::platform_specific::wayland::CornerRadius { + top_left: rad[0] as u32, + top_right: rad[1] as u32, + bottom_left: rad[2] as u32, + bottom_right: rad[3] as u32, + }), + ..Default::default() + }, move |app: &mut Self| -> SctkPopupSettings { let anchor_rect = Rectangle { x: point.x as i32, y: point.y as i32, diff --git a/src/dialog.rs b/src/dialog.rs index 54565b4..c71905d 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -1790,12 +1790,28 @@ impl Application for App { SctkPopupSettings, SctkPositioner, }; use cosmic::iced::Rectangle; + use cosmic::widget::menu::StyleSheet as _; + let window_id = window::Id::unique(); self.context_menu_window = Some(window_id); let autosize_id = widget::Id::unique(); + let t = self.core.system_theme(); + let styling = t.appearance( + &cosmic::theme::menu_bar::MenuBarStyle::Default, + false, + ); + let rad = styling.menu_border_radius; commands.push(self.update(Message::Surface( cosmic::surface::action::app_popup( - |_| Default::default(), + move |_| cosmic::surface::action::LiveSettings { + corners: Some(iced::runtime::platform_specific::wayland::CornerRadius { + top_left: rad[0] as u32, + top_right: rad[1] as u32, + bottom_left: rad[2] as u32, + bottom_right: rad[3] as u32, + }), + ..Default::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 a441b05..86db158 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -441,7 +441,7 @@ pub fn context_menu<'a>( //TODO: move style to libcosmic .style(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background(theme.transparent).component; + let component = &cosmic.background(theme.transparent); container::Style { icon_color: Some(component.on.into()), text_color: Some(component.on.into()),