diff --git a/iced b/iced index 6b069b2..f487018 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit 6b069b2b4bc252d8fdc4d2a93ff533376c4f0dee +Subproject commit f4870187088a14d398f2075c5ccda611387dcdcc diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index dcbf36c..86af099 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -100,9 +100,10 @@ impl Cosmic where T::Message: Send + 'static, { - pub fn init( - (mut core, flags): (Core, T::Flags), - ) -> (Self, iced::Task>) { + pub fn init((core, flags): (Core, T::Flags)) -> (Self, iced::Task>) { + #[cfg(all(feature = "dbus-config", target_os = "linux"))] + let mut core = core; + #[cfg(all(feature = "dbus-config", target_os = "linux"))] { use iced_futures::futures::executor::block_on; @@ -625,9 +626,9 @@ impl Cosmic { .app .core() .main_window_id() - .is_some_and(|main_id| main_id == id) + .is_some_and(|main_id| main_id == _id) { - self.app.core_mut().window.sharp_corners = maximized; + self.app.core_mut().window.sharp_corners = _maximized; } } diff --git a/src/app/mod.rs b/src/app/mod.rs index a401320..f53ee51 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -284,7 +284,7 @@ where // app = app.window(window_settings); core.main_window = Some(iced_core::window::Id::RESERVED); } - let mut app = iced::daemon( + let app = iced::daemon( BootData(Rc::new(RefCell::new(Some(BootDataInner:: { flags, core, diff --git a/src/applet/column.rs b/src/applet/column.rs index 9657b56..bb16f08 100644 --- a/src/applet/column.rs +++ b/src/applet/column.rs @@ -1,7 +1,7 @@ //! Distribute content vertically. use crate::iced; use iced::core::alignment::{self, Alignment}; -use iced::core::event::{self, Event}; +use iced::core::event::Event; use iced::core::layout; use iced::core::mouse; use iced::core::overlay; diff --git a/src/applet/mod.rs b/src/applet/mod.rs index 48721e1..d1ae6e8 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -10,11 +10,7 @@ use crate::{ widget::{ self, autosize::{self, Autosize, autosize}, - column::Column, layer_container, - row::Row, - space::horizontal, - space::vertical, }, }; @@ -217,12 +213,6 @@ impl Context { icon: widget::icon::Handle, ) -> crate::widget::Button<'a, Message> { let suggested = self.suggested_size(icon.symbolic); - let (applet_padding_major_axis, applet_padding_minor_axis) = self.suggested_padding(true); - let (horizontal_padding, vertical_padding) = if self.is_horizontal() { - (applet_padding_major_axis, applet_padding_minor_axis) - } else { - (applet_padding_minor_axis, applet_padding_major_axis) - }; let symbolic = icon.symbolic; let icon = widget::icon(icon) .class(if symbolic { @@ -465,10 +455,8 @@ impl Context { &self, content: impl Into>, ) -> Autosize<'a, Message, crate::Theme, crate::Renderer> { - let force_configured = matches!(&self.panel_type, PanelType::Other(n) if n.is_empty()); let w = autosize(content, AUTOSIZE_MAIN_ID.clone()); let mut limits = Limits::NONE; - let suggested_window_size = self.suggested_window_size(); if let Some(width) = self .suggested_bounds @@ -579,7 +567,7 @@ pub fn run(flags: App::Flags) -> iced::Result { // window_settings = window_settings.clone(); core.main_window = Some(iced_core::window::Id::RESERVED); } - let mut app = iced::daemon( + let app = iced::daemon( BootData(Rc::new(RefCell::new(Some(BootDataInner:: { flags, core, diff --git a/src/applet/row.rs b/src/applet/row.rs index a6745d1..3ac9f7e 100644 --- a/src/applet/row.rs +++ b/src/applet/row.rs @@ -1,7 +1,7 @@ //! Distribute content horizontally. use crate::iced; use iced::core::alignment::{self, Alignment}; -use iced::core::event::{self, Event}; +use iced::core::event::Event; use iced::core::layout::{self, Layout}; use iced::core::mouse; use iced::core::overlay; @@ -10,7 +10,6 @@ use iced::core::widget::{Operation, Tree}; use iced::core::{ Clipboard, Element, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, widget, }; -use iced::touch; /// A container that distributes its contents horizontally. /// diff --git a/src/dbus_activation.rs b/src/dbus_activation.rs index 99e2f9f..10857fa 100644 --- a/src/dbus_activation.rs +++ b/src/dbus_activation.rs @@ -45,7 +45,7 @@ pub fn subscription() -> Subscription( exec: S, env_vars: I, - app_id: Option<&str>, + _app_id: Option<&str>, terminal: bool, ) where S: AsRef, @@ -816,13 +816,17 @@ pub async fn spawn_desktop_exec( // https://systemd.io/DESKTOP_ENVIRONMENTS // // Similar to what Gnome sets, for now. - if let Some(pid) = crate::process::spawn(cmd).await { + if let Some(_pid) = crate::process::spawn(cmd).await { #[cfg(feature = "desktop-systemd-scope")] if let Ok(session) = zbus::Connection::session().await { if let Ok(systemd_manager) = SystemdMangerProxy::new(&session).await { let _ = systemd_manager .start_transient_unit( - &format!("app-cosmic-{}-{}.scope", app_id.unwrap_or(&executable), pid), + &format!( + "app-cosmic-{}-{}.scope", + _app_id.unwrap_or(&executable), + _pid + ), "fail", &[ ( @@ -833,7 +837,7 @@ pub async fn spawn_desktop_exec( ), ( "PIDs".to_string(), - zbus::zvariant::Value::from(vec![pid]) + zbus::zvariant::Value::from(vec![_pid]) .try_to_owned() .unwrap(), ), diff --git a/src/lib.rs b/src/lib.rs index 1eacb96..b1f893a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,17 @@ pub mod font; #[doc(inline)] pub use iced; +#[doc(inline)] +pub use iced_core; +#[doc(inline)] +pub use iced_futures; +#[doc(inline)] +pub use iced_runtime; +#[doc(inline)] +pub use iced_widget; +#[doc(inline)] +#[cfg(feature = "wayland")] +pub use iced_winit; pub mod icon_theme; pub mod keyboard_nav; diff --git a/src/widget/button/icon.rs b/src/widget/button/icon.rs index 04d2bdd..a0e0632 100644 --- a/src/widget/button/icon.rs +++ b/src/widget/button/icon.rs @@ -152,7 +152,7 @@ impl<'a, Message: Clone + 'static> From> for Element<'a, Mes ); } - let mut button = if builder.variant.vertical { + let button = if builder.variant.vertical { crate::widget::column::with_children(content) .padding(builder.padding) .spacing(builder.spacing) @@ -169,9 +169,11 @@ impl<'a, Message: Clone + 'static> From> for Element<'a, Mes }; #[cfg(feature = "a11y")] - { + let button = { + let mut button = button; button = button.name(builder.name).description(builder.description); - } + button + }; let button = button .padding(0) diff --git a/src/widget/button/image.rs b/src/widget/button/image.rs index ab51e66..c5a40fd 100644 --- a/src/widget/button/image.rs +++ b/src/widget/button/image.rs @@ -83,7 +83,7 @@ where .width(builder.width) .height(builder.height); - let mut button = super::custom_image_button(content, builder.variant.on_remove) + let button = super::custom_image_button(content, builder.variant.on_remove) .padding(0) .selected(builder.variant.selected) .id(builder.id) @@ -91,9 +91,11 @@ where .class(builder.class); #[cfg(feature = "a11y")] - { + let button = { + let mut button = button; button = button.name(builder.name).description(builder.description); - } + button + }; button.into() } diff --git a/src/widget/button/link.rs b/src/widget/button/link.rs index 9ce8126..9bcd748 100644 --- a/src/widget/button/link.rs +++ b/src/widget/button/link.rs @@ -66,7 +66,7 @@ pub fn icon() -> Handle { impl<'a, Message: Clone + 'static> From> for Element<'a, Message> { fn from(mut builder: Button<'a, Message>) -> Element<'a, Message> { - let mut button: super::Button<'a, Message> = row::with_capacity(2) + let button: super::Button<'a, Message> = row::with_capacity(2) .push({ // TODO: Avoid allocation crate::widget::text(builder.label.to_string()) @@ -94,13 +94,15 @@ impl<'a, Message: Clone + 'static> From> for Element<'a, Mes .class(builder.class); #[cfg(feature = "a11y")] - { + let button = { + let mut button = button; if !builder.label.is_empty() { button = button.name(builder.label); } button = button.description(builder.description); - } + button + }; if builder.tooltip.is_empty() { button.into() diff --git a/src/widget/button/text.rs b/src/widget/button/text.rs index bcdd02b..71cd1f5 100644 --- a/src/widget/button/text.rs +++ b/src/widget/button/text.rs @@ -119,7 +119,7 @@ impl<'a, Message: Clone + 'static> From> for Element<'a, Mes .into() }); - let mut button: super::Button<'a, Message> = row::with_capacity(3) + let button: super::Button<'a, Message> = row::with_capacity(3) // Optional icon to place before label. .push_maybe(leading_icon) // Optional label between icons. @@ -138,13 +138,15 @@ impl<'a, Message: Clone + 'static> From> for Element<'a, Mes .class(builder.class); #[cfg(feature = "a11y")] - { + let button = { + let mut button = button; if !builder.label.is_empty() { button = button.name(builder.label) } button = button.description(builder.description); - } + button + }; if builder.tooltip.is_empty() { button.into() diff --git a/src/widget/spin_button.rs b/src/widget/spin_button.rs index db05551..3ff0e7b 100644 --- a/src/widget/spin_button.rs +++ b/src/widget/spin_button.rs @@ -26,7 +26,7 @@ pub fn spin_button<'a, T, M>( where T: Copy + Sub + Add + PartialOrd, { - let mut button = SpinButton::new( + let button = SpinButton::new( label, value, step, @@ -37,9 +37,11 @@ where ); #[cfg(feature = "a11y")] - { + let button = { + let mut button = button; button = button.name(name.into()); - } + button + }; button } @@ -57,7 +59,7 @@ pub fn vertical<'a, T, M>( where T: Copy + Sub + Add + PartialOrd, { - let mut button = SpinButton::new( + let button = SpinButton::new( label, value, step, @@ -68,9 +70,11 @@ where ); #[cfg(feature = "a11y")] - { + let button = { + let mut button = button; button = button.name(name.into()); - } + button + }; button } diff --git a/src/widget/text_input/input.rs b/src/widget/text_input/input.rs index b0647c8..903c81d 100644 --- a/src/widget/text_input/input.rs +++ b/src/widget/text_input/input.rs @@ -2198,7 +2198,7 @@ pub fn update<'a, Message: Clone + 'static>( x, y, mime_types, - surface, + surface: _surface, }, )) if *rectangle == Some(dnd_id) => { cold(); @@ -2241,7 +2241,7 @@ pub fn update<'a, Message: Clone + 'static>( } } #[cfg(all(feature = "wayland", target_os = "linux"))] - Event::Dnd(DndEvent::Offer(rectangle, OfferEvent::Motion { x, y })) + Event::Dnd(DndEvent::Offer(rectangle, OfferEvent::Motion { x, y: _ })) if *rectangle == Some(dnd_id) => { let state = state();