yoda: bump iced submodule + cargo auto-fix sweeps (squashed)
Squash of 6 yoda commits: -282813c8yoda: bump iced -> window_clipboard via public Forgejo fork -cdf34938yoda: cargo fix --lib (libcosmic-yoda) — drop 99 trivial warnings -38a988cbyoda: cargo fix on cosmic-config + bump iced auto-fix commit -301bbf6eyoda: bump iced submodule -> iced_winit warning cleanup (0 left) -b94c03d9yoda: bump iced submodule -> iced_widget cleanup (0 left) -a9492d76yoda: bump iced submodule -> all iced crates at 0 warnings
This commit is contained in:
parent
ef8f69134f
commit
38acba82b4
20 changed files with 58 additions and 68 deletions
|
|
@ -408,7 +408,7 @@ where
|
||||||
f64::from(self.app.core().scale_factor())
|
f64::from(self.app.core().scale_factor())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn style(&self, theme: &Theme) -> theme::Style {
|
pub fn style(&self, _theme: &Theme) -> theme::Style {
|
||||||
if let Some(style) = self.app.style() {
|
if let Some(style) = self.app.style() {
|
||||||
style
|
style
|
||||||
} else if self.app.core().window.is_maximized {
|
} else if self.app.core().window.is_maximized {
|
||||||
|
|
@ -621,7 +621,7 @@ impl<T: Application> Cosmic<T> {
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
fn cosmic_update(&mut self, message: Action) -> iced::Task<crate::Action<T::Message>> {
|
fn cosmic_update(&mut self, message: Action) -> iced::Task<crate::Action<T::Message>> {
|
||||||
match message {
|
match message {
|
||||||
Action::WindowMaximized(id, maximized) => {
|
Action::WindowMaximized(_id, _maximized) => {
|
||||||
#[cfg(not(all(feature = "wayland", target_os = "linux")))]
|
#[cfg(not(all(feature = "wayland", target_os = "linux")))]
|
||||||
if self
|
if self
|
||||||
.app
|
.app
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ pub fn run<App: Application>(settings: Settings, flags: App::Flags) -> iced::Res
|
||||||
crate::malloc::limit_mmap_threshold(threshold);
|
crate::malloc::limit_mmap_threshold(threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
let default_font = settings.default_font;
|
let _default_font = settings.default_font;
|
||||||
let (settings, (mut core, flags), window_settings) = iced_settings::<App>(settings, flags);
|
let (settings, (mut core, flags), window_settings) = iced_settings::<App>(settings, flags);
|
||||||
#[cfg(not(feature = "multi-window"))]
|
#[cfg(not(feature = "multi-window"))]
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
use iced::Color;
|
use iced::Color;
|
||||||
use iced_core::Widget;
|
|
||||||
|
|
||||||
pub trait ElementExt {
|
pub trait ElementExt {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
use iced::Task;
|
|
||||||
use iced::mouse::ScrollDelta;
|
use iced::mouse::ScrollDelta;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
|
|
@ -95,7 +94,7 @@ impl Scroll {
|
||||||
} else {
|
} else {
|
||||||
// Return integer part of scroll, and keep remainder
|
// Return integer part of scroll, and keep remainder
|
||||||
self.scroll = Some((scroll.fract(), Instant::now()));
|
self.scroll = Some((scroll.fract(), Instant::now()));
|
||||||
let mut discrete = scroll.trunc() as isize;
|
let discrete = scroll.trunc() as isize;
|
||||||
if discrete != 0 {
|
if discrete != 0 {
|
||||||
self.last_discrete = Some(Instant::now());
|
self.last_discrete = Some(Instant::now());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -791,7 +791,7 @@ impl menu::Catalog for Theme {
|
||||||
|
|
||||||
fn default<'a>() -> <Self as menu::Catalog>::Class<'a> {}
|
fn default<'a>() -> <Self as menu::Catalog>::Class<'a> {}
|
||||||
|
|
||||||
fn style(&self, class: &<Self as menu::Catalog>::Class<'_>) -> menu::Style {
|
fn style(&self, _class: &<Self as menu::Catalog>::Class<'_>) -> menu::Style {
|
||||||
let cosmic = self.cosmic();
|
let cosmic = self.cosmic();
|
||||||
|
|
||||||
menu::Style {
|
menu::Style {
|
||||||
|
|
@ -815,7 +815,7 @@ impl pick_list::Catalog for Theme {
|
||||||
|
|
||||||
fn style(
|
fn style(
|
||||||
&self,
|
&self,
|
||||||
class: &<Self as pick_list::Catalog>::Class<'_>,
|
_class: &<Self as pick_list::Catalog>::Class<'_>,
|
||||||
status: pick_list::Status,
|
status: pick_list::Status,
|
||||||
) -> pick_list::Style {
|
) -> pick_list::Style {
|
||||||
let cosmic = &self.cosmic();
|
let cosmic = &self.cosmic();
|
||||||
|
|
@ -856,7 +856,7 @@ impl radio::Catalog for Theme {
|
||||||
|
|
||||||
fn default<'a>() -> Self::Class<'a> {}
|
fn default<'a>() -> Self::Class<'a> {}
|
||||||
|
|
||||||
fn style(&self, class: &Self::Class<'_>, status: radio::Status) -> radio::Style {
|
fn style(&self, _class: &Self::Class<'_>, status: radio::Status) -> radio::Style {
|
||||||
let cur_container = self.current_container();
|
let cur_container = self.current_container();
|
||||||
let theme = self.cosmic();
|
let theme = self.cosmic();
|
||||||
|
|
||||||
|
|
@ -909,7 +909,7 @@ impl toggler::Catalog for Theme {
|
||||||
|
|
||||||
fn default<'a>() -> Self::Class<'a> {}
|
fn default<'a>() -> Self::Class<'a> {}
|
||||||
|
|
||||||
fn style(&self, class: &Self::Class<'_>, status: toggler::Status) -> toggler::Style {
|
fn style(&self, _class: &Self::Class<'_>, status: toggler::Status) -> toggler::Style {
|
||||||
let cosmic = self.cosmic();
|
let cosmic = self.cosmic();
|
||||||
const HANDLE_MARGIN: f32 = 2.0;
|
const HANDLE_MARGIN: f32 = 2.0;
|
||||||
let neutral_10 = cosmic.palette.neutral_10.with_alpha(0.1);
|
let neutral_10 = cosmic.palette.neutral_10.with_alpha(0.1);
|
||||||
|
|
@ -937,8 +937,8 @@ impl toggler::Catalog for Theme {
|
||||||
padding_ratio: 0.0,
|
padding_ratio: 0.0,
|
||||||
};
|
};
|
||||||
match status {
|
match status {
|
||||||
toggler::Status::Active { is_toggled } => active,
|
toggler::Status::Active { is_toggled: _ } => active,
|
||||||
toggler::Status::Hovered { is_toggled } => {
|
toggler::Status::Hovered { is_toggled: _ } => {
|
||||||
let is_active = matches!(status, toggler::Status::Hovered { is_toggled: true });
|
let is_active = matches!(status, toggler::Status::Hovered { is_toggled: true });
|
||||||
toggler::Style {
|
toggler::Style {
|
||||||
background: if is_active {
|
background: if is_active {
|
||||||
|
|
@ -957,7 +957,7 @@ impl toggler::Catalog for Theme {
|
||||||
..active
|
..active
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toggler::Status::Disabled { is_toggled } => {
|
toggler::Status::Disabled { is_toggled: _ } => {
|
||||||
active.background = active.background.scale_alpha(0.5);
|
active.background = active.background.scale_alpha(0.5);
|
||||||
active.foreground = active.foreground.scale_alpha(0.5);
|
active.foreground = active.foreground.scale_alpha(0.5);
|
||||||
active
|
active
|
||||||
|
|
@ -974,7 +974,7 @@ impl pane_grid::Catalog for Theme {
|
||||||
|
|
||||||
fn default<'a>() -> <Self as pane_grid::Catalog>::Class<'a> {}
|
fn default<'a>() -> <Self as pane_grid::Catalog>::Class<'a> {}
|
||||||
|
|
||||||
fn style(&self, class: &<Self as pane_grid::Catalog>::Class<'_>) -> pane_grid::Style {
|
fn style(&self, _class: &<Self as pane_grid::Catalog>::Class<'_>) -> pane_grid::Style {
|
||||||
let theme = self.cosmic();
|
let theme = self.cosmic();
|
||||||
|
|
||||||
pane_grid::Style {
|
pane_grid::Style {
|
||||||
|
|
@ -1142,8 +1142,8 @@ impl scrollable::Catalog for Theme {
|
||||||
fn style(&self, class: &Self::Class<'_>, status: scrollable::Status) -> scrollable::Style {
|
fn style(&self, class: &Self::Class<'_>, status: scrollable::Status) -> scrollable::Style {
|
||||||
match status {
|
match status {
|
||||||
scrollable::Status::Active {
|
scrollable::Status::Active {
|
||||||
is_horizontal_scrollbar_disabled,
|
is_horizontal_scrollbar_disabled: _,
|
||||||
is_vertical_scrollbar_disabled,
|
is_vertical_scrollbar_disabled: _,
|
||||||
} => {
|
} => {
|
||||||
let cosmic = self.cosmic();
|
let cosmic = self.cosmic();
|
||||||
let neutral_5 = cosmic.palette.neutral_5.with_alpha(0.7);
|
let neutral_5 = cosmic.palette.neutral_5.with_alpha(0.7);
|
||||||
|
|
@ -1302,7 +1302,7 @@ impl svg::Catalog for Theme {
|
||||||
Svg::default()
|
Svg::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn style(&self, class: &Self::Class<'_>, status: svg::Status) -> svg::Style {
|
fn style(&self, class: &Self::Class<'_>, _status: svg::Status) -> svg::Style {
|
||||||
#[allow(clippy::match_same_arms)]
|
#[allow(clippy::match_same_arms)]
|
||||||
match class {
|
match class {
|
||||||
Svg::Default => svg::Style::default(),
|
Svg::Default => svg::Style::default(),
|
||||||
|
|
@ -1439,7 +1439,7 @@ impl text_input::Catalog for Theme {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text_input::Status::Focused { is_hovered } => {
|
text_input::Status::Focused { is_hovered: _ } => {
|
||||||
let bg = self.current_container().small_widget.with_alpha(0.25);
|
let bg = self.current_container().small_widget.with_alpha(0.25);
|
||||||
|
|
||||||
match class {
|
match class {
|
||||||
|
|
@ -1516,7 +1516,7 @@ impl iced_widget::text_editor::Catalog for Theme {
|
||||||
let selection = cosmic.accent.base.into();
|
let selection = cosmic.accent.base.into();
|
||||||
let value = cosmic.palette.neutral_9.into();
|
let value = cosmic.palette.neutral_9.into();
|
||||||
let placeholder = cosmic.palette.neutral_9.with_alpha(0.7).into();
|
let placeholder = cosmic.palette.neutral_9.with_alpha(0.7).into();
|
||||||
let icon: Color = cosmic.background.on.into();
|
let _icon: Color = cosmic.background.on.into();
|
||||||
// TODO do we need to add icon color back?
|
// TODO do we need to add icon color back?
|
||||||
|
|
||||||
match status {
|
match status {
|
||||||
|
|
@ -1533,7 +1533,7 @@ impl iced_widget::text_editor::Catalog for Theme {
|
||||||
value,
|
value,
|
||||||
selection,
|
selection,
|
||||||
},
|
},
|
||||||
iced_widget::text_editor::Status::Focused { is_hovered } => {
|
iced_widget::text_editor::Status::Focused { is_hovered: _ } => {
|
||||||
iced_widget::text_editor::Style {
|
iced_widget::text_editor::Style {
|
||||||
background: iced::Color::from(cosmic.bg_color()).into(),
|
background: iced::Color::from(cosmic.bg_color()).into(),
|
||||||
border: Border {
|
border: Border {
|
||||||
|
|
@ -1636,8 +1636,8 @@ impl Base for Theme {
|
||||||
crate::theme::ThemeType::Light => "Cosmic Light Theme",
|
crate::theme::ThemeType::Light => "Cosmic Light Theme",
|
||||||
crate::theme::ThemeType::HighContrastDark => "Cosmic High Contrast Dark Theme",
|
crate::theme::ThemeType::HighContrastDark => "Cosmic High Contrast Dark Theme",
|
||||||
crate::theme::ThemeType::HighContrastLight => "Cosmic High Contrast Light Theme",
|
crate::theme::ThemeType::HighContrastLight => "Cosmic High Contrast Light Theme",
|
||||||
crate::theme::ThemeType::Custom(theme) => "Custom Cosmic Theme",
|
crate::theme::ThemeType::Custom(_theme) => "Custom Cosmic Theme",
|
||||||
crate::theme::ThemeType::System { prefer_dark, theme } => &theme.name,
|
crate::theme::ThemeType::System { prefer_dark: _, theme } => &theme.name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ mod horizontal {
|
||||||
|
|
||||||
pub fn selection_active(
|
pub fn selection_active(
|
||||||
cosmic: &cosmic_theme::Theme,
|
cosmic: &cosmic_theme::Theme,
|
||||||
component: &Component,
|
_component: &Component,
|
||||||
) -> ItemStatusAppearance {
|
) -> ItemStatusAppearance {
|
||||||
let rad_xl = cosmic.corner_radii.radius_xl;
|
let rad_xl = cosmic.corner_radii.radius_xl;
|
||||||
let rad_0 = cosmic.corner_radii.radius_0;
|
let rad_0 = cosmic.corner_radii.radius_0;
|
||||||
|
|
@ -280,7 +280,7 @@ mod vertical {
|
||||||
|
|
||||||
pub fn selection_active(
|
pub fn selection_active(
|
||||||
cosmic: &cosmic_theme::Theme,
|
cosmic: &cosmic_theme::Theme,
|
||||||
component: &Component,
|
_component: &Component,
|
||||||
) -> ItemStatusAppearance {
|
) -> ItemStatusAppearance {
|
||||||
let rad_0 = cosmic.corner_radii.radius_0;
|
let rad_0 = cosmic.corner_radii.radius_0;
|
||||||
let rad_xl = cosmic.corner_radii.radius_xl;
|
let rad_xl = cosmic.corner_radii.radius_xl;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
use iced_runtime::core::widget::Id;
|
use iced_runtime::core::widget::Id;
|
||||||
use iced_runtime::{Action, Task, keyboard, task};
|
use iced_runtime::{Action, Task, keyboard, task};
|
||||||
|
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::renderer::{self, Quad, Renderer};
|
use iced_core::renderer::{self, Quad, Renderer};
|
||||||
use iced_core::widget::Operation;
|
use iced_core::widget::Operation;
|
||||||
use iced_core::widget::tree::{self, Tree};
|
use iced_core::widget::tree::{self, Tree};
|
||||||
|
|
@ -662,7 +662,7 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
|
||||||
height,
|
height,
|
||||||
} = layout.bounds();
|
} = layout.bounds();
|
||||||
let bounds = Rect::new(x as f64, y as f64, (x + width) as f64, (y + height) as f64);
|
let bounds = Rect::new(x as f64, y as f64, (x + width) as f64, (y + height) as f64);
|
||||||
let is_hovered = state.state.downcast_ref::<State>().is_hovered;
|
let _is_hovered = state.state.downcast_ref::<State>().is_hovered;
|
||||||
|
|
||||||
let mut node = Node::new(Role::Button);
|
let mut node = Node::new(Role::Button);
|
||||||
node.add_action(Action::Focus);
|
node.add_action(Action::Focus);
|
||||||
|
|
@ -822,7 +822,7 @@ pub fn update<'a, Message: Clone>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(feature = "a11y")]
|
#[cfg(feature = "a11y")]
|
||||||
Event::A11y(event_id, iced_accessibility::accesskit::ActionRequest { action, .. }) => {
|
Event::A11y(_event_id, iced_accessibility::accesskit::ActionRequest { action, .. }) => {
|
||||||
let state = state();
|
let state = state();
|
||||||
if let Some(on_press) = matches!(action, iced_accessibility::accesskit::Action::Click)
|
if let Some(on_press) = matches!(action, iced_accessibility::accesskit::Action::Click)
|
||||||
.then_some(on_press)
|
.then_some(on_press)
|
||||||
|
|
@ -865,7 +865,7 @@ pub fn draw<Renderer: iced_core::Renderer, Theme>(
|
||||||
viewport_bounds: Rectangle,
|
viewport_bounds: Rectangle,
|
||||||
styling: &super::style::Style,
|
styling: &super::style::Style,
|
||||||
draw_contents: impl FnOnce(&mut Renderer, &Style),
|
draw_contents: impl FnOnce(&mut Renderer, &Style),
|
||||||
is_image: bool,
|
_is_image: bool,
|
||||||
) where
|
) where
|
||||||
Theme: super::style::Catalog,
|
Theme: super::style::Catalog,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ where
|
||||||
/// Get an expandable stack of cards
|
/// Get an expandable stack of cards
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn new<F, G>(
|
pub fn new<F, G>(
|
||||||
id: widget::Id,
|
_id: widget::Id,
|
||||||
card_inner_elements: Vec<Element<'a, Message, crate::Theme, crate::Renderer>>,
|
card_inner_elements: Vec<Element<'a, Message, crate::Theme, crate::Renderer>>,
|
||||||
on_clear_all: Message,
|
on_clear_all: Message,
|
||||||
on_show_more: Option<F>,
|
on_show_more: Option<F>,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use crate::widget::segmented_button::Entity;
|
||||||
use crate::widget::{container, slider};
|
use crate::widget::{container, slider};
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use iced::Task;
|
use iced::Task;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::gradient::{ColorStop, Linear};
|
use iced_core::gradient::{ColorStop, Linear};
|
||||||
use iced_core::renderer::Quad;
|
use iced_core::renderer::Quad;
|
||||||
use iced_core::widget::{Tree, tree};
|
use iced_core::widget::{Tree, tree};
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ impl<Message: Clone + 'static> ContextMenu<'_, Message> {
|
||||||
bounds.x = my_state.context_cursor.x;
|
bounds.x = my_state.context_cursor.x;
|
||||||
bounds.y = my_state.context_cursor.y;
|
bounds.y = my_state.context_cursor.y;
|
||||||
|
|
||||||
let (id, root_list) = my_state.menu_bar_state.inner.with_data_mut(|state| {
|
let (id, _root_list) = my_state.menu_bar_state.inner.with_data_mut(|state| {
|
||||||
if let Some(id) = state.popup_id.get(&self.window_id).copied() {
|
if let Some(id) = state.popup_id.get(&self.window_id).copied() {
|
||||||
// close existing popups
|
// close existing popups
|
||||||
state.menu_states.clear();
|
state.menu_states.clear();
|
||||||
|
|
@ -147,7 +147,7 @@ impl<Message: Clone + 'static> ContextMenu<'_, Message> {
|
||||||
layout.bounds(),
|
layout.bounds(),
|
||||||
-bounds.height,
|
-bounds.height,
|
||||||
);
|
);
|
||||||
let (anchor_rect, gravity) = my_state.menu_bar_state.inner.with_data_mut(|state| {
|
let (anchor_rect, _gravity) = my_state.menu_bar_state.inner.with_data_mut(|state| {
|
||||||
use iced::Rectangle;
|
use iced::Rectangle;
|
||||||
|
|
||||||
state.popup_id.insert(self.window_id, id);
|
state.popup_id.insert(self.window_id, id);
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,8 @@ use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
pub use appearance::{Appearance, StyleSheet};
|
pub use appearance::{Appearance, StyleSheet};
|
||||||
|
|
||||||
use crate::surface;
|
|
||||||
use crate::widget::{Container, RcWrapper, icon};
|
use crate::widget::{Container, RcWrapper, icon};
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::layout::{self, Layout};
|
use iced_core::layout::{self, Layout};
|
||||||
use iced_core::text::{self, Text};
|
use iced_core::text::{self, Text};
|
||||||
use iced_core::widget::Tree;
|
use iced_core::widget::Tree;
|
||||||
|
|
@ -391,7 +390,7 @@ impl<'a, Message: Clone + 'a> crate::widget::Widget<Message, crate::Theme, crate
|
||||||
|
|
||||||
fn draw(
|
fn draw(
|
||||||
&self,
|
&self,
|
||||||
tree: &Tree,
|
_tree: &Tree,
|
||||||
renderer: &mut crate::Renderer,
|
renderer: &mut crate::Renderer,
|
||||||
theme: &crate::Theme,
|
theme: &crate::Theme,
|
||||||
style: &renderer::Style,
|
style: &renderer::Style,
|
||||||
|
|
@ -554,12 +553,12 @@ where
|
||||||
|
|
||||||
fn draw(
|
fn draw(
|
||||||
&self,
|
&self,
|
||||||
state: &Tree,
|
_state: &Tree,
|
||||||
renderer: &mut crate::Renderer,
|
renderer: &mut crate::Renderer,
|
||||||
theme: &crate::Theme,
|
theme: &crate::Theme,
|
||||||
style: &renderer::Style,
|
_style: &renderer::Style,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
cursor: mouse::Cursor,
|
_cursor: mouse::Cursor,
|
||||||
viewport: &Rectangle,
|
viewport: &Rectangle,
|
||||||
) {
|
) {
|
||||||
let appearance = theme.appearance(&());
|
let appearance = theme.appearance(&());
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use super::Model;
|
||||||
pub use crate::widget::dropdown::menu::{Appearance, StyleSheet};
|
pub use crate::widget::dropdown::menu::{Appearance, StyleSheet};
|
||||||
|
|
||||||
use crate::widget::Container;
|
use crate::widget::Container;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::layout::{self, Layout};
|
use iced_core::layout::{self, Layout};
|
||||||
use iced_core::text::{self, Text};
|
use iced_core::text::{self, Text};
|
||||||
use iced_core::widget::Tree;
|
use iced_core::widget::Tree;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
use super::menu::{self, Menu};
|
use super::menu::{self, Menu};
|
||||||
use crate::widget::icon;
|
use crate::widget::icon;
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::text::{self, Paragraph, Text};
|
use iced_core::text::{self, Paragraph, Text};
|
||||||
use iced_core::widget::tree::{self, Tree};
|
use iced_core::widget::tree::{self, Tree};
|
||||||
use iced_core::{
|
use iced_core::{
|
||||||
|
|
@ -13,7 +13,6 @@ use iced_core::{
|
||||||
alignment, keyboard, layout, mouse, overlay, renderer, svg, touch,
|
alignment, keyboard, layout, mouse, overlay, renderer, svg, touch,
|
||||||
};
|
};
|
||||||
use iced_widget::pick_list;
|
use iced_widget::pick_list;
|
||||||
use std::ffi::OsStr;
|
|
||||||
|
|
||||||
pub use iced_widget::pick_list::{Catalog, Style};
|
pub use iced_widget::pick_list::{Catalog, Style};
|
||||||
|
|
||||||
|
|
@ -253,7 +252,7 @@ impl<Item: Clone + PartialEq + 'static> Default for State<Item> {
|
||||||
/// Computes the layout of a [`Dropdown`].
|
/// Computes the layout of a [`Dropdown`].
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn layout(
|
pub fn layout(
|
||||||
renderer: &crate::Renderer,
|
_renderer: &crate::Renderer,
|
||||||
limits: &layout::Limits,
|
limits: &layout::Limits,
|
||||||
width: Length,
|
width: Length,
|
||||||
gap: f32,
|
gap: f32,
|
||||||
|
|
@ -376,7 +375,7 @@ pub fn mouse_interaction(layout: Layout<'_>, cursor: mouse::Cursor) -> mouse::In
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn overlay<'a, S: AsRef<str>, Message: 'a, Item: Clone + PartialEq + 'static>(
|
pub fn overlay<'a, S: AsRef<str>, Message: 'a, Item: Clone + PartialEq + 'static>(
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
renderer: &crate::Renderer,
|
_renderer: &crate::Renderer,
|
||||||
state: &'a mut State<Item>,
|
state: &'a mut State<Item>,
|
||||||
gap: f32,
|
gap: f32,
|
||||||
padding: Padding,
|
padding: Padding,
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||||
//! Operate on dropdown widgets.
|
//! Operate on dropdown widgets.
|
||||||
|
|
||||||
use super::State;
|
|
||||||
use iced::Rectangle;
|
|
||||||
use iced_core::widget::{Id, Operation};
|
|
||||||
|
|
||||||
pub trait Dropdown {
|
pub trait Dropdown {
|
||||||
fn close(&mut self);
|
fn close(&mut self);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use crate::widget::icon::{self, Handle};
|
||||||
use crate::{Element, surface};
|
use crate::{Element, surface};
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use iced::window;
|
use iced::window;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::text::{self, Paragraph, Text};
|
use iced_core::text::{self, Paragraph, Text};
|
||||||
use iced_core::widget::tree::{self, Tree};
|
use iced_core::widget::tree::{self, Tree};
|
||||||
use iced_core::{
|
use iced_core::{
|
||||||
|
|
@ -17,7 +17,6 @@ use iced_core::{
|
||||||
};
|
};
|
||||||
use iced_widget::pick_list::{self, Catalog};
|
use iced_widget::pick_list::{self, Catalog};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::ffi::OsStr;
|
|
||||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::{Arc, LazyLock, Mutex};
|
use std::sync::{Arc, LazyLock, Mutex};
|
||||||
|
|
@ -328,10 +327,10 @@ where
|
||||||
|
|
||||||
fn operate(
|
fn operate(
|
||||||
&mut self,
|
&mut self,
|
||||||
tree: &mut Tree,
|
_tree: &mut Tree,
|
||||||
_layout: Layout<'_>,
|
_layout: Layout<'_>,
|
||||||
_renderer: &crate::Renderer,
|
_renderer: &crate::Renderer,
|
||||||
operation: &mut dyn iced_core::widget::Operation,
|
_operation: &mut dyn iced_core::widget::Operation,
|
||||||
) {
|
) {
|
||||||
// TODO: double check operation handling
|
// TODO: double check operation handling
|
||||||
// let state = tree.state.downcast_mut::<State>();
|
// let state = tree.state.downcast_mut::<State>();
|
||||||
|
|
@ -343,7 +342,7 @@ where
|
||||||
tree: &'b mut Tree,
|
tree: &'b mut Tree,
|
||||||
layout: Layout<'b>,
|
layout: Layout<'b>,
|
||||||
renderer: &crate::Renderer,
|
renderer: &crate::Renderer,
|
||||||
viewport: &Rectangle,
|
_viewport: &Rectangle,
|
||||||
translation: Vector,
|
translation: Vector,
|
||||||
) -> Option<overlay::Element<'b, Message, crate::Theme, crate::Renderer>> {
|
) -> Option<overlay::Element<'b, Message, crate::Theme, crate::Renderer>> {
|
||||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||||
|
|
@ -452,7 +451,7 @@ impl super::operation::Dropdown for State {
|
||||||
/// Computes the layout of a [`Dropdown`].
|
/// Computes the layout of a [`Dropdown`].
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn layout(
|
pub fn layout(
|
||||||
renderer: &crate::Renderer,
|
_renderer: &crate::Renderer,
|
||||||
limits: &layout::Limits,
|
limits: &layout::Limits,
|
||||||
width: Length,
|
width: Length,
|
||||||
gap: f32,
|
gap: f32,
|
||||||
|
|
@ -546,7 +545,7 @@ pub fn update<
|
||||||
cursor: mouse::Cursor,
|
cursor: mouse::Cursor,
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
_positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||||
on_selected: Arc<dyn Fn(usize) -> Message + Send + Sync + 'static>,
|
on_selected: Arc<dyn Fn(usize) -> Message + Send + Sync + 'static>,
|
||||||
selected: Option<usize>,
|
selected: Option<usize>,
|
||||||
selections: &[S],
|
selections: &[S],
|
||||||
|
|
@ -558,7 +557,7 @@ pub fn update<
|
||||||
gap: f32,
|
gap: f32,
|
||||||
padding: Padding,
|
padding: Padding,
|
||||||
text_size: Option<f32>,
|
text_size: Option<f32>,
|
||||||
font: Option<crate::font::Font>,
|
_font: Option<crate::font::Font>,
|
||||||
selected_option: Option<usize>,
|
selected_option: Option<usize>,
|
||||||
) {
|
) {
|
||||||
let state = state();
|
let state = state();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
use crate::{Element, Renderer};
|
use crate::{Element, Renderer};
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::widget::{Operation, Tree};
|
use iced_core::widget::{Operation, Tree};
|
||||||
use iced_core::{
|
use iced_core::{
|
||||||
Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse, overlay,
|
Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse, overlay,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
use crate::{Element, Renderer};
|
use crate::{Element, Renderer};
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::widget::{Operation, Tree};
|
use iced_core::widget::{Operation, Tree};
|
||||||
use iced_core::{
|
use iced_core::{
|
||||||
Alignment, Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse,
|
Alignment, Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/// Icon bundling is not enabled on unix platforms.
|
/// Icon bundling is not enabled on unix platforms.
|
||||||
#[cfg(all(unix, not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
pub fn get(icon_name: &str) -> Option<super::Data> {
|
pub fn get(_icon_name: &str) -> Option<super::Data> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,8 +119,6 @@ pub mod calendar;
|
||||||
pub use calendar::{Calendar, calendar};
|
pub use calendar::{Calendar, calendar};
|
||||||
|
|
||||||
pub mod card;
|
pub mod card;
|
||||||
#[doc(inline)]
|
|
||||||
pub use card::*;
|
|
||||||
|
|
||||||
pub mod color_picker;
|
pub mod color_picker;
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,12 @@ use apply::Apply;
|
||||||
use iced::Limits;
|
use iced::Limits;
|
||||||
use iced::clipboard::dnd::{DndAction, DndEvent, OfferEvent, SourceEvent};
|
use iced::clipboard::dnd::{DndAction, DndEvent, OfferEvent, SourceEvent};
|
||||||
use iced::clipboard::mime::AsMimeTypes;
|
use iced::clipboard::mime::AsMimeTypes;
|
||||||
use iced_core::event::{self, Event};
|
use iced_core::event::Event;
|
||||||
use iced_core::input_method::{self, InputMethod, Preedit};
|
use iced_core::input_method::{self, InputMethod, Preedit};
|
||||||
use iced_core::mouse::{self, click};
|
use iced_core::mouse::{self, click};
|
||||||
use iced_core::overlay::Group;
|
use iced_core::overlay::Group;
|
||||||
use iced_core::renderer::{self, Renderer as CoreRenderer};
|
use iced_core::renderer::{self, Renderer as CoreRenderer};
|
||||||
use iced_core::text::{self, Affinity, Paragraph, Renderer, Text};
|
use iced_core::text::{self, Paragraph, Renderer, Text};
|
||||||
use iced_core::time::{Duration, Instant};
|
use iced_core::time::{Duration, Instant};
|
||||||
use iced_core::widget::Id;
|
use iced_core::widget::Id;
|
||||||
use iced_core::widget::operation::{self, Operation};
|
use iced_core::widget::operation::{self, Operation};
|
||||||
|
|
@ -825,7 +825,7 @@ where
|
||||||
&mut self,
|
&mut self,
|
||||||
tree: &mut Tree,
|
tree: &mut Tree,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
renderer: &crate::Renderer,
|
_renderer: &crate::Renderer,
|
||||||
operation: &mut dyn Operation,
|
operation: &mut dyn Operation,
|
||||||
) {
|
) {
|
||||||
operation.container(Some(&self.id), layout.bounds());
|
operation.container(Some(&self.id), layout.bounds());
|
||||||
|
|
@ -917,7 +917,7 @@ where
|
||||||
// Enable custom buttons defined on the trailing icon position to be handled.
|
// Enable custom buttons defined on the trailing icon position to be handled.
|
||||||
if !self.is_editable_variant {
|
if !self.is_editable_variant {
|
||||||
if let Some(trailing_layout) = trailing_icon_layout {
|
if let Some(trailing_layout) = trailing_icon_layout {
|
||||||
let res = trailing_icon.as_widget_mut().update(
|
let _res = trailing_icon.as_widget_mut().update(
|
||||||
tree,
|
tree,
|
||||||
event,
|
event,
|
||||||
trailing_layout,
|
trailing_layout,
|
||||||
|
|
@ -2216,7 +2216,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
||||||
)) if *rectangle == Some(dnd_id) => {
|
)) if *rectangle == Some(dnd_id) => {
|
||||||
cold();
|
cold();
|
||||||
let state = state();
|
let state = state();
|
||||||
let is_clicked = text_layout.bounds().contains(Point {
|
let _is_clicked = text_layout.bounds().contains(Point {
|
||||||
x: *x as f32,
|
x: *x as f32,
|
||||||
y: *y as f32,
|
y: *y as f32,
|
||||||
});
|
});
|
||||||
|
|
@ -2224,7 +2224,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
||||||
let mut accepted = false;
|
let mut accepted = false;
|
||||||
for m in mime_types {
|
for m in mime_types {
|
||||||
if SUPPORTED_TEXT_MIME_TYPES.contains(&m.as_str()) {
|
if SUPPORTED_TEXT_MIME_TYPES.contains(&m.as_str()) {
|
||||||
let clone = m.clone();
|
let _clone = m.clone();
|
||||||
accepted = true;
|
accepted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2287,7 +2287,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
||||||
cold();
|
cold();
|
||||||
let state = state();
|
let state = state();
|
||||||
if let DndOfferState::HandlingOffer(mime_types, _action) = state.dnd_offer.clone() {
|
if let DndOfferState::HandlingOffer(mime_types, _action) = state.dnd_offer.clone() {
|
||||||
let Some(mime_type) = SUPPORTED_TEXT_MIME_TYPES
|
let Some(_mime_type) = SUPPORTED_TEXT_MIME_TYPES
|
||||||
.iter()
|
.iter()
|
||||||
.find(|&&m| mime_types.iter().any(|t| t == m))
|
.find(|&&m| mime_types.iter().any(|t| t == m))
|
||||||
else {
|
else {
|
||||||
|
|
@ -2304,7 +2304,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
||||||
Event::Dnd(DndEvent::Offer(id, OfferEvent::LeaveDestination)) if Some(dnd_id) != *id => {}
|
Event::Dnd(DndEvent::Offer(id, OfferEvent::LeaveDestination)) if Some(dnd_id) != *id => {}
|
||||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||||
Event::Dnd(DndEvent::Offer(
|
Event::Dnd(DndEvent::Offer(
|
||||||
rectangle,
|
_rectangle,
|
||||||
OfferEvent::Leave | OfferEvent::LeaveDestination,
|
OfferEvent::Leave | OfferEvent::LeaveDestination,
|
||||||
)) => {
|
)) => {
|
||||||
cold();
|
cold();
|
||||||
|
|
@ -2607,7 +2607,7 @@ pub fn draw<'a, Message>(
|
||||||
let handling_dnd_offer = !matches!(state.dnd_offer, DndOfferState::None);
|
let handling_dnd_offer = !matches!(state.dnd_offer, DndOfferState::None);
|
||||||
#[cfg(not(all(feature = "wayland", target_os = "linux")))]
|
#[cfg(not(all(feature = "wayland", target_os = "linux")))]
|
||||||
let handling_dnd_offer = false;
|
let handling_dnd_offer = false;
|
||||||
let (cursors, offset, is_selecting) = if let Some(focus) =
|
let (cursors, offset, _is_selecting) = if let Some(focus) =
|
||||||
state.is_focused.filter(|f| f.focused).or_else(|| {
|
state.is_focused.filter(|f| f.focused).or_else(|| {
|
||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
handling_dnd_offer.then_some(Focus {
|
handling_dnd_offer.then_some(Focus {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue