diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index a6266b8..011bb07 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -364,7 +364,6 @@ where crate::surface::Action::Task(f) => { f().map(|sm| crate::Action::Cosmic(Action::Surface(sm))) } - _ => iced::Task::none(), } #[cfg(not(feature = "surface-message"))] diff --git a/src/core.rs b/src/core.rs index 44f3b3d..f80954f 100644 --- a/src/core.rs +++ b/src/core.rs @@ -78,8 +78,6 @@ pub struct Core { pub(super) portal_accent: Option, - pub(super) portal_is_high_contrast: Option, - pub(super) title: HashMap, pub window: Window, @@ -155,7 +153,6 @@ impl Default for Core { settings_daemon: None, portal_is_dark: None, portal_accent: None, - portal_is_high_contrast: None, main_window: None, exit_on_main_window_closed: true, menu_bars: HashMap::new(), diff --git a/src/widget/button/widget.rs b/src/widget/button/widget.rs index 084939f..a6dda25 100644 --- a/src/widget/button/widget.rs +++ b/src/widget/button/widget.rs @@ -748,12 +748,6 @@ impl State { self.is_focused } - /// Returns whether the [`Button`] is currently hovered or not. - #[inline] - pub fn is_hovered(self) -> bool { - self.is_hovered - } - /// Focuses the [`Button`]. #[inline] pub fn focus(&mut self) { diff --git a/src/widget/dropdown/multi/widget.rs b/src/widget/dropdown/multi/widget.rs index d72e42a..6ed7a02 100644 --- a/src/widget/dropdown/multi/widget.rs +++ b/src/widget/dropdown/multi/widget.rs @@ -6,7 +6,7 @@ use super::menu::{self, Menu}; use crate::widget::icon; use derive_setters::Setters; use iced_core::event::Event; -use iced_core::text::{self, Paragraph, Text}; +use iced_core::text::{self, Text}; use iced_core::widget::tree::{self, Tree}; use iced_core::{ Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, diff --git a/src/widget/menu/flex.rs b/src/widget/menu/flex.rs index 4a58f13..045e840 100644 --- a/src/widget/menu/flex.rs +++ b/src/widget/menu/flex.rs @@ -50,6 +50,7 @@ impl Axis { /// padding and alignment to the items as needed. /// /// It returns a new layout [`Node`]. +#[allow(dead_code)] // kept as public helper; not currently called by libcosmic pub fn resolve<'a, E, Message, Renderer>( axis: &Axis, renderer: &Renderer, diff --git a/src/widget/menu/menu_bar.rs b/src/widget/menu/menu_bar.rs index 88e398c..c8002c8 100644 --- a/src/widget/menu/menu_bar.rs +++ b/src/widget/menu/menu_bar.rs @@ -54,7 +54,6 @@ pub(crate) struct MenuBarStateInner { pub(crate) tree: Tree, pub(crate) popup_id: HashMap, pub(crate) pressed: bool, - pub(crate) bar_pressed: bool, pub(crate) view_cursor: Cursor, pub(crate) open: bool, pub(crate) active_root: Vec, @@ -91,7 +90,6 @@ impl Default for MenuBarStateInner { vertical_direction: Direction::Positive, menu_states: Vec::new(), popup_id: HashMap::new(), - bar_pressed: false, } } } @@ -168,14 +166,6 @@ where } } -pub fn get_mut_or_default(vec: &mut Vec, index: usize) -> &mut T { - if index < vec.len() { - &mut vec[index] - } else { - vec.resize_with(index + 1, T::default); - &mut vec[index] - } -} /// A `MenuBar` collects `MenuTree`s and handles all the layout, event processing, and drawing. #[allow(missing_debug_implementations)] diff --git a/src/widget/popover.rs b/src/widget/popover.rs index 2c932a7..c807393 100644 --- a/src/widget/popover.rs +++ b/src/widget/popover.rs @@ -476,12 +476,6 @@ where } } -/// The local state of a [`Popover`]. -#[derive(Debug, Default)] -struct State { - is_open: bool, -} - /// The first child in [`Popover::children`] is always the wrapped content. fn content_tree(tree: &Tree) -> &Tree { &tree.children[0] diff --git a/src/widget/segmented_button/widget.rs b/src/widget/segmented_button/widget.rs index 9ddd7d8..ea39ede 100644 --- a/src/widget/segmented_button/widget.rs +++ b/src/widget/segmented_button/widget.rs @@ -2364,7 +2364,7 @@ where } } -struct TabDragSource { +pub(super) struct TabDragSource { mime: String, threshold: f32, _marker: PhantomData, @@ -2415,7 +2415,6 @@ struct TabDragCandidate { #[derive(Debug, Clone, Copy)] struct Focus { updated_at: Instant, - now: Instant, } /// State that is maintained by each individual widget. @@ -2488,7 +2487,6 @@ impl LocalState { self.focused = Some(Focus { updated_at: now, - now, }); } } diff --git a/src/widget/spin_button.rs b/src/widget/spin_button.rs index 833e90b..db05551 100644 --- a/src/widget/spin_button.rs +++ b/src/widget/spin_button.rs @@ -63,7 +63,7 @@ where step, min, max, - Orientation::Horizontal, + Orientation::Vertical, on_press, ); diff --git a/src/widget/text_input/input.rs b/src/widget/text_input/input.rs index 5bddfee..6227d70 100644 --- a/src/widget/text_input/input.rs +++ b/src/widget/text_input/input.rs @@ -2794,11 +2794,11 @@ pub fn draw<'a, Message>( // draw the end icon in the text input if let (Some(icon), Some(tree)) = (trailing_icon, trailing_icon_tree) { let mut children = text_layout.children(); - let mut icon_layout = children.next().unwrap(); + children.next().unwrap(); // skip text layout if has_start_icon { - icon_layout = children.next().unwrap(); + children.next().unwrap(); // skip start-icon layout } - icon_layout = children.next().unwrap(); + let icon_layout = children.next().unwrap(); // trailing-icon layout icon.as_widget().draw( tree, diff --git a/src/widget/wayland/tooltip/widget.rs b/src/widget/wayland/tooltip/widget.rs index 0f9f79a..7bfd111 100644 --- a/src/widget/wayland/tooltip/widget.rs +++ b/src/widget/wayland/tooltip/widget.rs @@ -23,18 +23,10 @@ use iced_core::{ }; use iced_core::{Border, mouse}; use iced_core::{Shadow, overlay}; -use iced_core::{layout, svg}; +use iced_core::layout; pub use super::{Catalog, Style}; -/// Internally defines different button widget variants. -enum Variant { - Normal, - Image { - close_icon: svg::Handle, - on_remove: Option, - }, -} /// A generic button which emits a message when pressed. #[allow(missing_debug_implementations)]