chore: update features and feature gates
This commit is contained in:
parent
380b341bdc
commit
413e63f62a
18 changed files with 159 additions and 102 deletions
|
|
@ -12,6 +12,7 @@ use super::{
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -195,7 +196,12 @@ pub struct MenuBar<Message> {
|
|||
menu_roots: Vec<MenuTree<Message>>,
|
||||
style: <crate::Theme as StyleSheet>::Style,
|
||||
window_id: window::Id,
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland", feature = "winit"))]
|
||||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
target_os = "linux"
|
||||
))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
pub(crate) on_surface_action:
|
||||
Option<Arc<dyn Fn(crate::surface::Action) -> Message + Send + Sync + 'static>>,
|
||||
|
|
@ -230,7 +236,12 @@ where
|
|||
menu_roots,
|
||||
style: <crate::Theme as StyleSheet>::Style::default(),
|
||||
window_id: window::Id::NONE,
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland", feature = "winit"))]
|
||||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
target_os = "linux"
|
||||
))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner::default(),
|
||||
on_surface_action: None,
|
||||
}
|
||||
|
|
@ -324,7 +335,12 @@ where
|
|||
self
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland", feature = "winit"))]
|
||||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
target_os = "linux"
|
||||
))]
|
||||
pub fn with_positioner(
|
||||
mut self,
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
|
|
@ -359,6 +375,7 @@ where
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -629,6 +646,7 @@ where
|
|||
state.open = false;
|
||||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -652,6 +670,7 @@ where
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -666,6 +685,7 @@ where
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -748,6 +768,7 @@ where
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use super::{menu_bar::MenuBarState, menu_tree::MenuTree};
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -680,6 +681,7 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -966,7 +968,8 @@ impl<Message: std::clone::Clone + 'static> Widget<Message, crate::Theme, crate::
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
feature = "surface-message",
|
||||
target_os = "linux"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
|
||||
&& let Some((new_root, new_ms)) = new_root
|
||||
|
|
@ -1226,6 +1229,7 @@ pub(crate) fn init_root_menu<Message: Clone>(
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
|
|
@ -1523,7 +1527,7 @@ where
|
|||
.as_ref()
|
||||
.is_some_and(|i| *i != new_index && !active_menu[*i].children.is_empty());
|
||||
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland", feature = "winit", feature = "surface-message"))]
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland",target_os = "linux", feature = "winit", feature = "surface-message"))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) && remove {
|
||||
if let Some(id) = state.popup_id.remove(&menu.window_id) {
|
||||
state.active_root.truncate(menu.depth + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue