chore: format for 2024 edition

This commit is contained in:
Michael Aaron Murphy 2025-03-21 13:33:07 +01:00
parent 8cf372c9b9
commit 0aa518984e
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
57 changed files with 196 additions and 199 deletions

View file

@ -7,10 +7,9 @@
use iced::application; use iced::application;
use iced::window; use iced::window;
use iced::{ use iced::{
self, self, Program,
program::{self, with_style, with_subscription, with_theme, with_title}, program::{self, with_style, with_subscription, with_theme, with_title},
runtime::{Appearance, DefaultStyle}, runtime::{Appearance, DefaultStyle},
Program,
}; };
use iced::{Element, Result, Settings, Subscription, Task}; use iced::{Element, Result, Settings, Subscription, Task};

View file

@ -3,9 +3,9 @@
//! Configure a new COSMIC application. //! Configure a new COSMIC application.
use crate::{font, Theme}; use crate::{Theme, font};
use iced_core::layout::Limits;
use iced_core::Font; use iced_core::Font;
use iced_core::layout::Limits;
/// Configure a new COSMIC application. /// Configure a new COSMIC application.
#[allow(clippy::struct_excessive_bools)] #[allow(clippy::struct_excessive_bools)]

View file

@ -2,22 +2,22 @@
pub mod token; pub mod token;
use crate::{ use crate::{
Application, Element, Renderer,
app::iced_settings, app::iced_settings,
cctk::sctk, cctk::sctk,
iced::{ iced::{
self, self, Color, Length, Limits, Rectangle,
alignment::{Horizontal, Vertical}, alignment::{Horizontal, Vertical},
widget::Container, widget::Container,
window, Color, Length, Limits, Rectangle, window,
}, },
iced_widget, iced_widget,
theme::{self, system_dark, system_light, Button, THEME}, theme::{self, Button, THEME, system_dark, system_light},
widget::{ widget::{
self, self,
autosize::{self, autosize, Autosize}, autosize::{self, Autosize, autosize},
layer_container, layer_container,
}, },
Application, Element, Renderer,
}; };
pub use cosmic_panel_config; pub use cosmic_panel_config;
use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize}; use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize};

View file

@ -2,8 +2,8 @@ use crate::iced;
use crate::iced_futures::futures; use crate::iced_futures::futures;
use cctk::sctk::reexports::calloop; use cctk::sctk::reexports::calloop;
use futures::{ use futures::{
channel::mpsc::{unbounded, UnboundedReceiver},
SinkExt, StreamExt, SinkExt, StreamExt,
channel::mpsc::{UnboundedReceiver, unbounded},
}; };
use iced::Subscription; use iced::Subscription;
use iced_futures::stream; use iced_futures::stream;

View file

@ -21,7 +21,7 @@ use sctk::{
activation::{ActivationHandler, ActivationState}, activation::{ActivationHandler, ActivationState},
registry::{ProvidesRegistryState, RegistryState}, registry::{ProvidesRegistryState, RegistryState},
}; };
use wayland_client::{globals::registry_queue_init, Connection, QueueHandle}; use wayland_client::{Connection, QueueHandle, globals::registry_queue_init};
struct AppData { struct AppData {
exit: bool, exit: bool,

View file

@ -7,10 +7,10 @@
//! example in our repository. //! example in our repository.
#[cfg(feature = "xdg-portal")] #[cfg(feature = "xdg-portal")]
pub use portal::{file, files, folder, folders, FileResponse, MultiFileResponse}; pub use portal::{FileResponse, MultiFileResponse, file, files, folder, folders};
#[cfg(feature = "rfd")] #[cfg(feature = "rfd")]
pub use rust_fd::{file, files, folder, folders, FileResponse, MultiFileResponse}; pub use rust_fd::{FileResponse, MultiFileResponse, file, files, folder, folders};
use super::Error; use super::Error;
use std::path::PathBuf; use std::path::PathBuf;

View file

@ -7,10 +7,10 @@
//! example in our repository. //! example in our repository.
#[cfg(feature = "xdg-portal")] #[cfg(feature = "xdg-portal")]
pub use portal::{file, Response}; pub use portal::{Response, file};
#[cfg(feature = "rfd")] #[cfg(feature = "rfd")]
pub use rust_fd::{file, Response}; pub use rust_fd::{Response, file};
use super::Error; use super::Error;
use std::path::PathBuf; use std::path::PathBuf;

View file

@ -6,9 +6,9 @@
/// Recommended default imports. /// Recommended default imports.
pub mod prelude { pub mod prelude {
pub use crate::ext::*;
#[cfg(feature = "winit")] #[cfg(feature = "winit")]
pub use crate::ApplicationExt; pub use crate::ApplicationExt;
pub use crate::ext::*;
pub use crate::{Also, Apply, Element, Renderer, Task, Theme}; pub use crate::{Also, Apply, Element, Renderer, Task, Theme};
} }
@ -107,7 +107,7 @@ pub mod task;
pub mod theme; pub mod theme;
#[doc(inline)] #[doc(inline)]
pub use theme::{style, Theme}; pub use theme::{Theme, style};
pub mod widget; pub mod widget;
type Plain = iced_core::text::paragraph::Plain<<Renderer as iced_core::text::Renderer>::Paragraph>; type Plain = iced_core::text::paragraph::Plain<<Renderer as iced_core::text::Renderer>::Paragraph>;

View file

@ -24,9 +24,9 @@ pub fn destroy_subsurface(id: iced_core::window::Id) -> Action {
#[must_use] #[must_use]
pub fn app_popup<App: Application>( pub fn app_popup<App: Application>(
settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings
+ Send + Send
+ Sync + Sync
+ 'static, + 'static,
view: Option< view: Option<
Box< Box<
dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action<App::Message>> dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action<App::Message>>
@ -58,9 +58,9 @@ pub fn app_popup<App: Application>(
#[must_use] #[must_use]
pub fn simple_subsurface<Message: 'static, V>( pub fn simple_subsurface<Message: 'static, V>(
settings: impl Fn() -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings settings: impl Fn() -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings
+ Send + Send
+ Sync + Sync
+ 'static, + 'static,
view: Option< view: Option<
Box<dyn Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static>, Box<dyn Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static>,
>, >,
@ -87,9 +87,9 @@ pub fn simple_subsurface<Message: 'static, V>(
#[must_use] #[must_use]
pub fn simple_popup<Message: 'static, V>( pub fn simple_popup<Message: 'static, V>(
settings: impl Fn() -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings settings: impl Fn() -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings
+ Send + Send
+ Sync + Sync
+ 'static, + 'static,
view: Option< view: Option<
impl Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static, impl Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static,
>, >,
@ -117,10 +117,13 @@ pub fn simple_popup<Message: 'static, V>(
#[cfg(all(feature = "wayland", feature = "winit"))] #[cfg(all(feature = "wayland", feature = "winit"))]
#[must_use] #[must_use]
pub fn subsurface<App: Application>( pub fn subsurface<App: Application>(
settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings settings: impl Fn(
+ Send &mut App,
+ Sync )
+ 'static, -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings
+ Send
+ Sync
+ 'static,
// XXX Boxed trait object is required for less cumbersome type inference, but we box it anyways. // XXX Boxed trait object is required for less cumbersome type inference, but we box it anyways.
view: Option< view: Option<
Box< Box<

View file

@ -1,8 +1,8 @@
// Copyright 2023 System76 <info@system76.com> // Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use crate::widget::dropdown;
use crate::Theme; use crate::Theme;
use crate::widget::dropdown;
use iced::{Background, Color}; use iced::{Background, Color};
impl dropdown::menu::StyleSheet for Theme { impl dropdown::menu::StyleSheet for Theme {

View file

@ -3,7 +3,7 @@
//! Contains stylesheet implementations for widgets native to iced. //! Contains stylesheet implementations for widgets native to iced.
use crate::theme::{CosmicComponent, Theme, TRANSPARENT_COMPONENT}; use crate::theme::{CosmicComponent, TRANSPARENT_COMPONENT, Theme};
use cosmic_theme::composite::over; use cosmic_theme::composite::over;
use iced::{ use iced::{
overlay::menu, overlay::menu,

View file

@ -6,7 +6,7 @@
use crate::widget::segmented_button::{Appearance, ItemAppearance, StyleSheet}; use crate::widget::segmented_button::{Appearance, ItemAppearance, StyleSheet};
use crate::{theme::Theme, widget::segmented_button::ItemStatusAppearance}; use crate::{theme::Theme, widget::segmented_button::ItemStatusAppearance};
use cosmic_theme::{Component, Container}; use cosmic_theme::{Component, Container};
use iced_core::{border::Radius, Background}; use iced_core::{Background, border::Radius};
#[derive(Default)] #[derive(Default)]
pub enum SegmentedButton { pub enum SegmentedButton {
@ -165,7 +165,7 @@ impl StyleSheet for Theme {
mod horizontal { mod horizontal {
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance}; use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
use cosmic_theme::Component; use cosmic_theme::Component;
use iced_core::{border::Radius, Background}; use iced_core::{Background, border::Radius};
pub fn selection_active( pub fn selection_active(
cosmic: &cosmic_theme::Theme, cosmic: &cosmic_theme::Theme,
@ -252,7 +252,7 @@ pub fn hover(
mod vertical { mod vertical {
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance}; use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
use cosmic_theme::Component; use cosmic_theme::Component;
use iced_core::{border::Radius, Background}; use iced_core::{Background, border::Radius};
pub fn selection_active( pub fn selection_active(
cosmic: &cosmic_theme::Theme, cosmic: &cosmic_theme::Theme,

View file

@ -1,8 +1,8 @@
use { use {
crate::{ crate::{
Element,
iced::{Alignment, Length}, iced::{Alignment, Length},
widget::{self, horizontal_space}, widget::{self, horizontal_space},
Element,
}, },
license::License, license::License,
}; };

View file

@ -5,12 +5,12 @@
use super::Builder; use super::Builder;
use super::ButtonClass; use super::ButtonClass;
use crate::Element;
use crate::prelude::*; use crate::prelude::*;
use crate::widget::icon::{self, Handle}; use crate::widget::icon::{self, Handle};
use crate::widget::{button, row, tooltip}; use crate::widget::{button, row, tooltip};
use crate::Element;
use iced_core::text::LineHeight; use iced_core::text::LineHeight;
use iced_core::{font::Weight, widget::Id, Alignment, Length, Padding}; use iced_core::{Alignment, Length, Padding, font::Weight, widget::Id};
use std::borrow::Cow; use std::borrow::Cow;
pub type Button<'a, Message> = Builder<'a, Message, Hyperlink>; pub type Button<'a, Message> = Builder<'a, Message, Hyperlink>;

View file

@ -8,21 +8,21 @@ pub use crate::theme::Button as ButtonClass;
pub mod link; pub mod link;
use derive_setters::Setters; use derive_setters::Setters;
#[doc(inline)] #[doc(inline)]
pub use link::link;
#[doc(inline)]
pub use link::Button as LinkButton; pub use link::Button as LinkButton;
#[doc(inline)]
pub use link::link;
mod icon; mod icon;
#[doc(inline)] #[doc(inline)]
pub use icon::icon;
#[doc(inline)]
pub use icon::Button as IconButton; pub use icon::Button as IconButton;
#[doc(inline)]
pub use icon::icon;
mod image; mod image;
#[doc(inline)] #[doc(inline)]
pub use image::image;
#[doc(inline)]
pub use image::Button as ImageButton; pub use image::Button as ImageButton;
#[doc(inline)]
pub use image::image;
mod style; mod style;
#[doc(inline)] #[doc(inline)]
@ -36,7 +36,7 @@ pub use text::{destructive, standard, suggested, text};
mod widget; mod widget;
#[doc(inline)] #[doc(inline)]
pub use widget::{draw, focus, layout, mouse_interaction, Button}; pub use widget::{Button, draw, focus, layout, mouse_interaction};
use iced_core::font::Weight; use iced_core::font::Weight;
use iced_core::widget::Id; use iced_core::widget::Id;

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
//! Change the apperance of a button. //! Change the apperance of a button.
use iced_core::{border::Radius, Background, Color, Vector}; use iced_core::{Background, Color, Vector, border::Radius};
use crate::theme::THEME; use crate::theme::THEME;

View file

@ -4,7 +4,7 @@
use super::{Builder, ButtonClass}; use super::{Builder, ButtonClass};
use crate::widget::{icon, row, tooltip}; use crate::widget::{icon, row, tooltip};
use crate::{Apply, Element}; use crate::{Apply, Element};
use iced_core::{font::Weight, text::LineHeight, widget::Id, Alignment, Length, Padding}; use iced_core::{Alignment, Length, Padding, font::Weight, text::LineHeight, widget::Id};
use std::borrow::Cow; use std::borrow::Cow;
pub type Button<'a, Message> = Builder<'a, Message, Text>; pub type Button<'a, Message> = Builder<'a, Message, Text>;

View file

@ -9,30 +9,30 @@ use std::rc::Rc;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use crate::Element;
use crate::theme::iced::Slider; use crate::theme::iced::Slider;
use crate::theme::{Button, THEME}; use crate::theme::{Button, THEME};
use crate::widget::{button::Catalog, container, segmented_button::Entity, slider}; use crate::widget::{button::Catalog, container, segmented_button::Entity, slider};
use crate::Element;
use derive_setters::Setters; use derive_setters::Setters;
use iced::Task; use iced::Task;
use iced_core::event::{self, Event}; use iced_core::event::{self, 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};
use iced_core::{ use iced_core::{
layout, mouse, renderer, Background, Border, Clipboard, Color, Layout, Length, Radians, Background, Border, Clipboard, Color, Layout, Length, Radians, Rectangle, Renderer, Shadow,
Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget, Shell, Size, Vector, Widget, layout, mouse, renderer,
}; };
use iced_widget::slider::HandleShape; use iced_widget::slider::HandleShape;
use iced_widget::{canvas, column, horizontal_space, row, scrollable, vertical_space, Row}; use iced_widget::{Row, canvas, column, horizontal_space, row, scrollable, vertical_space};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use palette::{FromColor, RgbHue}; use palette::{FromColor, RgbHue};
use super::divider::horizontal; use super::divider::horizontal;
use super::icon::{self, from_name}; use super::icon::{self, from_name};
use super::segmented_button::{self, SingleSelect}; use super::segmented_button::{self, SingleSelect};
use super::{button, segmented_control, text, text_input, tooltip, Icon}; use super::{Icon, button, segmented_control, text, text_input, tooltip};
#[doc(inline)] #[doc(inline)]
pub use ColorPickerModel as Model; pub use ColorPickerModel as Model;

View file

@ -5,9 +5,9 @@ use crate::Element;
use iced::advanced::layout::{self, Layout}; use iced::advanced::layout::{self, Layout};
use iced::advanced::widget::{self, Operation}; use iced::advanced::widget::{self, Operation};
use iced::advanced::{overlay, renderer};
use iced::advanced::{Clipboard, Shell}; use iced::advanced::{Clipboard, Shell};
use iced::{event, mouse, Event, Point, Rectangle, Size}; use iced::advanced::{overlay, renderer};
use iced::{Event, Point, Rectangle, Size, event, mouse};
use iced_core::Renderer; use iced_core::Renderer;
pub(super) struct Overlay<'a, 'b, Message> { pub(super) struct Overlay<'a, 'b, Message> {

View file

@ -9,8 +9,8 @@ use crate::widget::menu::{
use derive_setters::Setters; use derive_setters::Setters;
use iced::touch::Finger; use iced::touch::Finger;
use iced::{Event, Vector}; use iced::{Event, Vector};
use iced_core::widget::{tree, Tree, Widget}; use iced_core::widget::{Tree, Widget, tree};
use iced_core::{event, mouse, touch, Length, Point, Size}; use iced_core::{Length, Point, Size, event, mouse, touch};
use std::collections::HashSet; use std::collections::HashSet;
/// A context menu is a menu in a graphical user interface that appears upon user interaction, such as a right-click mouse operation. /// A context menu is a menu in a graphical user interface that appears upon user interaction, such as a right-click mouse operation.

View file

@ -1,4 +1,4 @@
use crate::{iced::Length, style, theme, widget, Element}; use crate::{Element, iced::Length, style, theme, widget};
use std::borrow::Cow; use std::borrow::Cow;
pub fn dialog<'a, Message>() -> Dialog<'a, Message> { pub fn dialog<'a, Message>() -> Dialog<'a, Message> {

View file

@ -6,22 +6,22 @@ use std::{
use iced::Vector; use iced::Vector;
use crate::{ use crate::{
Element,
iced::{ iced::{
Event, Length, Rectangle,
clipboard::{ clipboard::{
dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent}, dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent},
mime::AllowedMimeTypes, mime::AllowedMimeTypes,
}, },
event, event,
id::Internal, id::Internal,
mouse, overlay, Event, Length, Rectangle, mouse, overlay,
}, },
iced_core::{ iced_core::{
self, layout, self, Clipboard, Shell, layout,
widget::{tree, Tree}, widget::{Tree, tree},
Clipboard, Shell,
}, },
widget::{Id, Widget}, widget::{Id, Widget},
Element,
}; };
pub fn dnd_destination<'a, Message: 'static>( pub fn dnd_destination<'a, Message: 'static>(

View file

@ -3,17 +3,17 @@ use std::any::Any;
use iced_core::window; use iced_core::window;
use crate::{ use crate::{
Element,
iced::{ iced::{
Event, Length, Point, Rectangle, Vector,
clipboard::dnd::{DndAction, DndEvent, SourceEvent}, clipboard::dnd::{DndAction, DndEvent, SourceEvent},
event, mouse, overlay, Event, Length, Point, Rectangle, Vector, event, mouse, overlay,
}, },
iced_core::{ iced_core::{
self, layout, renderer, self, Clipboard, Shell, layout, renderer,
widget::{tree, Tree}, widget::{Tree, tree},
Clipboard, Shell,
}, },
widget::{container, Id, Widget}, widget::{Id, Widget, container},
Element,
}; };
pub fn dnd_source< pub fn dnd_source<
@ -40,10 +40,10 @@ pub struct DndSource<'a, Message, D> {
} }
impl< impl<
'a, 'a,
Message: Clone + 'static, Message: Clone + 'static,
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
> DndSource<'a, Message, D> > DndSource<'a, Message, D>
{ {
pub fn new(child: impl Into<Element<'a, Message>>) -> Self { pub fn new(child: impl Into<Element<'a, Message>>) -> Self {
Self { Self {
@ -152,10 +152,8 @@ impl<
} }
} }
impl< impl<Message: Clone + 'static, D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static>
Message: Clone + 'static, Widget<Message, crate::Theme, crate::Renderer> for DndSource<'_, Message, D>
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
> Widget<Message, crate::Theme, crate::Renderer> for DndSource<'_, Message, D>
{ {
fn children(&self) -> Vec<Tree> { fn children(&self) -> Vec<Tree> {
vec![Tree::new(&self.container)] vec![Tree::new(&self.container)]
@ -400,10 +398,10 @@ impl<
} }
impl< impl<
'a, 'a,
Message: Clone + 'static, Message: Clone + 'static,
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
> From<DndSource<'a, Message, D>> for Element<'a, Message> > From<DndSource<'a, Message, D>> for Element<'a, Message>
{ {
fn from(e: DndSource<'a, Message, D>) -> Element<'a, Message> { fn from(e: DndSource<'a, Message, D>) -> Element<'a, Message> {
Element::new(e) Element::new(e)

View file

@ -3,7 +3,7 @@
// SPDX-License-Identifier: MPL-2.0 AND MIT // SPDX-License-Identifier: MPL-2.0 AND MIT
//! Change the appearance of menus. //! Change the appearance of menus.
use iced_core::{border::Radius, Background, Color}; use iced_core::{Background, Color, border::Radius};
/// The appearance of a menu. /// The appearance of a menu.
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]

View file

@ -9,14 +9,14 @@ use std::sync::{Arc, Mutex};
pub use appearance::{Appearance, StyleSheet}; pub use appearance::{Appearance, StyleSheet};
use crate::surface; use crate::surface;
use crate::widget::{icon, Container, RcWrapper}; use crate::widget::{Container, RcWrapper, icon};
use iced_core::event::{self, Event}; use iced_core::event::{self, 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;
use iced_core::{ use iced_core::{
alignment, mouse, overlay, renderer, svg, touch, Border, Clipboard, Element, Length, Padding, Border, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, Renderer, Shadow, Shell,
Pixels, Point, Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget, Size, Vector, Widget, alignment, mouse, overlay, renderer, svg, touch,
}; };
use iced_widget::scrollable::Scrollable; use iced_widget::scrollable::Scrollable;

View file

@ -7,8 +7,8 @@ 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;
use iced_core::{ use iced_core::{
alignment, mouse, overlay, renderer, svg, touch, Border, Clipboard, Element, Length, Padding, Border, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, Renderer, Shadow, Shell,
Pixels, Point, Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget, Size, Vector, Widget, alignment, mouse, overlay, renderer, svg, touch,
}; };
use iced_widget::scrollable::Scrollable; use iced_widget::scrollable::Scrollable;

View file

@ -3,7 +3,7 @@
// SPDX-License-Identifier: MPL-2.0 AND MIT // SPDX-License-Identifier: MPL-2.0 AND MIT
mod model; mod model;
pub use model::{list, model, List, Model}; pub use model::{List, Model, list, model};
pub mod menu; pub mod menu;
pub use menu::Menu; pub use menu::Menu;

View file

@ -8,10 +8,10 @@ use derive_setters::Setters;
use iced_core::event::{self, Event}; use iced_core::event::{self, 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::{alignment, keyboard, layout, mouse, overlay, renderer, svg, touch, Shadow};
use iced_core::{ use iced_core::{
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget,
}; };
use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch};
use iced_widget::pick_list; use iced_widget::pick_list;
use std::ffi::OsStr; use std::ffi::OsStr;

View file

@ -4,16 +4,16 @@
use super::menu::{self, Menu}; use super::menu::{self, Menu};
use crate::widget::icon::{self, Handle}; use crate::widget::icon::{self, Handle};
use crate::{surface, Element}; 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::{self, 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::{alignment, keyboard, layout, mouse, overlay, renderer, svg, touch, Shadow};
use iced_core::{ use iced_core::{
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget,
}; };
use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch};
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::ffi::OsStr;
@ -149,10 +149,10 @@ where
} }
impl< impl<
S: AsRef<str> + Send + Sync + Clone + 'static, S: AsRef<str> + Send + Sync + Clone + 'static,
Message: 'static + Clone, Message: 'static + Clone,
AppMessage: 'static + Clone, AppMessage: 'static + Clone,
> Widget<Message, crate::Theme, crate::Renderer> for Dropdown<'_, S, Message, AppMessage> > Widget<Message, crate::Theme, crate::Renderer> for Dropdown<'_, S, Message, AppMessage>
where where
[S]: std::borrow::ToOwned, [S]: std::borrow::ToOwned,
{ {
@ -344,11 +344,11 @@ where
} }
impl< impl<
'a, 'a,
S: AsRef<str> + Send + Sync + Clone + 'static, S: AsRef<str> + Send + Sync + Clone + 'static,
Message: 'static + std::clone::Clone, Message: 'static + std::clone::Clone,
AppMessage: 'static + std::clone::Clone, AppMessage: 'static + std::clone::Clone,
> From<Dropdown<'a, S, Message, AppMessage>> for crate::Element<'a, Message> > From<Dropdown<'a, S, Message, AppMessage>> for crate::Element<'a, Message>
where where
[S]: std::borrow::ToOwned, [S]: std::borrow::ToOwned,
{ {

View file

@ -6,8 +6,8 @@ use derive_setters::Setters;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::widget::{Operation, Tree}; use iced_core::widget::{Operation, Tree};
use iced_core::{ use iced_core::{
layout, mouse, overlay, renderer, Alignment, Clipboard, Layout, Length, Padding, Rectangle, Alignment, Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse,
Shell, Vector, Widget, overlay, renderer,
}; };
/// Responsively generates rows and columns of widgets based on its dimmensions. /// Responsively generates rows and columns of widgets based on its dimmensions.

View file

@ -49,10 +49,10 @@ pub fn from_path(path: PathBuf) -> Handle {
/// Create an image handle from memory. /// Create an image handle from memory.
pub fn from_raster_bytes( pub fn from_raster_bytes(
bytes: impl Into<Cow<'static, [u8]>> bytes: impl Into<Cow<'static, [u8]>>
+ std::convert::AsRef<[u8]> + std::convert::AsRef<[u8]>
+ std::marker::Send + std::marker::Send
+ std::marker::Sync + std::marker::Sync
+ 'static, + 'static,
) -> Handle { ) -> Handle {
fn inner(bytes: Cow<'static, [u8]>) -> Handle { fn inner(bytes: Cow<'static, [u8]>) -> Handle {
Handle { Handle {
@ -72,9 +72,9 @@ pub fn from_raster_pixels(
width: u32, width: u32,
height: u32, height: u32,
pixels: impl Into<Cow<'static, [u8]>> pixels: impl Into<Cow<'static, [u8]>>
+ std::convert::AsRef<[u8]> + std::convert::AsRef<[u8]>
+ std::marker::Send + std::marker::Send
+ std::marker::Sync, + std::marker::Sync,
) -> Handle { ) -> Handle {
fn inner(width: u32, height: u32, pixels: Cow<'static, [u8]>) -> Handle { fn inner(width: u32, height: u32, pixels: Cow<'static, [u8]>) -> Handle {
Handle { Handle {

View file

@ -10,7 +10,7 @@ use std::sync::Arc;
pub use named::{IconFallback, Named}; pub use named::{IconFallback, Named};
mod handle; mod handle;
pub use handle::{from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes, Data, Handle}; pub use handle::{Data, Handle, from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes};
use crate::Element; use crate::Element;
use derive_setters::Setters; use derive_setters::Setters;

View file

@ -3,4 +3,4 @@
pub mod column; pub mod column;
pub use self::column::{list_column, ListColumn}; pub use self::column::{ListColumn, list_column};

View file

@ -64,12 +64,12 @@ pub use key_bind::KeyBind;
mod menu_bar; mod menu_bar;
pub(crate) use menu_bar::MenuBarState; pub(crate) use menu_bar::MenuBarState;
pub use menu_bar::{menu_bar as bar, MenuBar}; pub use menu_bar::{MenuBar, menu_bar as bar};
mod menu_inner; mod menu_inner;
mod menu_tree; mod menu_tree;
pub use menu_tree::{ pub use menu_tree::{
menu_button, menu_items as items, menu_root as root, MenuItem as Item, MenuTree as Tree, MenuItem as Item, MenuTree as Tree, menu_button, menu_items as items, menu_root as root,
}; };
pub use crate::style::menu_bar::{Appearance, StyleSheet}; pub use crate::style::menu_bar::{Appearance, StyleSheet};

View file

@ -2,8 +2,9 @@
use iced_core::widget::Tree; use iced_core::widget::Tree;
use iced_widget::core::{ use iced_widget::core::{
Alignment, Element, Padding, Point, Size,
layout::{Limits, Node}, layout::{Limits, Node},
renderer, Alignment, Element, Padding, Point, Size, renderer,
}; };
/// The main axis of a flex layout. /// The main axis of a flex layout.

View file

@ -12,12 +12,11 @@ use crate::style::menu_bar::StyleSheet;
use iced::{Point, Vector}; use iced::{Point, Vector};
use iced_core::Border; use iced_core::Border;
use iced_widget::core::{ use iced_widget::core::{
event, Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, event,
layout::{Limits, Node}, layout::{Limits, Node},
mouse::{self, Cursor}, mouse::{self, Cursor},
overlay, renderer, touch, overlay, renderer, touch,
widget::{tree, Tree}, widget::{Tree, tree},
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget,
}; };
/// A `MenuBar` collects `MenuTree`s and handles all the layout, event processing, and drawing. /// A `MenuBar` collects `MenuTree`s and handles all the layout, event processing, and drawing.

View file

@ -6,12 +6,11 @@ use crate::style::menu_bar::StyleSheet;
use iced_core::{Border, Shadow}; use iced_core::{Border, Shadow};
use iced_widget::core::{ use iced_widget::core::{
event, Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, event,
layout::{Limits, Node}, layout::{Limits, Node},
mouse::{self, Cursor}, mouse::{self, Cursor},
overlay, renderer, touch, overlay, renderer, touch,
widget::Tree, widget::Tree,
Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector,
}; };
/// The condition of when to close a menu /// The condition of when to close a menu

View file

@ -6,12 +6,12 @@ use std::borrow::Cow;
use std::collections::HashMap; use std::collections::HashMap;
use std::rc::Rc; use std::rc::Rc;
use iced_widget::core::{renderer, Element}; use iced_widget::core::{Element, renderer};
use crate::iced_core::{Alignment, Length}; use crate::iced_core::{Alignment, Length};
use crate::widget::menu::action::MenuAction; use crate::widget::menu::action::MenuAction;
use crate::widget::menu::key_bind::KeyBind; use crate::widget::menu::key_bind::KeyBind;
use crate::widget::{icon, Button}; use crate::widget::{Button, icon};
use crate::{theme, widget}; use crate::{theme, widget};
/// Nested menu is essentially a tree of items, a menu is a collection of items /// Nested menu is essentially a tree of items, a menu is a collection of items

View file

@ -48,46 +48,46 @@
// Re-exports from Iced // Re-exports from Iced
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{canvas, Canvas}; pub use iced::widget::{Canvas, canvas};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{checkbox, Checkbox}; pub use iced::widget::{Checkbox, checkbox};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{combo_box, ComboBox}; pub use iced::widget::{ComboBox, combo_box};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{container, Container}; pub use iced::widget::{Container, container};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{horizontal_space, vertical_space, Space}; pub use iced::widget::{Space, horizontal_space, vertical_space};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{image, Image}; pub use iced::widget::{Image, image};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{lazy, Lazy}; pub use iced::widget::{Lazy, lazy};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{mouse_area, MouseArea}; pub use iced::widget::{MouseArea, mouse_area};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{pane_grid, PaneGrid}; pub use iced::widget::{PaneGrid, pane_grid};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{progress_bar, ProgressBar}; pub use iced::widget::{ProgressBar, progress_bar};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{responsive, Responsive}; pub use iced::widget::{Responsive, responsive};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{slider, vertical_slider, Slider, VerticalSlider}; pub use iced::widget::{Slider, VerticalSlider, slider, vertical_slider};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{svg, Svg}; pub use iced::widget::{Svg, svg};
#[doc(inline)] #[doc(inline)]
pub use iced::widget::{text_editor, TextEditor}; pub use iced::widget::{TextEditor, text_editor};
#[doc(inline)] #[doc(inline)]
pub use iced_core::widget::{Id, Operation, Widget}; pub use iced_core::widget::{Id, Operation, Widget};
@ -113,7 +113,7 @@ pub(crate) mod common;
pub mod calendar; pub mod calendar;
#[doc(inline)] #[doc(inline)]
pub use calendar::{calendar, Calendar}; pub use calendar::{Calendar, calendar};
pub mod card; pub mod card;
#[doc(inline)] #[doc(inline)]
@ -129,10 +129,10 @@ pub use iced::widget::qr_code;
pub mod context_drawer; pub mod context_drawer;
#[doc(inline)] #[doc(inline)]
pub use context_drawer::{context_drawer, ContextDrawer}; pub use context_drawer::{ContextDrawer, context_drawer};
#[doc(inline)] #[doc(inline)]
pub use column::{column, Column}; pub use column::{Column, column};
pub mod column { pub mod column {
//! A container which aligns its children in a column. //! A container which aligns its children in a column.
@ -159,21 +159,21 @@ pub mod column {
pub mod layer_container; pub mod layer_container;
#[doc(inline)] #[doc(inline)]
pub use layer_container::{layer_container, LayerContainer}; pub use layer_container::{LayerContainer, layer_container};
pub mod context_menu; pub mod context_menu;
#[doc(inline)] #[doc(inline)]
pub use context_menu::{context_menu, ContextMenu}; pub use context_menu::{ContextMenu, context_menu};
pub mod dialog; pub mod dialog;
#[doc(inline)] #[doc(inline)]
pub use dialog::{dialog, Dialog}; pub use dialog::{Dialog, dialog};
/// An element to distinguish a boundary between two elements. /// An element to distinguish a boundary between two elements.
pub mod divider { pub mod divider {
/// Horizontal variant of a divider. /// Horizontal variant of a divider.
pub mod horizontal { pub mod horizontal {
use iced::widget::{horizontal_rule, Rule}; use iced::widget::{Rule, horizontal_rule};
/// Horizontal divider with default thickness /// Horizontal divider with default thickness
#[must_use] #[must_use]
@ -196,7 +196,7 @@ pub mod divider {
/// Vertical variant of a divider. /// Vertical variant of a divider.
pub mod vertical { pub mod vertical {
use iced::widget::{vertical_rule, Rule}; use iced::widget::{Rule, vertical_rule};
/// Vertical divider with default thickness /// Vertical divider with default thickness
#[must_use] #[must_use]
@ -220,35 +220,35 @@ pub mod divider {
pub mod dnd_destination; pub mod dnd_destination;
#[doc(inline)] #[doc(inline)]
pub use dnd_destination::{dnd_destination, DndDestination}; pub use dnd_destination::{DndDestination, dnd_destination};
pub mod dnd_source; pub mod dnd_source;
#[doc(inline)] #[doc(inline)]
pub use dnd_source::{dnd_source, DndSource}; pub use dnd_source::{DndSource, dnd_source};
pub mod dropdown; pub mod dropdown;
#[doc(inline)] #[doc(inline)]
pub use dropdown::{dropdown, Dropdown}; pub use dropdown::{Dropdown, dropdown};
pub mod flex_row; pub mod flex_row;
#[doc(inline)] #[doc(inline)]
pub use flex_row::{flex_row, FlexRow}; pub use flex_row::{FlexRow, flex_row};
pub mod grid; pub mod grid;
#[doc(inline)] #[doc(inline)]
pub use grid::{grid, Grid}; pub use grid::{Grid, grid};
mod header_bar; mod header_bar;
#[doc(inline)] #[doc(inline)]
pub use header_bar::{header_bar, HeaderBar}; pub use header_bar::{HeaderBar, header_bar};
pub mod icon; pub mod icon;
#[doc(inline)] #[doc(inline)]
pub use icon::{icon, Icon}; pub use icon::{Icon, icon};
pub mod id_container; pub mod id_container;
#[doc(inline)] #[doc(inline)]
pub use id_container::{id_container, IdContainer}; pub use id_container::{IdContainer, id_container};
#[cfg(feature = "animated-image")] #[cfg(feature = "animated-image")]
pub mod frames; pub mod frames;
@ -257,7 +257,7 @@ pub use taffy::JustifyContent;
pub mod list; pub mod list;
#[doc(inline)] #[doc(inline)]
pub use list::{list_column, ListColumn}; pub use list::{ListColumn, list_column};
pub mod menu; pub mod menu;
@ -267,22 +267,22 @@ pub use nav_bar::{nav_bar, nav_bar_dnd};
pub mod nav_bar_toggle; pub mod nav_bar_toggle;
#[doc(inline)] #[doc(inline)]
pub use nav_bar_toggle::{nav_bar_toggle, NavBarToggle}; pub use nav_bar_toggle::{NavBarToggle, nav_bar_toggle};
pub mod popover; pub mod popover;
#[doc(inline)] #[doc(inline)]
pub use popover::{popover, Popover}; pub use popover::{Popover, popover};
pub mod radio; pub mod radio;
#[doc(inline)] #[doc(inline)]
pub use radio::{radio, Radio}; pub use radio::{Radio, radio};
pub mod rectangle_tracker; pub mod rectangle_tracker;
#[doc(inline)] #[doc(inline)]
pub use rectangle_tracker::{rectangle_tracking_container, RectangleTracker}; pub use rectangle_tracker::{RectangleTracker, rectangle_tracking_container};
#[doc(inline)] #[doc(inline)]
pub use row::{row, Row}; pub use row::{Row, row};
pub mod row { pub mod row {
//! A container which aligns its children in a row. //! A container which aligns its children in a row.
@ -319,30 +319,30 @@ pub mod settings;
pub mod spin_button; pub mod spin_button;
#[doc(inline)] #[doc(inline)]
pub use spin_button::{spin_button, vertical as vertical_spin_button, SpinButton}; pub use spin_button::{SpinButton, spin_button, vertical as vertical_spin_button};
pub mod tab_bar; pub mod tab_bar;
pub mod text; pub mod text;
#[doc(inline)] #[doc(inline)]
pub use text::{text, Text}; pub use text::{Text, text};
pub mod text_input; pub mod text_input;
#[doc(inline)] #[doc(inline)]
pub use text_input::{ pub use text_input::{
editable_input, inline_input, search_input, secure_input, text_input, TextInput, TextInput, editable_input, inline_input, search_input, secure_input, text_input,
}; };
pub mod toaster; pub mod toaster;
#[doc(inline)] #[doc(inline)]
pub use toaster::{toaster, Toast, ToastId, Toasts}; pub use toaster::{Toast, ToastId, Toasts, toaster};
mod toggler; mod toggler;
#[doc(inline)] #[doc(inline)]
pub use toggler::toggler; pub use toggler::toggler;
#[doc(inline)] #[doc(inline)]
pub use tooltip::{tooltip, Tooltip}; pub use tooltip::{Tooltip, tooltip};
#[cfg(all(feature = "wayland", feature = "winit"))] #[cfg(all(feature = "wayland", feature = "winit"))]
pub mod wayland; pub mod wayland;

View file

@ -3,7 +3,7 @@
//! A button for toggling the navigation side panel. //! A button for toggling the navigation side panel.
use crate::{widget, Element}; use crate::{Element, widget};
use derive_setters::Setters; use derive_setters::Setters;
#[derive(Setters)] #[derive(Setters)]

View file

@ -9,7 +9,7 @@ use iced_core::mouse;
use iced_core::overlay; use iced_core::overlay;
use iced_core::renderer; use iced_core::renderer;
use iced_core::touch; use iced_core::touch;
use iced_core::widget::{tree, Operation, Tree}; use iced_core::widget::{Operation, Tree, tree};
use iced_core::{ use iced_core::{
Clipboard, Element, Layout, Length, Point, Rectangle, Shell, Size, Vector, Widget, Clipboard, Element, Layout, Length, Point, Rectangle, Shell, Size, Vector, Widget,
}; };

View file

@ -1,8 +1,8 @@
mod subscription; mod subscription;
use iced::Vector;
use iced::futures::channel::mpsc::UnboundedSender; use iced::futures::channel::mpsc::UnboundedSender;
use iced::widget::Container; use iced::widget::Container;
use iced::Vector;
pub use subscription::*; pub use subscription::*;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};

View file

@ -6,7 +6,7 @@ use iced_core::layout;
use iced_core::mouse; use iced_core::mouse;
use iced_core::overlay; use iced_core::overlay;
use iced_core::renderer; use iced_core::renderer;
use iced_core::widget::{tree, Id, Tree}; use iced_core::widget::{Id, Tree, tree};
use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget}; use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget};
pub(crate) fn responsive_container<'a, Message: 'static, Theme, E>( pub(crate) fn responsive_container<'a, Message: 'static, Theme, E>(

View file

@ -3,8 +3,8 @@ use std::collections::HashMap;
use apply::Apply; use apply::Apply;
use crate::{ use crate::{
widget::{button, icon, responsive_container},
Core, Element, Core, Element,
widget::{button, icon, responsive_container},
}; };
use super::menu; use super::menu;

View file

@ -79,14 +79,14 @@ mod style;
mod vertical; mod vertical;
mod widget; mod widget;
pub use self::horizontal::{horizontal, HorizontalSegmentedButton}; pub use self::horizontal::{HorizontalSegmentedButton, horizontal};
pub use self::model::{ pub use self::model::{
BuilderEntity, Entity, EntityMut, Model, ModelBuilder, MultiSelect, MultiSelectEntityMut, BuilderEntity, Entity, EntityMut, Model, ModelBuilder, MultiSelect, MultiSelectEntityMut,
MultiSelectModel, Selectable, SingleSelect, SingleSelectEntityMut, SingleSelectModel, MultiSelectModel, Selectable, SingleSelect, SingleSelectEntityMut, SingleSelectModel,
}; };
pub use self::style::{Appearance, ItemAppearance, ItemStatusAppearance, StyleSheet}; pub use self::style::{Appearance, ItemAppearance, ItemStatusAppearance, StyleSheet};
pub use self::vertical::{vertical, VerticalSegmentedButton}; pub use self::vertical::{VerticalSegmentedButton, vertical};
pub use self::widget::{focus, Id, SegmentedButton, SegmentedVariant}; pub use self::widget::{Id, SegmentedButton, SegmentedVariant, focus};
/// Associates extra data with an external secondary map. /// Associates extra data with an external secondary map.
/// ///

View file

@ -1,7 +1,7 @@
// Copyright 2022 System76 <info@system76.com> // Copyright 2022 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use iced_core::{border::Radius, Background, Color}; use iced_core::{Background, Color, border::Radius};
/// Appearance of the segmented button. /// Appearance of the segmented button.
#[derive(Default, Clone, Copy)] #[derive(Default, Clone, Copy)]

View file

@ -4,12 +4,11 @@
use std::borrow::Cow; use std::borrow::Cow;
use crate::{ use crate::{
theme, Element, theme,
widget::{column, container, flex_row, horizontal_space, row, text, FlexRow, Row}, widget::{FlexRow, Row, column, container, flex_row, horizontal_space, row, text},
Element,
}; };
use derive_setters::Setters; use derive_setters::Setters;
use iced_core::{text::Wrapping, Length}; use iced_core::{Length, text::Wrapping};
use taffy::AlignContent; use taffy::AlignContent;
/// A settings item aligned in a row /// A settings item aligned in a row

View file

@ -5,10 +5,10 @@ pub mod item;
pub mod section; pub mod section;
pub use self::item::{flex_item, flex_item_row, item, item_row}; pub use self::item::{flex_item, flex_item_row, item, item_row};
pub use self::section::{section, Section}; pub use self::section::{Section, section};
use crate::widget::{column, Column}; use crate::widget::{Column, column};
use crate::{theme, Element}; use crate::{Element, theme};
/// A column with a predefined style for creating a settings panel /// A column with a predefined style for creating a settings panel
#[must_use] #[must_use]

View file

@ -1,8 +1,8 @@
// Copyright 2022 System76 <info@system76.com> // Copyright 2022 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use crate::widget::{column, text, ListColumn};
use crate::Element; use crate::Element;
use crate::widget::{ListColumn, column, text};
use std::borrow::Cow; use std::borrow::Cow;
/// A section within a settings view column. /// A section within a settings view column.

View file

@ -4,9 +4,8 @@
//! A control for incremental adjustments of a value. //! A control for incremental adjustments of a value.
use crate::{ use crate::{
theme, Element, theme,
widget::{button, column, container, icon, row, text}, widget::{button, column, container, icon, row, text},
Element,
}; };
use apply::Apply; use apply::Apply;
use iced::{Alignment, Length}; use iced::{Alignment, Length};

View file

@ -4,7 +4,7 @@
//! Change the appearance of a text input. //! Change the appearance of a text input.
use iced_core::{border::Radius, Background, Color}; use iced_core::{Background, Color, border::Radius};
/// The appearance of a text input. /// The appearance of a text input.
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]

View file

@ -4,15 +4,15 @@
use iced::{Limits, Size}; use iced::{Limits, Size};
use iced_core::layout::Node; use iced_core::layout::Node;
use iced_core::Element;
use iced_core::Overlay;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout; use iced_core::layout;
use iced_core::mouse; use iced_core::mouse;
use iced_core::overlay; use iced_core::overlay;
use iced_core::renderer::{self}; use iced_core::renderer::{self};
use iced_core::widget::tree::Tree;
use iced_core::widget::Operation; use iced_core::widget::Operation;
use iced_core::Element; use iced_core::widget::tree::Tree;
use iced_core::Overlay;
use iced_core::{Clipboard, Layout, Length, Point, Rectangle, Shell, Vector, Widget}; use iced_core::{Clipboard, Layout, Length, Point, Rectangle, Shell, Vector, Widget};
pub struct Toaster<'a, Message, Theme, Renderer> { pub struct Toaster<'a, Message, Theme, Renderer> {

View file

@ -1,7 +1,7 @@
// Copyright 2022 System76 <info@system76.com> // Copyright 2022 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use iced::{widget, Length}; use iced::{Length, widget};
use iced_core::text; use iced_core::text;
pub fn toggler<'a, Message, Theme: iced_widget::toggler::Catalog, Renderer>( pub fn toggler<'a, Message, Theme: iced_widget::toggler::Catalog, Renderer>(

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::icon; use super::icon;
use crate::{theme, widget, Element, Renderer, Theme}; use crate::{Element, Renderer, Theme, theme, widget};
use apply::Apply; use apply::Apply;
use iced::{Alignment, Background, Color, Length}; use iced::{Alignment, Background, Color, Length};
use iced_core::{Border, Shadow}; use iced_core::{Border, Shadow};

View file

@ -5,7 +5,7 @@ pub mod widget;
// Copyright 2023 System76 <info@system76.com> // Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use iced_core::{border::Radius, Background, Color, Vector}; use iced_core::{Background, Color, Vector, border::Radius};
use crate::theme::THEME; use crate::theme::THEME;

View file

@ -16,14 +16,14 @@ use iced_runtime::core::widget::Id;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::renderer; use iced_core::renderer;
use iced_core::touch; use iced_core::touch;
use iced_core::widget::tree::{self, Tree};
use iced_core::widget::Operation; use iced_core::widget::Operation;
use iced_core::{layout, svg}; use iced_core::widget::tree::{self, Tree};
use iced_core::{mouse, Border};
use iced_core::{overlay, Shadow};
use iced_core::{ use iced_core::{
Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget, Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget,
}; };
use iced_core::{Border, mouse};
use iced_core::{Shadow, overlay};
use iced_core::{layout, svg};
pub use super::{Catalog, Style}; pub use super::{Catalog, Style};
@ -75,14 +75,14 @@ impl<'a, Message, TopLevelMessage> Tooltip<'a, Message, TopLevelMessage> {
content: impl Into<crate::Element<'a, Message>>, content: impl Into<crate::Element<'a, Message>>,
settings: Option< settings: Option<
impl Fn(Rectangle) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings impl Fn(Rectangle) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings
+ Send
+ Sync
+ 'static,
>,
view: impl Fn() -> crate::Element<'static, crate::Action<TopLevelMessage>>
+ Send + Send
+ Sync + Sync
+ 'static, + 'static,
>,
view: impl Fn() -> crate::Element<'static, crate::Action<TopLevelMessage>>
+ Send
+ Sync
+ 'static,
on_leave: Message, on_leave: Message,
on_surface_action: impl Fn(crate::surface::Action) -> Message + 'static, on_surface_action: impl Fn(crate::surface::Action) -> Message + 'static,
) -> Self { ) -> Self {

View file

@ -5,8 +5,8 @@ use std::{
}; };
use crate::Element; use crate::Element;
use iced::{event, Length, Rectangle, Size}; use iced::{Length, Rectangle, Size, event};
use iced_core::{id::Id, widget, widget::tree, Widget}; use iced_core::{Widget, id::Id, widget, widget::tree};
#[derive(Debug)] #[derive(Debug)]
pub struct RcWrapper<T> { pub struct RcWrapper<T> {