chore: add rustfmt config

This commit is contained in:
Vukašin Vojinović 2026-04-30 16:07:25 +02:00 • committed by Ashley Wulber
parent 9abc4d483b
commit 9c2a86a8f4
98 changed files with 419 additions and 540 deletions

15
.zed/settings.json Normal file
View file

@ -0,0 +1,15 @@
{
"format_on_save": "on",
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy",
},
"rustfmt": {
"extraArgs": ["+nightly"],
},
},
},
},
}

View file

@ -1,13 +1,12 @@
use std::{any::TypeId, ops::Deref}; use std::any::TypeId;
use std::ops::Deref;
use crate::{CosmicConfigEntry, Update}; use crate::{CosmicConfigEntry, Update};
use cosmic_settings_daemon::{Changed, ConfigProxy, CosmicSettingsDaemonProxy}; use cosmic_settings_daemon::{Changed, ConfigProxy, CosmicSettingsDaemonProxy};
use futures_util::SinkExt; use futures_util::SinkExt;
use iced_futures::{ use iced_futures::futures::future::pending;
Subscription, use iced_futures::futures::{self, StreamExt};
futures::{self, StreamExt, future::pending}, use iced_futures::{Subscription, stream};
stream,
};
pub async fn settings_daemon_proxy() -> zbus::Result<CosmicSettingsDaemonProxy<'static>> { pub async fn settings_daemon_proxy() -> zbus::Result<CosmicSettingsDaemonProxy<'static>> {
let conn = zbus::Connection::session().await?; let conn = zbus::Connection::session().await?;

View file

@ -1,16 +1,13 @@
//! Integrations for cosmic-config — the cosmic configuration system. //! Integrations for cosmic-config — the cosmic configuration system.
use notify::{ use notify::event::{EventKind, ModifyKind, RenameMode};
RecommendedWatcher, Watcher, use notify::{RecommendedWatcher, Watcher};
event::{EventKind, ModifyKind, RenameMode}, use serde::Serialize;
}; use serde::de::DeserializeOwned;
use serde::{Serialize, de::DeserializeOwned}; use std::io::Write;
use std::{ use std::path::{Path, PathBuf};
env, fmt, fs, use std::sync::Mutex;
io::Write, use std::{env, fmt, fs};
path::{Path, PathBuf},
sync::Mutex,
};
/// Get the config directory, with Flatpak sandbox support. /// Get the config directory, with Flatpak sandbox support.
/// In Flatpak, HOST_XDG_CONFIG_HOME points to the real user config directory, /// In Flatpak, HOST_XDG_CONFIG_HOME points to the real user config directory,

View file

@ -1,7 +1,9 @@
use iced_futures::futures::channel::mpsc;
use iced_futures::futures::{SinkExt, Stream}; use iced_futures::futures::{SinkExt, Stream};
use iced_futures::{futures::channel::mpsc, stream}; use iced_futures::stream;
use notify::RecommendedWatcher; use notify::RecommendedWatcher;
use std::{borrow::Cow, hash::Hash}; use std::borrow::Cow;
use std::hash::Hash;
use crate::{Config, CosmicConfigEntry}; use crate::{Config, CosmicConfigEntry};
@ -77,7 +79,8 @@ async fn start_listening<T: 'static + Send + Sync + PartialEq + Clone + CosmicCo
state: ConfigState<T>, state: ConfigState<T>,
output: &mut mpsc::Sender<crate::Update<T>>, output: &mut mpsc::Sender<crate::Update<T>>,
) -> ConfigState<T> { ) -> ConfigState<T> {
use iced_futures::futures::{StreamExt, future::pending}; use iced_futures::futures::StreamExt;
use iced_futures::futures::future::pending;
match state { match state {
ConfigState::Init(config_id, version, is_state) => { ConfigState::Init(config_id, version, is_state) => {

View file

@ -1,13 +1,13 @@
use crate::composite::over;
use crate::steps::{color_index, get_small_widget_color, get_surface_color, get_text, steps};
use crate::{ use crate::{
Component, Container, CornerRadii, CosmicPalette, CosmicPaletteInner, DARK_PALETTE, Component, Container, CornerRadii, CosmicPalette, CosmicPaletteInner, DARK_PALETTE,
LIGHT_PALETTE, NAME, Spacing, ThemeMode, LIGHT_PALETTE, NAME, Spacing, ThemeMode,
composite::over,
steps::{color_index, get_small_widget_color, get_surface_color, get_text, steps},
}; };
use cosmic_config::{Config, CosmicConfigEntry}; use cosmic_config::{Config, CosmicConfigEntry};
use palette::{ use palette::color_difference::Wcag21RelativeContrast;
IntoColor, Oklcha, Srgb, Srgba, WithAlpha, color_difference::Wcag21RelativeContrast, rgb::Rgb, use palette::rgb::Rgb;
}; use palette::{IntoColor, Oklcha, Srgb, Srgba, WithAlpha};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::num::NonZeroUsize; use std::num::NonZeroUsize;

View file

@ -1,11 +1,12 @@
use crate::{Component, Theme, composite::over, steps::steps}; use crate::composite::over;
use palette::{Darken, IntoColor, Lighten, Srgba, WithAlpha, rgb::Rgba}; use crate::steps::steps;
use std::{ use crate::{Component, Theme};
fs::{self, File}, use palette::rgb::Rgba;
io::{self, Write}, use palette::{Darken, IntoColor, Lighten, Srgba, WithAlpha};
num::NonZeroUsize, use std::fs::{self, File};
path::Path, use std::io::{self, Write};
}; use std::num::NonZeroUsize;
use std::path::Path;
use super::{OutputError, to_rgba}; use super::{OutputError, to_rgba};

View file

@ -1,5 +1,6 @@
use configparser::ini::WriteOptions; use configparser::ini::WriteOptions;
use palette::{Srgba, rgb::Rgba}; use palette::Srgba;
use palette::rgb::Rgba;
use thiserror::Error; use thiserror::Error;
use crate::Theme; use crate::Theme;

View file

@ -1,12 +1,12 @@
use crate::Theme; use crate::Theme;
use configparser::ini::Ini; use configparser::ini::Ini;
use palette::{Mix, Srgba, WithAlpha, blend::Compose, rgb::Rgba}; use palette::blend::Compose;
use std::{ use palette::rgb::Rgba;
fs::{self, File}, use palette::{Mix, Srgba, WithAlpha};
io::Write, use std::fs::{self, File};
path::PathBuf, use std::io::Write;
vec, use std::path::PathBuf;
}; use std::vec;
use super::{OutputError, qt_settings_ini_style}; use super::{OutputError, qt_settings_ini_style};

View file

@ -1,12 +1,11 @@
use crate::Theme; use crate::Theme;
use configparser::ini::Ini; use configparser::ini::Ini;
use cosmic_config::CosmicConfigEntry; use cosmic_config::CosmicConfigEntry;
use palette::{Mix, Srgba, blend::Compose}; use palette::blend::Compose;
use std::{ use palette::{Mix, Srgba};
fs::{self, File}, use std::fs::{self, File};
io::{self, Write}, use std::io::{self, Write};
path::{Path, PathBuf}, use std::path::{Path, PathBuf};
};
use super::{OutputError, qt_settings_ini_style}; use super::{OutputError, qt_settings_ini_style};

View file

@ -1,7 +1,8 @@
use std::num::NonZeroUsize; use std::num::NonZeroUsize;
use almost::equal; use almost::equal;
use palette::{ClampAssign, FromColor, Lch, Oklcha, Srgb, Srgba, convert::FromColorUnclamped}; use palette::convert::FromColorUnclamped;
use palette::{ClampAssign, FromColor, Lch, Oklcha, Srgb, Srgba};
/// Get an array of 100 colors with a specific hue and chroma /// Get an array of 100 colors with a specific hue and chroma
/// over the full range of lightness. /// over the full range of lightness.

View file

@ -8,7 +8,8 @@ use cosmic::app::{Core, Settings, Task};
use cosmic::executor; use cosmic::executor;
use cosmic::iced::{alignment, Length, Size}; use cosmic::iced::{alignment, Length, Size};
use cosmic::prelude::*; use cosmic::prelude::*;
use cosmic::widget::{self, about::About, nav_bar}; use cosmic::widget::about::About;
use cosmic::widget::{self, nav_bar};
/// Runs application with these settings /// Runs application with these settings
#[rustfmt::skip] #[rustfmt::skip]

View file

@ -4,7 +4,8 @@ use cosmic::iced::core::window;
use cosmic::iced::window::Id; use cosmic::iced::window::Id;
use cosmic::iced::{Length, Rectangle}; use cosmic::iced::{Length, Rectangle};
use cosmic::surface::action::{app_popup, destroy_popup}; use cosmic::surface::action::{app_popup, destroy_popup};
use cosmic::widget::{dropdown::popup_dropdown, list_column, settings, toggler}; use cosmic::widget::dropdown::popup_dropdown;
use cosmic::widget::{list_column, settings, toggler};
use cosmic::Element; use cosmic::Element;
const ID: &str = "com.system76.CosmicAppletExample"; const ID: &str = "com.system76.CosmicAppletExample";

View file

@ -5,9 +5,10 @@
use cosmic::app::Settings; use cosmic::app::Settings;
use cosmic::iced::{Alignment, Length, Size}; use cosmic::iced::{Alignment, Length, Size};
use cosmic::prelude::*;
use cosmic::widget::menu::{self, KeyBind}; use cosmic::widget::menu::{self, KeyBind};
use cosmic::widget::nav_bar; use cosmic::widget::nav_bar;
use cosmic::{executor, iced, prelude::*, widget, Core}; use cosmic::{executor, iced, widget, Core};
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::LazyLock; use std::sync::LazyLock;

View file

@ -23,15 +23,11 @@ use cosmic::{
Element, Element,
}; };
use cosmic_time::{Instant, Timeline}; use cosmic_time::{Instant, Timeline};
use std::{ use std::cell::RefCell;
cell::RefCell, use std::rc::Rc;
rc::Rc, use std::sync::atomic::{AtomicU32, Ordering};
sync::{ use std::sync::Arc;
atomic::{AtomicU32, Ordering}, use std::vec;
Arc,
},
vec,
};
// XXX The use of button is removed because it assigns the same ID to multiple buttons, causing a crash when a11y is enabled... // XXX The use of button is removed because it assigns the same ID to multiple buttons, causing a crash when a11y is enabled...
// static BTN: Lazy<id::Id> = Lazy::new(|| id::Id::new("BTN")); // static BTN: Lazy<id::Id> = Lazy::new(|| id::Id::new("BTN"));

View file

@ -1,9 +1,7 @@
use super::{Page, Window}; use super::{Page, Window};
use cosmic::{ use cosmic::iced::widget::{column, text};
iced::widget::{column, text}, use cosmic::widget::{list_column, settings, toggler};
widget::{list_column, settings, toggler}, use cosmic::Element;
Element,
};
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub enum Message { pub enum Message {

View file

@ -1,19 +1,17 @@
use std::{cell::RefCell, rc::Rc}; use std::cell::RefCell;
use std::rc::Rc;
use apply::Apply; use apply::Apply;
use cosmic::{ use cosmic::iced::widget::{checkbox, column, progress_bar, radio, slider, text};
cosmic_theme, use cosmic::iced::{Alignment, Length};
iced::widget::{checkbox, column, progress_bar, radio, slider, text}, use cosmic::iced_core::id;
iced::{Alignment, Length}, use cosmic::theme::ThemeType;
iced_core::id, use cosmic::widget::color_picker::ColorPickerUpdate;
theme::ThemeType, use cosmic::widget::{
widget::{ button, dropdown, icon, layer_container as container, segmented_button, segmented_control,
button, color_picker::ColorPickerUpdate, dropdown, icon, layer_container as container, settings, spin_button, tab_bar, toggler, ColorPickerModel,
segmented_button, segmented_control, settings, spin_button, tab_bar, toggler,
ColorPickerModel,
},
Element,
}; };
use cosmic::{cosmic_theme, Element};
use cosmic_time::{anim, chain, Timeline}; use cosmic_time::{anim, chain, Timeline};
use fraction::{Decimal, ToPrimitive}; use fraction::{Decimal, ToPrimitive};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;

View file

@ -1,10 +1,7 @@
use cosmic::{ use cosmic::iced::widget::{column, container, horizontal_space, image, row, svg, text};
iced::widget::{column, container, horizontal_space, image, row, svg, text}, use cosmic::iced::Length;
iced::Length, use cosmic::widget::{list_column, settings, toggler};
theme, use cosmic::{theme, Element};
widget::{list_column, settings, toggler},
Element,
};
use super::{Page, SubPage, Window}; use super::{Page, SubPage, Window};

View file

@ -1,9 +1,7 @@
use cosmic::{ use cosmic::iced::widget::{horizontal_space, row, text};
iced::widget::{horizontal_space, row, text}, use cosmic::iced::Length;
iced::Length, use cosmic::widget::{icon, list_column, settings};
widget::{icon, list_column, settings}, use cosmic::Element;
Element,
};
use super::{Message, Page, SubPage, Window}; use super::{Message, Page, SubPage, Window};

View file

@ -9,11 +9,9 @@ use std::{env, process};
use cosmic::app::{Core, Settings, Task}; use cosmic::app::{Core, Settings, Task};
use cosmic::iced::alignment::{Horizontal, Vertical}; use cosmic::iced::alignment::{Horizontal, Vertical};
use cosmic::iced::keyboard::Key; use cosmic::iced::keyboard::Key;
use cosmic::iced::window; use cosmic::iced::{window, Length, Size};
use cosmic::iced::{Length, Size};
use cosmic::widget::menu::action::MenuAction; use cosmic::widget::menu::action::MenuAction;
use cosmic::widget::menu::key_bind::KeyBind; use cosmic::widget::menu::key_bind::{KeyBind, Modifier};
use cosmic::widget::menu::key_bind::Modifier;
use cosmic::widget::menu::{self, ItemHeight, ItemWidth}; use cosmic::widget::menu::{self, ItemHeight, ItemWidth};
use cosmic::widget::RcElementWrapper; use cosmic::widget::RcElementWrapper;
use cosmic::{executor, Element}; use cosmic::{executor, Element};

View file

@ -1,13 +1,11 @@
use std::collections::HashMap; use std::collections::HashMap;
use cosmic::{ use cosmic::app::Core;
app::Core, use cosmic::iced::core::{id, Alignment, Length, Point};
iced::core::{id, Alignment, Length, Point}, use cosmic::iced::widget::{column, container, scrollable, text};
iced::widget::{column, container, scrollable, text}, use cosmic::iced::{self, event, window, Subscription};
iced::{self, event, window, Subscription}, use cosmic::prelude::*;
prelude::*, use cosmic::widget::{button, header_bar};
widget::{button, header_bar},
};
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub enum Message { pub enum Message {

View file

@ -1,15 +1,8 @@
use cosmic::iced::Length; use cosmic::app::{Core, Task};
use cosmic::iced::alignment::{Horizontal, Vertical};
use cosmic::iced::{self, Alignment, Length, Size};
use cosmic::widget::{column, container, spin_button}; use cosmic::widget::{column, container, spin_button};
use cosmic::Apply; use cosmic::{Application, Apply, Element};
use cosmic::{
app::{Core, Task},
iced::{
self,
alignment::{Horizontal, Vertical},
Alignment, Size,
},
Application, Element,
};
use fraction::Decimal; use fraction::Decimal;
pub struct SpinButtonExamplApp { pub struct SpinButtonExamplApp {

View file

@ -5,7 +5,8 @@
use cosmic::app::{Core, Settings, Task}; use cosmic::app::{Core, Settings, Task};
use cosmic::iced::Subscription; use cosmic::iced::Subscription;
use cosmic::{executor, prelude::*, widget}; use cosmic::prelude::*;
use cosmic::{executor, widget};
/// Runs application with these settings /// Runs application with these settings
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {

View file

@ -9,8 +9,7 @@ use chrono::Datelike;
use cosmic::app::{Core, Settings, Task}; use cosmic::app::{Core, Settings, Task};
use cosmic::iced::Size; use cosmic::iced::Size;
use cosmic::prelude::*; use cosmic::prelude::*;
use cosmic::widget::table; use cosmic::widget::{self, nav_bar, table};
use cosmic::widget::{self, nav_bar};
use cosmic::{executor, iced}; use cosmic::{executor, iced};
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)] #[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]

1
rustfmt.toml Normal file
View file

@ -0,0 +1 @@
imports_granularity = "Module"

View file

@ -1,10 +1,10 @@
// 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::surface; use crate::config::CosmicTk;
use crate::theme::Theme; use crate::theme::Theme;
use crate::widget::nav_bar; use crate::widget::nav_bar;
use crate::{config::CosmicTk, keyboard_nav}; use crate::{keyboard_nav, surface};
#[cfg(all(feature = "wayland", target_os = "linux"))] #[cfg(all(feature = "wayland", target_os = "linux"))]
use cctk::sctk::reexports::csd_frame::{WindowManagerCapabilities, WindowState}; use cctk::sctk::reexports::csd_frame::{WindowManagerCapabilities, WindowState};
use cosmic_theme::ThemeMode; use cosmic_theme::ThemeMode;

View file

@ -22,11 +22,11 @@ use crate::prelude::*;
use crate::theme::THEME; use crate::theme::THEME;
use crate::widget::{container, id_container, menu, nav_bar, popover, space}; use crate::widget::{container, id_container, menu, nav_bar, popover, space};
use apply::Apply; use apply::Apply;
use iced::{Length, Subscription}; use iced::{Length, Subscription, theme, window};
use iced::{theme, window};
pub use settings::Settings; pub use settings::Settings;
use std::borrow::Cow; use std::borrow::Cow;
use std::{cell::RefCell, rc::Rc}; use std::cell::RefCell;
use std::rc::Rc;
#[cold] #[cold]
pub(crate) fn iced_settings<App: Application>( pub(crate) fn iced_settings<App: Application>(

View file

@ -2,14 +2,10 @@
use crate::iced; use crate::iced;
use iced::core::alignment::{self, Alignment}; use iced::core::alignment::{self, Alignment};
use iced::core::event::{self, Event}; use iced::core::event::{self, Event};
use iced::core::layout;
use iced::core::mouse;
use iced::core::overlay;
use iced::core::renderer;
use iced::core::widget::{Operation, Tree}; use iced::core::widget::{Operation, Tree};
use iced::core::{ use iced::core::{
Clipboard, Element, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, Clipboard, Element, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget,
widget, layout, mouse, overlay, renderer, widget,
}; };
/// A container that distributes its contents vertically. /// A container that distributes its contents vertically.

View file

@ -1,37 +1,31 @@
#[cfg(feature = "applet-token")] #[cfg(feature = "applet-token")]
pub mod token; pub mod token;
use crate::app::{BootData, BootDataInner, cosmic}; use crate::app::{BootData, BootDataInner, cosmic, iced_settings};
use crate::{ use crate::cctk::sctk;
Application, Element, Renderer, use crate::theme::{self, Button, THEME, system_dark, system_light};
app::iced_settings, use crate::widget::autosize::{self, Autosize, autosize};
cctk::sctk, use crate::widget::column::Column;
theme::{self, Button, THEME, system_dark, system_light}, use crate::widget::row::Row;
widget::{ use crate::widget::space::{horizontal, vertical};
self, use crate::widget::{self, layer_container};
autosize::{self, Autosize, autosize}, use crate::{Application, Element, Renderer};
column::Column,
layer_container,
row::Row,
space::horizontal,
space::vertical,
},
};
pub use cosmic_panel_config; pub use cosmic_panel_config;
use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize}; use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize};
use iced::{ use iced::alignment::{Alignment, Horizontal, Vertical};
self, Color, Length, Limits, Rectangle, use iced::widget::Container;
alignment::{Alignment, Horizontal, Vertical}, use iced::{self, Color, Length, Limits, Rectangle, window};
widget::Container,
window,
};
use iced_core::{Padding, Shadow}; use iced_core::{Padding, Shadow};
use iced_runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner}; use iced_runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner};
use iced_widget::Text; use iced_widget::Text;
use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity}; use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity};
use std::borrow::Cow;
use std::cell::RefCell; use std::cell::RefCell;
use std::{borrow::Cow, num::NonZeroU32, rc::Rc, sync::LazyLock, time::Duration}; use std::num::NonZeroU32;
use std::rc::Rc;
use std::sync::LazyLock;
use std::time::Duration;
use tracing::info; use tracing::info;
pub mod column; pub mod column;

View file

@ -3,12 +3,10 @@ use crate::iced;
use iced::core::alignment::{self, Alignment}; use iced::core::alignment::{self, Alignment};
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::mouse;
use iced::core::overlay;
use iced::core::renderer;
use iced::core::widget::{Operation, Tree}; use iced::core::widget::{Operation, Tree};
use iced::core::{ use iced::core::{
Clipboard, Element, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, widget, Clipboard, Element, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, mouse,
overlay, renderer, widget,
}; };
use iced::touch; use iced::touch;

View file

@ -1,13 +1,12 @@
use crate::iced; use crate::iced;
use cctk::sctk::reexports::calloop; use cctk::sctk::reexports::calloop;
use futures::{ use futures::channel::mpsc::{UnboundedReceiver, unbounded};
SinkExt, StreamExt, use futures::{SinkExt, StreamExt};
channel::mpsc::{UnboundedReceiver, unbounded},
};
use iced::Subscription; use iced::Subscription;
use iced_futures::futures; use iced_futures::{futures, stream};
use iced_futures::stream; use std::fmt::Debug;
use std::{fmt::Debug, hash::Hash, thread::JoinHandle}; use std::hash::Hash;
use std::thread::JoinHandle;
use super::wayland_handler::wayland_handler; use super::wayland_handler::wayland_handler;

View file

@ -1,27 +1,20 @@
use std::os::{ use std::os::fd::{FromRawFd, RawFd};
fd::{FromRawFd, RawFd}, use std::os::unix::net::UnixStream;
unix::net::UnixStream,
};
use super::subscription::{TokenRequest, TokenUpdate}; use super::subscription::{TokenRequest, TokenUpdate};
use cctk::{ use cctk::sctk::activation::{RequestData, RequestDataExt};
sctk::{ use cctk::sctk::reexports::calloop;
self, use cctk::sctk::reexports::calloop_wayland_source::WaylandSource;
activation::{RequestData, RequestDataExt}, use cctk::sctk::seat::{SeatHandler, SeatState};
reexports::{calloop, calloop_wayland_source::WaylandSource}, use cctk::sctk::{self};
seat::{SeatHandler, SeatState}, use cctk::wayland_client::protocol::wl_seat::WlSeat;
}, use cctk::wayland_client::protocol::wl_surface::WlSurface;
wayland_client::{ use cctk::wayland_client::{self};
self,
protocol::{wl_seat::WlSeat, wl_surface::WlSurface},
},
};
use iced_futures::futures::channel::mpsc::UnboundedSender; use iced_futures::futures::channel::mpsc::UnboundedSender;
use sctk::{ use sctk::activation::{ActivationHandler, ActivationState};
activation::{ActivationHandler, ActivationState}, use sctk::registry::{ProvidesRegistryState, RegistryState};
registry::{ProvidesRegistryState, RegistryState}, use wayland_client::globals::registry_queue_init;
}; use wayland_client::{Connection, QueueHandle};
use wayland_client::{Connection, QueueHandle, globals::registry_queue_init};
struct AppData { struct AppData {
exit: bool, exit: bool,

View file

@ -1,17 +1,15 @@
// Copyright 2024 System76 <info@system76.com> // Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use { use crate::ApplicationExt;
crate::ApplicationExt, use iced::Subscription;
iced::Subscription, use iced_futures::futures::SinkExt;
iced_futures::futures::{ use iced_futures::futures::channel::mpsc::{Receiver, Sender};
SinkExt, use std::any::TypeId;
channel::mpsc::{Receiver, Sender}, use std::collections::HashMap;
}, use url::Url;
std::{any::TypeId, collections::HashMap}, use zbus::zvariant::Value;
url::Url, use zbus::{interface, proxy};
zbus::{interface, proxy, zvariant::Value},
};
#[cold] #[cold]
pub fn subscription<App: ApplicationExt>() -> Subscription<crate::Action<App::Message>> { pub fn subscription<App: ApplicationExt>() -> Subscription<crate::Action<App::Message>> {

View file

@ -872,7 +872,8 @@ trait SystemdManger {
#[cfg(all(test, not(windows)))] #[cfg(all(test, not(windows)))]
mod tests { mod tests {
use super::*; use super::*;
use std::{env, fs, path::Path, path::PathBuf}; use std::path::{Path, PathBuf};
use std::{env, fs};
use tempfile::tempdir; use tempfile::tempdir;
struct EnvVarGuard { struct EnvVarGuard {

View file

@ -1,9 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader};
DefaultLocalizer, LanguageLoader, Localizer, use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer};
fluent::{FluentLanguageLoader, fluent_language_loader},
};
use rust_embed::RustEmbed; use rust_embed::RustEmbed;
use std::sync::{LazyLock, OnceLock}; use std::sync::{LazyLock, OnceLock};

View file

@ -6,7 +6,8 @@ use super::Action;
use crate::Application; use crate::Application;
use iced::window; use iced::window;
use std::{any::Any, sync::Arc}; use std::any::Any;
use std::sync::Arc;
/// Used to produce a destroy popup message from within a widget. /// Used to produce a destroy popup message from within a widget.
#[cfg(all(feature = "wayland", target_os = "linux"))] #[cfg(all(feature = "wayland", target_os = "linux"))]

View file

@ -3,9 +3,7 @@
pub mod action; pub mod action;
use iced::Limits; use iced::{Limits, Size, Task};
use iced::Size;
use iced::Task;
use std::future::Future; use std::future::Future;
use std::sync::Arc; use std::sync::Arc;

View file

@ -7,12 +7,8 @@
pub mod portal; pub mod portal;
pub mod style; pub mod style;
use cosmic_config::CosmicConfigEntry; use cosmic_config::{CosmicConfigEntry, config_subscription};
use cosmic_config::config_subscription; use cosmic_theme::{Component, LayeredTheme, Spacing, ThemeMode};
use cosmic_theme::Component;
use cosmic_theme::LayeredTheme;
use cosmic_theme::Spacing;
use cosmic_theme::ThemeMode;
use iced_futures::Subscription; use iced_futures::Subscription;
use iced_runtime::{Appearance, DefaultStyle}; use iced_runtime::{Appearance, DefaultStyle};
use std::sync::{Arc, LazyLock, Mutex}; use std::sync::{Arc, LazyLock, Mutex};

View file

@ -6,10 +6,8 @@
use cosmic_theme::Component; use cosmic_theme::Component;
use iced_core::{Background, Color}; use iced_core::{Background, Color};
use crate::{ use crate::theme::TRANSPARENT_COMPONENT;
theme::TRANSPARENT_COMPONENT, use crate::widget::button::{Catalog, Style};
widget::button::{Catalog, Style},
};
#[derive(Default)] #[derive(Default)]
pub enum Button { pub enum Button {

View file

@ -5,18 +5,17 @@
use crate::theme::{CosmicComponent, TRANSPARENT_COMPONENT, Theme}; 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, use iced::theme::Base;
theme::Base, use iced::widget::slider::{self, Rail};
widget::{ use iced::widget::{
button as iced_button, checkbox as iced_checkbox, combo_box, container as iced_container, button as iced_button, checkbox as iced_checkbox, combo_box, container as iced_container,
pane_grid, pick_list, progress_bar, radio, rule, scrollable, pane_grid, pick_list, progress_bar, radio, rule, scrollable, svg, toggler,
slider::{self, Rail},
svg, toggler,
},
}; };
use iced_core::{Background, Border, Color, Shadow, Vector}; use iced_core::{Background, Border, Color, Shadow, Vector};
use iced_widget::{pane_grid::Highlight, scrollable::AutoScroll, text_editor, text_input}; use iced_widget::pane_grid::Highlight;
use iced_widget::scrollable::AutoScroll;
use iced_widget::{text_editor, text_input};
use palette::WithAlpha; use palette::WithAlpha;
use std::rc::Rc; use std::rc::Rc;

View file

@ -3,10 +3,13 @@
//! Contains stylesheet implementation for [`crate::widget::segmented_button`]. //! Contains stylesheet implementation for [`crate::widget::segmented_button`].
use crate::widget::segmented_button::{Appearance, ItemAppearance, StyleSheet}; use crate::theme::Theme;
use crate::{theme::Theme, widget::segmented_button::ItemStatusAppearance}; use crate::widget::segmented_button::{
Appearance, ItemAppearance, ItemStatusAppearance, StyleSheet,
};
use iced::Border; use iced::Border;
use iced_core::{Background, border::Radius}; use iced_core::Background;
use iced_core::border::Radius;
use palette::WithAlpha; use palette::WithAlpha;
#[derive(Default)] #[derive(Default)]
@ -143,7 +146,8 @@ mod horizontal {
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance}; use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
use cosmic_theme::{Component, Container}; use cosmic_theme::{Component, Container};
use iced::Border; use iced::Border;
use iced_core::{Background, border::Radius}; use iced_core::Background;
use iced_core::border::Radius;
use palette::WithAlpha; use palette::WithAlpha;
pub fn tab_bar(cosmic: &cosmic_theme::Theme, container: &Container) -> Appearance { pub fn tab_bar(cosmic: &cosmic_theme::Theme, container: &Container) -> Appearance {
@ -250,7 +254,8 @@ mod vertical {
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance}; use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
use cosmic_theme::{Component, Container}; use cosmic_theme::{Component, Container};
use iced::Border; use iced::Border;
use iced_core::{Background, border::Radius}; use iced_core::Background;
use iced_core::border::Radius;
use palette::WithAlpha; use palette::WithAlpha;
pub fn tab_bar(cosmic: &cosmic_theme::Theme, container: &Container) -> Appearance { pub fn tab_bar(cosmic: &cosmic_theme::Theme, container: &Container) -> Appearance {

View file

@ -1,8 +1,6 @@
use crate::{ use crate::iced::{Alignment, Length};
Apply, Element, fl, use crate::widget::{self, list};
iced::{Alignment, Length}, use crate::{Apply, Element, fl};
widget::{self, list},
};
use std::rc::Rc; use std::rc::Rc;
#[derive(Debug, Default, Clone, derive_setters::Setters)] #[derive(Debug, Default, Clone, derive_setters::Setters)]

View file

@ -3,13 +3,10 @@
use iced::Size; use iced::Size;
use iced::widget::Container; use iced::widget::Container;
use iced_core::event::Event; use iced_core::event::Event;
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::Tree; use iced_core::widget::Tree;
use iced_core::{ use iced_core::{
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget,
layout, mouse, overlay, renderer,
}; };
pub use iced_widget::container::{Catalog, Style}; pub use iced_widget::container::{Catalog, Style};

View file

@ -1,12 +1,11 @@
//! Autosize Container, which will resize the window to its contents. //! Autosize Container, which will resize the window to its contents.
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::{Id, Operation, Tree}; use iced_core::widget::{Id, Operation, Tree};
use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget}; use iced_core::{
Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget, layout, mouse, overlay,
renderer,
};
pub use iced_widget::container::{Catalog, Style}; pub use iced_widget::container::{Catalog, Style};
pub fn autosize<'a, Message: 'static, Theme, E>( pub fn autosize<'a, Message: 'static, Theme, E>(

View file

@ -3,9 +3,13 @@
use super::{Builder, ButtonClass}; use super::{Builder, ButtonClass};
use crate::Element; use crate::Element;
use crate::widget::{icon::Handle, tooltip}; use crate::widget::icon::Handle;
use crate::widget::tooltip;
use apply::Apply; use apply::Apply;
use iced_core::{Alignment, Length, Padding, font::Weight, text::LineHeight, widget::Id}; use iced_core::font::Weight;
use iced_core::text::LineHeight;
use iced_core::widget::Id;
use iced_core::{Alignment, Length, Padding};
use std::borrow::Cow; use std::borrow::Cow;
pub type Button<'a, Message> = Builder<'a, Message, Icon>; pub type Button<'a, Message> = Builder<'a, Message, Icon>;

View file

@ -2,11 +2,12 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::Builder; use super::Builder;
use crate::{ use crate::Element;
Element, use crate::widget::image::Handle;
widget::{self, image::Handle}, use crate::widget::{self};
}; use iced_core::font::Weight;
use iced_core::{Length, Padding, font::Weight, widget::Id}; use iced_core::widget::Id;
use iced_core::{Length, Padding};
use std::borrow::Cow; use std::borrow::Cow;
pub type Button<'a, Message> = Builder<'a, Message, Image<'a, Handle, Message>>; pub type Button<'a, Message> = Builder<'a, Message, Image<'a, Handle, Message>>;

View file

@ -3,14 +3,15 @@
//! Hyperlink button widget //! Hyperlink button widget
use super::Builder; use super::{Builder, ButtonClass};
use super::ButtonClass;
use crate::Element; 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 iced_core::font::Weight;
use iced_core::text::LineHeight; use iced_core::text::LineHeight;
use iced_core::{Alignment, Length, Padding, font::Weight, widget::Id}; use iced_core::widget::Id;
use iced_core::{Alignment, Length, Padding};
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

@ -2,7 +2,8 @@
// 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::{Background, Color, Vector, border::Radius}; use iced_core::border::Radius;
use iced_core::{Background, Color, Vector};
use crate::theme::THEME; use crate::theme::THEME;

View file

@ -4,7 +4,10 @@
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::{Alignment, Length, Padding, font::Weight, text::LineHeight, widget::Id}; use iced_core::font::Weight;
use iced_core::text::LineHeight;
use iced_core::widget::Id;
use iced_core::{Alignment, Length, Padding};
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

@ -11,15 +11,12 @@ use iced_runtime::{Action, Task, keyboard, task};
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::renderer::{self, Quad, Renderer}; use iced_core::renderer::{self, Quad, Renderer};
use iced_core::touch;
use iced_core::widget::Operation; use iced_core::widget::Operation;
use iced_core::widget::tree::{self, Tree}; use iced_core::widget::tree::{self, Tree};
use iced_core::{ use iced_core::{
Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget, Background, Border, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shadow, Shell,
Vector, Widget, layout, mouse, overlay, svg, touch,
}; };
use iced_core::{Border, mouse};
use iced_core::{Shadow, overlay};
use iced_core::{layout, svg};
use iced_renderer::core::widget::operation; use iced_renderer::core::widget::operation;
use crate::theme::THEME; use crate::theme::THEME;
@ -647,10 +644,8 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
state: &Tree, state: &Tree,
p: mouse::Cursor, p: mouse::Cursor,
) -> iced_accessibility::A11yTree { ) -> iced_accessibility::A11yTree {
use iced_accessibility::{ use iced_accessibility::accesskit::{Action, Node, NodeId, Rect, Role};
A11yNode, A11yTree, use iced_accessibility::{A11yNode, A11yTree};
accesskit::{Action, Node, NodeId, Rect, Role},
};
// TODO why is state None sometimes? // TODO why is state None sometimes?
if matches!(state.state, iced_core::widget::tree::State::None) { if matches!(state.state, iced_core::widget::tree::State::None) {
tracing::info!("Button state is missing."); tracing::info!("Button state is missing.");

View file

@ -8,10 +8,8 @@ use crate::widget::{button, column, grid, icon, row, text};
use apply::Apply; use apply::Apply;
use iced::alignment::Vertical; use iced::alignment::Vertical;
use iced_core::{Alignment, Length}; use iced_core::{Alignment, Length};
use jiff::{ use jiff::ToSpan;
ToSpan, use jiff::civil::{Date, Weekday};
civil::{Date, Weekday},
};
/// A widget that displays an interactive calendar. /// A widget that displays an interactive calendar.
pub fn calendar<M>( pub fn calendar<M>(

View file

@ -1,23 +1,18 @@
//! An expandable stack of cards //! An expandable stack of cards
use std::time::Duration; use std::time::Duration;
use crate::{ use crate::anim;
anim, use crate::widget::card::style::Style;
widget::{ use crate::widget::icon::{self, Handle};
button, use crate::widget::{button, column, row, text};
card::style::Style,
column,
icon::{self, Handle},
row, text,
},
};
use float_cmp::approx_eq; use float_cmp::approx_eq;
use iced::widget; use iced::widget;
use iced_core::{ use iced_core::border::Radius;
Border, Element, Event, Length, Shadow, Size, Vector, Widget, border::Radius, id::Id, use iced_core::id::Id;
layout::Node, renderer::Quad, widget::Tree, use iced_core::layout::Node;
}; use iced_core::renderer::Quad;
use iced_core::{widget::tree, window}; use iced_core::widget::{Tree, tree};
use iced_core::{Border, Element, Event, Length, Shadow, Size, Vector, Widget, window};
const ICON_SIZE: u16 = 16; const ICON_SIZE: u16 = 16;
const TOP_SPACING: u16 = 4; const TOP_SPACING: u16 = 4;

View file

@ -12,7 +12,9 @@ use std::time::{Duration, Instant};
use crate::Element; 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;
use crate::widget::segmented_button::Entity;
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::{self, Event};
@ -25,10 +27,8 @@ use iced_core::{
}; };
use iced_widget::slider::HandleShape; use iced_widget::slider::HandleShape;
use iced_widget::{ use iced_widget::space::{horizontal, vertical};
Row, canvas, column, row, scrollable, use iced_widget::{Row, canvas, column, row, scrollable};
space::{horizontal, vertical},
};
use palette::{FromColor, RgbHue}; use palette::{FromColor, RgbHue};
use super::divider::horizontal; use super::divider::horizontal;

View file

@ -5,8 +5,7 @@ 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::{Clipboard, Shell}; use iced::advanced::{Clipboard, Shell, overlay, renderer};
use iced::advanced::{overlay, renderer};
use iced::{Event, Point, Size, mouse}; use iced::{Event, Point, Size, mouse};
use iced_core::{Renderer, touch}; use iced_core::{Renderer, touch};

View file

@ -6,11 +6,10 @@ use crate::widget::{self, LayerContainer, button, column, container, icon, row,
use crate::{Apply, Element, Renderer, Theme, fl}; use crate::{Apply, Element, Renderer, Theme, fl};
use std::borrow::Cow; use std::borrow::Cow;
use iced_core::Alignment;
use iced_core::event::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, Rectangle, Shell, Vector, Widget, layout, mouse, Alignment, Clipboard, Layout, Length, Rectangle, Shell, Vector, Widget, layout, mouse,
overlay as iced_overlay, renderer, overlay as iced_overlay, renderer,
}; };

View file

@ -81,7 +81,8 @@ impl<Message: Clone + 'static> ContextMenu<'_, Message> {
my_state: &mut LocalState, my_state: &mut LocalState,
) { ) {
if self.window_id != window::Id::NONE && self.on_surface_action.is_some() { if self.window_id != window::Id::NONE && self.on_surface_action.is_some() {
use crate::{surface::action::destroy_popup, widget::menu::Menu}; use crate::surface::action::destroy_popup;
use crate::widget::menu::Menu;
use iced_runtime::platform_specific::wayland::popup::{ use iced_runtime::platform_specific::wayland::popup::{
SctkPopupSettings, SctkPositioner, SctkPopupSettings, SctkPositioner,
}; };

View file

@ -1,8 +1,5 @@
use crate::{ use crate::iced::{Length, Pixels};
Element, use crate::{Element, style, theme, widget};
iced::{Length, Pixels},
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

@ -1,29 +1,17 @@
use std::{ use std::borrow::Cow;
borrow::Cow, use std::sync::atomic::{AtomicU64, Ordering};
sync::atomic::{AtomicU64, Ordering},
};
use iced::Vector; use iced::Vector;
use crate::{ use crate::Element;
Element, use crate::widget::{Id, Widget};
widget::{Id, Widget},
};
use iced::{ use iced::clipboard::dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent};
Event, Length, Rectangle, use iced::clipboard::mime::AllowedMimeTypes;
clipboard::{ use iced::id::Internal;
dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent}, use iced::{Event, Length, Rectangle, event, mouse, overlay};
mime::AllowedMimeTypes, use iced_core::widget::{Tree, tree};
}, use iced_core::{self, Clipboard, Shell, layout};
event,
id::Internal,
mouse, overlay,
};
use iced_core::{
self, Clipboard, Shell, layout,
widget::{Tree, tree},
};
pub fn dnd_destination<'a, Message: 'static>( pub fn dnd_destination<'a, Message: 'static>(
child: impl Into<Element<'a, Message>>, child: impl Into<Element<'a, Message>>,

View file

@ -1,20 +1,14 @@
use std::any::Any; use std::any::Any;
use iced_core::{widget::Operation, window}; use iced_core::widget::Operation;
use iced_core::window;
use crate::{ use crate::Element;
Element, use crate::widget::{Id, Widget, container};
widget::{Id, Widget, container}, use iced::clipboard::dnd::{DndAction, DndEvent, SourceEvent};
}; use iced::{Event, Length, Point, Rectangle, Vector, event, mouse, overlay};
use iced::{ use iced_core::widget::{Tree, tree};
Event, Length, Point, Rectangle, Vector, use iced_core::{self, Clipboard, Shell, layout, renderer};
clipboard::dnd::{DndAction, DndEvent, SourceEvent},
event, mouse, overlay,
};
use iced_core::{
self, Clipboard, Shell, layout, renderer,
widget::{Tree, tree},
};
pub fn dnd_source< pub fn dnd_source<
'a, 'a,

View file

@ -3,7 +3,8 @@
// 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::{Background, Color, border::Radius}; use iced_core::border::Radius;
use iced_core::{Background, Color};
/// The appearance of a menu. /// The appearance of a menu.
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]

View file

@ -9,9 +9,9 @@ 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::{ use iced_core::{
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shadow, Shell, Size, Vector, Widget,
alignment, keyboard, layout, mouse, overlay, renderer, svg, touch,
}; };
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

@ -12,9 +12,9 @@ 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::{ use iced_core::{
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shadow, Shell, Size, Vector, Widget,
alignment, keyboard, layout, mouse, overlay, renderer, svg, touch,
}; };
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;

View file

@ -2,14 +2,12 @@
//! Based on <https://github.com/tarkah/iced_gif/> //! Based on <https://github.com/tarkah/iced_gif/>
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fmt;
use std::io;
use std::path::Path; use std::path::Path;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use std::{fmt, io};
use ::image as image_rs; use ::image as image_rs;
use iced::Task; use iced::{Task, mouse};
use iced::mouse;
use iced_core::image::Renderer as ImageRenderer; use iced_core::image::Renderer as ImageRenderer;
use iced_core::mouse::Cursor; use iced_core::mouse::Cursor;
use iced_core::widget::{Tree, tree}; use iced_core::widget::{Tree, tree};

View file

@ -5,7 +5,8 @@ use crate::cosmic_theme::{Density, Spacing};
use crate::{Element, theme, widget}; use crate::{Element, theme, widget};
use apply::Apply; use apply::Apply;
use derive_setters::Setters; use derive_setters::Setters;
use iced_core::{Length, Size, Vector, Widget, layout, text, widget::tree}; use iced_core::widget::tree;
use iced_core::{Length, Size, Vector, Widget, layout, text};
use std::borrow::Cow; use std::borrow::Cow;
#[must_use] #[must_use]

View file

@ -2,7 +2,10 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::{Handle, Icon}; use super::{Handle, Icon};
use std::{borrow::Cow, ffi::OsStr, path::PathBuf, sync::Arc}; use std::borrow::Cow;
use std::ffi::OsStr;
use std::path::PathBuf;
use std::sync::Arc;
#[derive(Debug, Clone, Default, Hash)] #[derive(Debug, Clone, Default, Hash)]
/// Fallback icon to use if the icon was not found. /// Fallback icon to use if the icon was not found.

View file

@ -1,10 +1,9 @@
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::{Id, Operation, Tree}; use iced_core::widget::{Id, Operation, Tree};
use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget}; use iced_core::{
Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget, layout, mouse, overlay,
renderer,
};
pub use iced_widget::container::{Catalog, Style}; pub use iced_widget::container::{Catalog, Style};
pub fn id_container<'a, Message: 'static, Theme, E>( pub fn id_container<'a, Message: 'static, Theme, E>(

View file

@ -2,13 +2,10 @@ use crate::Theme;
use cosmic_theme::LayeredTheme; use cosmic_theme::LayeredTheme;
use iced::widget::Container; use iced::widget::Container;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::Tree; use iced_core::widget::Tree;
use iced_core::{ use iced_core::{
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget,
layout, mouse, overlay, renderer,
}; };
pub use iced_widget::container::{Catalog, Style}; pub use iced_widget::container::{Catalog, Style};

View file

@ -2,7 +2,8 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use crate::widget::container::Catalog; use crate::widget::container::Catalog;
use crate::widget::{button, column, container, divider, row, space::vertical}; use crate::widget::space::vertical;
use crate::widget::{button, column, container, divider, row};
use crate::{Apply, Element, theme}; use crate::{Apply, Element, theme};
use iced::{Length, Padding}; use iced::{Length, Padding};

View file

@ -1,11 +1,9 @@
// From iced_aw, license MIT // From iced_aw, license MIT
use iced_core::{Widget, widget::Tree}; use iced_core::Widget;
use iced_widget::core::{ use iced_core::widget::Tree;
Alignment, Element, Padding, Point, Size, use iced_widget::core::layout::{Limits, Node};
layout::{Limits, Node}, use iced_widget::core::{Alignment, Element, Padding, Point, Size, renderer};
renderer,
};
use crate::widget::RcElementWrapper; use crate::widget::RcElementWrapper;

View file

@ -1,14 +1,14 @@
// From iced_aw, license MIT // From iced_aw, license MIT
//! A widget that handles menu trees //! A widget that handles menu trees
use std::{collections::HashMap, sync::Arc}; use std::collections::HashMap;
use std::sync::Arc;
use super::{ use super::menu_inner::{
menu_inner::{ CloseCondition, Direction, ItemHeight, ItemWidth, Menu, MenuState, PathHighlight,
CloseCondition, Direction, ItemHeight, ItemWidth, Menu, MenuState, PathHighlight,
},
menu_tree::MenuTree,
}; };
use super::menu_tree::MenuTree;
use crate::Renderer;
#[cfg(all( #[cfg(all(
feature = "multi-window", feature = "multi-window",
feature = "wayland", feature = "wayland",
@ -17,26 +17,21 @@ use super::{
feature = "surface-message" feature = "surface-message"
))] ))]
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem}; use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
use crate::{ use crate::style::menu_bar::StyleSheet;
Renderer, use crate::widget::RcWrapper;
style::menu_bar::StyleSheet, use crate::widget::dropdown::menu::{self, State};
widget::{ use crate::widget::menu::menu_inner::init_root_menu;
RcWrapper,
dropdown::menu::{self, State},
menu::menu_inner::init_root_menu,
},
};
use iced::{Point, Shadow, Vector, event::Status, window}; use iced::event::Status;
use iced::{Point, Shadow, Vector, window};
use iced_core::Border; use iced_core::Border;
use iced_widget::core::layout::{Limits, Node};
use iced_widget::core::mouse::{self, Cursor};
use iced_widget::core::renderer::{self, Renderer as IcedRenderer};
use iced_widget::core::widget::{Tree, tree};
use iced_widget::core::{ use iced_widget::core::{
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, event, Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, event,
layout::{Limits, Node}, overlay, touch,
mouse::{self, Cursor},
overlay,
renderer::{self, Renderer as IcedRenderer},
touch,
widget::{Tree, tree},
}; };
/// 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.
@ -590,7 +585,8 @@ where
viewport: &Rectangle, viewport: &Rectangle,
) { ) {
use event::Event::{Mouse, Touch}; use event::Event::{Mouse, Touch};
use mouse::{Button::Left, Event::ButtonReleased}; use mouse::Button::Left;
use mouse::Event::ButtonReleased;
use touch::Event::{FingerLifted, FingerLost}; use touch::Event::{FingerLifted, FingerLost};
process_root_events( process_root_events(

View file

@ -1,9 +1,11 @@
// From iced_aw, license MIT // From iced_aw, license MIT
//! Menu tree overlay //! Menu tree overlay
use std::{borrow::Cow, sync::Arc}; use std::borrow::Cow;
use std::sync::Arc;
use super::{menu_bar::MenuBarState, menu_tree::MenuTree}; use super::menu_bar::MenuBarState;
use super::menu_tree::MenuTree;
#[cfg(all( #[cfg(all(
feature = "multi-window", feature = "multi-window",
feature = "wayland", feature = "wayland",
@ -16,12 +18,12 @@ use crate::style::menu_bar::StyleSheet;
use iced::window; use iced::window;
use iced_core::{Border, Renderer as IcedRenderer, Shadow, Widget}; use iced_core::{Border, Renderer as IcedRenderer, Shadow, Widget};
use iced_widget::core::layout::{Limits, Node};
use iced_widget::core::mouse::{self, Cursor};
use iced_widget::core::widget::Tree;
use iced_widget::core::{ use iced_widget::core::{
Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, event, Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, event, overlay,
layout::{Limits, Node}, renderer, touch,
mouse::{self, Cursor},
overlay, renderer, touch,
widget::Tree,
}; };
/// The condition of when to close a menu /// The condition of when to close a menu
@ -559,14 +561,10 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
clipboard: &mut dyn Clipboard, clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>, shell: &mut Shell<'_, Message>,
) -> Option<(usize, MenuState)> { ) -> Option<(usize, MenuState)> {
use event::{ use event::Event::{Mouse, Touch};
Event::{Mouse, Touch}, use event::Status::{Captured, Ignored};
Status::{Captured, Ignored}, use mouse::Button::Left;
}; use mouse::Event::{ButtonPressed, ButtonReleased, CursorMoved, WheelScrolled};
use mouse::{
Button::Left,
Event::{ButtonPressed, ButtonReleased, CursorMoved, WheelScrolled},
};
use touch::Event::{FingerLifted, FingerMoved, FingerPressed}; use touch::Event::{FingerLifted, FingerMoved, FingerPressed};
if !self if !self

View file

@ -154,7 +154,7 @@ pub use dialog::{Dialog, dialog};
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::Rule, widget::rule}; use iced::widget::{Rule, rule};
/// Horizontal divider with default thickness /// Horizontal divider with default thickness
#[must_use] #[must_use]

View file

@ -6,10 +6,9 @@
//! For details on the model, see the [`segmented_button`] module for more details. //! For details on the model, see the [`segmented_button`] module for more details.
use apply::Apply; use apply::Apply;
use iced::{ use iced::clipboard::dnd::DndAction;
Background, Length, use iced::clipboard::mime::AllowedMimeTypes;
clipboard::{dnd::DndAction, mime::AllowedMimeTypes}, use iced::{Background, Length};
};
use iced_core::{Border, Color, Shadow}; use iced_core::{Border, Color, Shadow};
use crate::widget::{Container, Icon, container, menu, scrollable, segmented_button}; use crate::widget::{Container, Icon, container, menu, scrollable, segmented_button};

View file

@ -5,14 +5,10 @@
use iced::widget; use iced::widget;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::touch;
use iced_core::widget::{Operation, Tree}; use iced_core::widget::{Operation, 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, layout,
mouse, overlay, renderer, touch,
}; };
pub use iced_widget::container::{Catalog, Style}; pub use iced_widget::container::{Catalog, Style};

View file

@ -1,14 +1,10 @@
//! Show a circular progress indicator. //! Show a circular progress indicator.
use super::animation::{Animation, Progress}; use super::animation::{Animation, Progress};
use super::style::StyleSheet; use super::style::StyleSheet;
use iced::advanced::layout;
use iced::advanced::renderer;
use iced::advanced::widget::tree::{self, Tree}; use iced::advanced::widget::tree::{self, Tree};
use iced::advanced::{self, Clipboard, Layout, Shell, Widget}; use iced::advanced::{self, Clipboard, Layout, Shell, Widget, layout, renderer};
use iced::mouse;
use iced::widget::canvas; use iced::widget::canvas;
use iced::window; use iced::{Element, Event, Length, Radians, Rectangle, Renderer, Size, Vector, mouse, window};
use iced::{Element, Event, Length, Radians, Rectangle, Renderer, Size, Vector};
use std::f32::consts::PI; use std::f32::consts::PI;
use std::time::Duration; use std::time::Duration;

View file

@ -1,13 +1,9 @@
//! Show a linear progress indicator. //! Show a linear progress indicator.
use super::animation::{Animation, Progress}; use super::animation::{Animation, Progress};
use super::style::StyleSheet; use super::style::StyleSheet;
use iced::advanced::layout;
use iced::advanced::renderer;
use iced::advanced::widget::tree::{self, Tree}; use iced::advanced::widget::tree::{self, Tree};
use iced::advanced::{self, Clipboard, Layout, Shell, Widget}; use iced::advanced::{self, Clipboard, Layout, Shell, Widget, layout, renderer};
use iced::mouse; use iced::{Background, Element, Event, Length, Rectangle, Size, mouse, window};
use iced::window;
use iced::{Background, Element, Event, Length, Rectangle, Size};
use std::time::Duration; use std::time::Duration;

View file

@ -2,14 +2,10 @@
use crate::{Theme, theme}; use crate::{Theme, theme};
use iced::border; use iced::border;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::touch;
use iced_core::widget::tree::Tree; use iced_core::widget::tree::Tree;
use iced_core::{ use iced_core::{
Border, Clipboard, Element, Layout, Length, Pixels, Rectangle, Shell, Size, Vector, Widget, Border, Clipboard, Element, Layout, Length, Pixels, Rectangle, Shell, Size, Vector, Widget,
layout, mouse, overlay, renderer, touch,
}; };
use iced_widget::radio as iced_radio; use iced_widget::radio as iced_radio;

View file

@ -6,13 +6,13 @@ use iced::widget::Container;
pub use subscription::*; pub use subscription::*;
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::Tree; use iced_core::widget::Tree;
use iced_core::{Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget}; use iced_core::{
use std::{fmt::Debug, hash::Hash}; Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, layout,
mouse, overlay, renderer,
};
use std::fmt::Debug;
use std::hash::Hash;
pub use iced_widget::container::{Catalog, Style}; pub use iced_widget::container::{Catalog, Style};

View file

@ -1,13 +1,10 @@
use iced::{ use iced::Rectangle;
Rectangle, use iced::futures::channel::mpsc::{UnboundedReceiver, unbounded};
futures::{ use iced::futures::{StreamExt, stream};
StreamExt,
channel::mpsc::{UnboundedReceiver, unbounded},
stream,
},
};
use iced_futures::Subscription; use iced_futures::Subscription;
use std::{collections::HashMap, fmt::Debug, hash::Hash}; use std::collections::HashMap;
use std::fmt::Debug;
use std::hash::Hash;
use super::RectangleTracker; use super::RectangleTracker;

View file

@ -2,12 +2,11 @@
use iced::{Limits, Size}; use iced::{Limits, Size};
use iced_core::event::{self, Event}; use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::{Id, Operation, Tree, tree}; use iced_core::widget::{Id, Operation, Tree, tree};
use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget}; use iced_core::{
Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget, layout, mouse, overlay,
renderer,
};
pub(crate) fn responsive_container<'a, Message: 'static, Theme, E>( pub(crate) fn responsive_container<'a, Message: 'static, Theme, E>(
content: E, content: E,

View file

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

View file

@ -25,9 +25,11 @@ use iced_core::id::Internal;
use iced_core::mouse::ScrollDelta; use iced_core::mouse::ScrollDelta;
use iced_core::text::{self, Ellipsize, LineHeight, Renderer as TextRenderer, Shaping, Wrapping}; use iced_core::text::{self, Ellipsize, LineHeight, Renderer as TextRenderer, Shaping, Wrapping};
use iced_core::widget::operation::Focusable; use iced_core::widget::operation::Focusable;
use iced_core::widget::{self, operation, tree}; use iced_core::widget::{self, Tree, operation, tree};
use iced_core::{Border, Point, Renderer as IcedRenderer, Shadow, Text}; use iced_core::{
use iced_core::{Clipboard, Layout, Shell, Widget, layout, renderer, widget::Tree}; Border, Clipboard, Layout, Point, Renderer as IcedRenderer, Shadow, Shell, Text, Widget,
layout, renderer,
};
use iced_runtime::{Action, task}; use iced_runtime::{Action, task};
use slotmap::{Key, SecondaryMap}; use slotmap::{Key, SecondaryMap};
use std::borrow::Cow; use std::borrow::Cow;

View file

@ -3,12 +3,11 @@
use std::borrow::Cow; use std::borrow::Cow;
use crate::{ use crate::widget::{FlexRow, Row, column, container, flex_row, list, row, text};
Element, Theme, theme, use crate::{Element, Theme, theme};
widget::{FlexRow, Row, column, container, flex_row, list, row, text},
};
use derive_setters::Setters; use derive_setters::Setters;
use iced_core::{Length, text::Wrapping}; use iced_core::Length;
use iced_core::text::Wrapping;
use iced_widget::space; use iced_widget::space;
use taffy::AlignContent; use taffy::AlignContent;

View file

@ -3,13 +3,10 @@
//! A control for incremental adjustments of a value. //! A control for incremental adjustments of a value.
use crate::{ use crate::widget::{button, column, container, icon, row, text};
Element, theme, use crate::{Element, theme};
widget::{button, column, container, icon, row, text},
};
use apply::Apply; use apply::Apply;
use iced::{Alignment, Length}; use iced::{Alignment, Border, Length, Shadow};
use iced::{Border, Shadow};
use std::borrow::Cow; use std::borrow::Cow;
use std::ops::{Add, Sub}; use std::ops::{Add, Sub};

View file

@ -2,12 +2,9 @@
//! //!
pub mod model; pub mod model;
pub use model::{ pub use model::category::{ItemCategory, ItemInterface};
Entity, Model, pub use model::selection::{MultiSelect, SingleSelect};
category::ItemCategory, pub use model::{Entity, Model};
category::ItemInterface,
selection::{MultiSelect, SingleSelect},
};
pub mod widget; pub mod widget;
pub use widget::compact::CompactTableView; pub use widget::compact::CompactTableView;
pub use widget::standard::TableView; pub use widget::standard::TableView;

View file

@ -3,10 +3,8 @@
use slotmap::{SecondaryMap, SparseSecondaryMap}; use slotmap::{SecondaryMap, SparseSecondaryMap};
use super::{ use super::category::{ItemCategory, ItemInterface};
Entity, Model, Selectable, use super::{Entity, Model, Selectable};
category::{ItemCategory, ItemInterface},
};
/// A newly-inserted item which may have additional actions applied to it. /// A newly-inserted item which may have additional actions applied to it.
pub struct EntityMut< pub struct EntityMut<

View file

@ -2,10 +2,8 @@ pub mod category;
pub mod entity; pub mod entity;
pub mod selection; pub mod selection;
use std::{ use std::any::{Any, TypeId};
any::{Any, TypeId}, use std::collections::{HashMap, VecDeque};
collections::{HashMap, VecDeque},
};
use category::{ItemCategory, ItemInterface}; use category::{ItemCategory, ItemInterface};
use entity::EntityMut; use entity::EntityMut;

View file

@ -3,10 +3,8 @@
//! Describes logic specific to the single-select and multi-select modes of a model. //! Describes logic specific to the single-select and multi-select modes of a model.
use super::{ use super::category::{ItemCategory, ItemInterface};
Entity, Model, use super::{Entity, Model};
category::{ItemCategory, ItemInterface},
};
use std::collections::HashSet; use std::collections::HashSet;
/// Describes a type that has selectable items. /// Describes a type that has selectable items.

View file

@ -1,14 +1,10 @@
use derive_setters::Setters; use derive_setters::Setters;
use crate::widget::table::model::{ use crate::widget::table::model::category::{ItemCategory, ItemInterface};
Entity, Model, use crate::widget::table::model::selection::Selectable;
category::{ItemCategory, ItemInterface}, use crate::widget::table::model::{Entity, Model};
selection::Selectable, use crate::widget::{self, container, menu};
}; use crate::{Apply, Element, theme};
use crate::{
Apply, Element, theme,
widget::{self, container, menu},
};
use iced::{Alignment, Border, Padding}; use iced::{Alignment, Border, Padding};
#[derive(Setters)] #[derive(Setters)]

View file

@ -1,14 +1,10 @@
use derive_setters::Setters; use derive_setters::Setters;
use crate::widget::table::model::{ use crate::widget::table::model::category::{ItemCategory, ItemInterface};
Entity, Model, use crate::widget::table::model::selection::Selectable;
category::{ItemCategory, ItemInterface}, use crate::widget::table::model::{Entity, Model};
selection::Selectable, use crate::widget::{self, container, divider, menu};
}; use crate::{Apply, Element, theme};
use crate::{
Apply, Element, theme,
widget::{self, container, divider, menu},
};
use iced::{Alignment, Border, Length, Padding}; use iced::{Alignment, Border, Length, Padding};
// THIS IS A PLACEHOLDER UNTIL A MORE SOPHISTICATED WIDGET CAN BE DEVELOPED // THIS IS A PLACEHOLDER UNTIL A MORE SOPHISTICATED WIDGET CAN BE DEVELOPED

View file

@ -2,7 +2,8 @@
// Copyright 2023 System76 <info@system76.com> // Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use super::{cursor::Cursor, value::Value}; use super::cursor::Cursor;
use super::value::Value;
pub struct Editor<'a> { pub struct Editor<'a> {
value: &'a mut Value, value: &'a mut Value,

View file

@ -28,18 +28,14 @@ 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, Affinity, Paragraph, Renderer, Text};
use iced_core::time::{Duration, Instant}; use iced_core::time::{Duration, Instant};
use iced_core::touch;
use iced_core::widget::Id; use iced_core::widget::Id;
use iced_core::widget::operation::{self, Operation}; use iced_core::widget::operation::{self, Operation};
use iced_core::widget::tree::{self, Tree}; use iced_core::widget::tree::{self, Tree};
use iced_core::window;
use iced_core::{Background, alignment};
use iced_core::{Border, Shadow, keyboard};
use iced_core::{ use iced_core::{
Clipboard, Color, Element, Layout, Length, Padding, Pixels, Point, Rectangle, Shell, Size, Background, Border, Clipboard, Color, Element, Layout, Length, Padding, Pixels, Point,
Vector, Widget, Rectangle, Shadow, Shell, Size, Vector, Widget, alignment, keyboard, layout, overlay, touch,
window,
}; };
use iced_core::{layout, overlay};
use iced_runtime::{Action, Task, task}; use iced_runtime::{Action, Task, task};
thread_local! { thread_local! {

View file

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

View file

@ -6,16 +6,13 @@
use std::collections::VecDeque; use std::collections::VecDeque;
use std::rc::Rc; use std::rc::Rc;
use crate::widget::Column; use crate::widget::{Column, container};
use crate::widget::container;
use iced::Task; use iced::Task;
use iced_core::Element; use iced_core::Element;
use slotmap::SlotMap; use slotmap::{SlotMap, new_key_type};
use slotmap::new_key_type;
use widget::Toaster; use widget::Toaster;
use super::column; use super::{button, column, icon, row, text};
use super::{button, icon, row, text};
mod widget; mod widget;

View file

@ -4,16 +4,14 @@
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::mouse;
use iced_core::overlay;
use iced_core::renderer::{self}; use iced_core::renderer::{self};
use iced_core::widget::Operation; use iced_core::widget::Operation;
use iced_core::widget::tree::Tree; use iced_core::widget::tree::Tree;
use iced_core::{Clipboard, Layout, Length, Point, Rectangle, Shell, Vector, Widget}; use iced_core::{
Clipboard, Element, Layout, Length, Overlay, Point, Rectangle, Shell, Vector, Widget, layout,
mouse, overlay,
};
pub struct Toaster<'a, Message, Theme, Renderer> { pub struct Toaster<'a, Message, Theme, Renderer> {
toasts: Element<'a, Message, Theme, Renderer>, toasts: Element<'a, Message, Theme, Renderer>,

View file

@ -3,15 +3,14 @@
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use crate::{Element, anim}; use crate::{Element, anim};
use iced_core::renderer::{self, Renderer};
use iced_core::widget::{self, Tree, tree};
use iced_core::{ use iced_core::{
Border, Clipboard, Event, Layout, Length, Pixels, Rectangle, Shell, Size, Widget, alignment, Border, Clipboard, Event, Layout, Length, Pixels, Rectangle, Shell, Size, Widget, alignment,
event, layout, mouse, event, layout, mouse, text, touch, window,
renderer::{self, Renderer},
text, touch,
widget::{self, Tree, tree},
window,
}; };
use iced_widget::{Id, toggler::Status}; use iced_widget::Id;
use iced_widget::toggler::Status;
pub use iced_widget::toggler::{Catalog, Style}; pub use iced_widget::toggler::{Catalog, Style};

View file

@ -5,7 +5,8 @@ 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::{Background, Color, Vector, border::Radius}; use iced_core::border::Radius;
use iced_core::{Background, Color, Vector};
use crate::theme::THEME; use crate::theme::THEME;

View file

@ -14,16 +14,12 @@ use iced::Task;
use iced_runtime::core::widget::Id; 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::touch;
use iced_core::widget::Operation; use iced_core::widget::Operation;
use iced_core::widget::tree::{self, Tree}; use iced_core::widget::tree::{self, Tree};
use iced_core::{ use iced_core::{
Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget, Background, Border, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shadow, Shell,
Vector, Widget, layout, mouse, overlay, renderer, svg, touch,
}; };
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};

View file

@ -1,13 +1,13 @@
use std::{ use std::borrow::Borrow;
borrow::Borrow, use std::cell::RefCell;
cell::RefCell, use std::rc::Rc;
rc::Rc, use std::thread::{self, ThreadId};
thread::{self, ThreadId},
};
use crate::Element; use crate::Element;
use iced::{Length, Rectangle, Size, event}; use iced::{Length, Rectangle, Size, event};
use iced_core::{Widget, id::Id, widget, widget::tree}; use iced_core::id::Id;
use iced_core::widget::tree;
use iced_core::{Widget, widget};
#[derive(Debug)] #[derive(Debug)]
pub struct RcWrapper<T> { pub struct RcWrapper<T> {