yoda: fork pivot — Wayland-only + ungate winit + soft-fork libcosmic-yoda (squashed)
Squash of 7 yoda commits forming the fork pivot: -255cf7ccrename: libcosmic -> libcosmic-yoda (fork 0.1.0-yoda) -8701aa31feat(yoda): Wayland-only cut — drop winit and x11 features -6736a596yoda: soft-fork pivot — keep Cargo name 'libcosmic' for dep unification -3e23d087yoda: re-apply hard rename — libcosmic -> libcosmic-yoda (0.1.0-yoda) -aec3eb61yoda: ungate remaining winit+wayland combined cfgs -8ab7b158yoda-v2: color_picker Theme ref + context_menu/menu ungate winit -8d1d8739yoda: drop x11 defaults on iced_winit + iced_tiny_skia
This commit is contained in:
parent
10422b8f4a
commit
e3dcdf1fce
101 changed files with 77 additions and 98 deletions
|
|
@ -619,8 +619,10 @@ where
|
|||
let bounds = canvas_layout.bounds();
|
||||
// Draw the handle on the saturation value canvas
|
||||
|
||||
let t = THEME.lock().unwrap().clone();
|
||||
let t = t.cosmic();
|
||||
// Yoda: use the Theme passed into draw() instead of locking the global
|
||||
// THEME Mutex and cloning the whole Theme. Fires on every color-picker
|
||||
// redraw, so saving the Mutex lock + full Theme clone adds up.
|
||||
let t = theme.cosmic();
|
||||
let handle_radius = f32::from(t.space_xs()) / 2.0;
|
||||
let (x, y) = (
|
||||
self.active_color
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
|
||||
|
|
@ -67,7 +66,6 @@ impl<Message: Clone + 'static> ContextMenu<'_, Message> {
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
#[allow(clippy::too_many_lines)]
|
||||
|
|
@ -378,7 +376,6 @@ impl<Message: 'static + Clone> Widget<Message, crate::Theme, crate::Renderer>
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
|
||||
|
|
@ -422,7 +419,6 @@ impl<Message: 'static + Clone> Widget<Message, crate::Theme, crate::Renderer>
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) {
|
||||
|
|
@ -444,7 +440,6 @@ impl<Message: 'static + Clone> Widget<Message, crate::Theme, crate::Renderer>
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
|
||||
|
|
@ -483,7 +478,6 @@ impl<Message: 'static + Clone> Widget<Message, crate::Theme, crate::Renderer>
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ pub fn popup_dropdown<
|
|||
let dropdown: Dropdown<'_, S, Message, AppMessage> =
|
||||
Dropdown::new(selections.into(), selected, on_selected);
|
||||
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
let dropdown = dropdown.with_popup(_parent_id, _on_surface_action, _map_action);
|
||||
|
||||
dropdown
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ where
|
|||
action_map: Option<Arc<dyn Fn(Message) -> AppMessage + 'static + Send + Sync>>,
|
||||
#[setters(strip_option)]
|
||||
window_id: Option<window::Id>,
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
}
|
||||
|
||||
|
|
@ -96,14 +96,14 @@ where
|
|||
text_line_height: text::LineHeight::Relative(1.2),
|
||||
font: None,
|
||||
window_id: None,
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner::default(),
|
||||
on_surface_action: None,
|
||||
action_map: None,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
/// Handle dropdown requests for popup creation.
|
||||
/// Intended to be used with [`crate::app::message::get_popup`]
|
||||
pub fn with_popup<NewAppMessage>(
|
||||
|
|
@ -154,7 +154,7 @@ where
|
|||
self
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
pub fn with_positioner(
|
||||
mut self,
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
|
|
@ -268,7 +268,7 @@ where
|
|||
layout,
|
||||
cursor,
|
||||
shell,
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
self.positioner.clone(),
|
||||
self.on_selected.clone(),
|
||||
self.selected,
|
||||
|
|
@ -346,7 +346,7 @@ where
|
|||
viewport: &Rectangle,
|
||||
translation: Vector,
|
||||
) -> Option<overlay::Element<'b, Message, crate::Theme, crate::Renderer>> {
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
if self.window_id.is_some() || self.on_surface_action.is_some() {
|
||||
return None;
|
||||
}
|
||||
|
|
@ -545,7 +545,7 @@ pub fn update<
|
|||
layout: Layout<'_>,
|
||||
cursor: mouse::Cursor,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
on_selected: Arc<dyn Fn(usize) -> Message + Send + Sync + 'static>,
|
||||
selected: Option<usize>,
|
||||
|
|
@ -571,7 +571,7 @@ pub fn update<
|
|||
*hovered_guard = selected;
|
||||
let id = window::Id::unique();
|
||||
state.popup_id = id;
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
if let Some(((on_surface_action, parent), action_map)) = on_surface_action
|
||||
.as_ref()
|
||||
.zip(_window_id)
|
||||
|
|
@ -658,7 +658,7 @@ pub fn update<
|
|||
state.close_operation = false;
|
||||
state.is_open.store(false, Ordering::SeqCst);
|
||||
if is_open {
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
if let Some(ref on_close) = on_surface_action {
|
||||
shell.publish(on_close(surface::action::destroy_popup(state.popup_id)));
|
||||
}
|
||||
|
|
@ -681,7 +681,7 @@ pub fn update<
|
|||
// Event wasn't processed by overlay, so cursor was clicked either outside it's
|
||||
// bounds or on the drop-down, either way we close the overlay.
|
||||
state.is_open.store(false, Ordering::Relaxed);
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
if let Some(on_close) = on_surface_action {
|
||||
shell.publish(on_close(surface::action::destroy_popup(state.popup_id)));
|
||||
}
|
||||
|
|
@ -726,7 +726,7 @@ pub fn mouse_interaction(layout: Layout<'_>, cursor: mouse::Cursor) -> mouse::In
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
/// Returns the current menu widget of a [`Dropdown`].
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn menu_widget<
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ use crate::Renderer;
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
|
||||
|
|
@ -194,7 +193,6 @@ pub struct MenuBar<Message> {
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
target_os = "linux"
|
||||
))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
|
|
@ -234,7 +232,6 @@ where
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
target_os = "linux"
|
||||
))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner::default(),
|
||||
|
|
@ -333,7 +330,6 @@ where
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
target_os = "linux"
|
||||
))]
|
||||
pub fn with_positioner(
|
||||
|
|
@ -371,7 +367,6 @@ where
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
#[allow(clippy::too_many_lines)]
|
||||
|
|
@ -643,7 +638,6 @@ where
|
|||
#[cfg(all(
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
{
|
||||
|
|
@ -667,7 +661,6 @@ where
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) {
|
||||
|
|
@ -682,7 +675,6 @@ where
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) {
|
||||
|
|
@ -765,7 +757,6 @@ where
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use super::menu_tree::MenuTree;
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
|
||||
|
|
@ -680,7 +679,6 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
|
||||
|
|
@ -965,7 +963,6 @@ impl<Message: std::clone::Clone + 'static> Widget<Message, crate::Theme, crate::
|
|||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
feature = "winit",
|
||||
feature = "surface-message",
|
||||
target_os = "linux"
|
||||
))]
|
||||
|
|
@ -1228,7 +1225,6 @@ pub(crate) fn init_root_menu<Message: Clone>(
|
|||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
target_os = "linux",
|
||||
feature = "winit",
|
||||
feature = "surface-message"
|
||||
))]
|
||||
pub(super) fn init_root_popup_menu<Message>(
|
||||
|
|
@ -1525,7 +1521,7 @@ where
|
|||
.as_ref()
|
||||
.is_some_and(|i| *i != new_index && !active_menu[*i].children.is_empty());
|
||||
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland",target_os = "linux", feature = "winit", feature = "surface-message"))]
|
||||
#[cfg(all(feature = "multi-window", feature = "wayland", target_os = "linux", 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);
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ pub use toggler::{Toggler, toggler};
|
|||
#[doc(inline)]
|
||||
pub use tooltip::{Tooltip, tooltip};
|
||||
|
||||
#[cfg(all(feature = "wayland", target_os = "linux", feature = "winit"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
pub mod wayland;
|
||||
|
||||
pub mod tooltip {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ impl Default for ResponsiveMenuBar {
|
|||
fn default() -> ResponsiveMenuBar {
|
||||
ResponsiveMenuBar {
|
||||
collapsed_item_width: {
|
||||
#[cfg(all(feature = "winit", feature = "wayland", target_os = "linux"))]
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
if matches!(
|
||||
crate::app::cosmic::WINDOWING_SYSTEM.get(),
|
||||
Some(crate::app::cosmic::WindowingSystem::Wayland)
|
||||
|
|
@ -32,7 +32,7 @@ impl Default for ResponsiveMenuBar {
|
|||
} else {
|
||||
ItemWidth::Static(84)
|
||||
}
|
||||
#[cfg(not(all(feature = "winit", feature = "wayland", target_os = "linux")))]
|
||||
#[cfg(not(all(feature = "wayland", target_os = "linux")))]
|
||||
{
|
||||
ItemWidth::Static(84)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue