fix: corner radius setting match style

This commit is contained in:
Ashley Wulber 2026-06-15 11:31:44 -04:00 committed by Ashley Wulber
parent 94d2c18a23
commit 46c717fd57
4 changed files with 80 additions and 14 deletions

View file

@ -385,9 +385,13 @@ where
my_state: &mut MenuBarState,
) {
if self.window_id != window::Id::NONE && self.on_surface_action.is_some() {
use crate::surface::action::{LiveSettings, destroy_popup};
use iced_runtime::platform_specific::wayland::popup::{
SctkPopupSettings, SctkPositioner,
use crate::{
surface::action::{LiveSettings, destroy_popup},
theme::THEME,
};
use iced_runtime::platform_specific::wayland::{
CornerRadius,
popup::{SctkPopupSettings, SctkPositioner},
};
let surface_action = self.on_surface_action.as_ref().unwrap();
@ -500,8 +504,22 @@ where
..Default::default()
};
let parent = self.window_id;
let t = THEME.lock().unwrap();
let styling = t.appearance(&crate::theme::menu_bar::MenuBarStyle::Default, false);
drop(t);
let rad = styling.menu_border_radius;
shell.publish((surface_action)(crate::surface::action::simple_popup(
|| LiveSettings::default(),
move || LiveSettings {
corners: Some(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 || SctkPopupSettings {
parent,
id,