chore: add rustfmt config
This commit is contained in:
parent
9abc4d483b
commit
9c2a86a8f4
98 changed files with 419 additions and 540 deletions
15
.zed/settings.json
Normal file
15
.zed/settings.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"format_on_save": "on",
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
"initialization_options": {
|
||||
"check": {
|
||||
"command": "clippy",
|
||||
},
|
||||
"rustfmt": {
|
||||
"extraArgs": ["+nightly"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
use std::{any::TypeId, ops::Deref};
|
||||
use std::any::TypeId;
|
||||
use std::ops::Deref;
|
||||
|
||||
use crate::{CosmicConfigEntry, Update};
|
||||
use cosmic_settings_daemon::{Changed, ConfigProxy, CosmicSettingsDaemonProxy};
|
||||
use futures_util::SinkExt;
|
||||
use iced_futures::{
|
||||
Subscription,
|
||||
futures::{self, StreamExt, future::pending},
|
||||
stream,
|
||||
};
|
||||
use iced_futures::futures::future::pending;
|
||||
use iced_futures::futures::{self, StreamExt};
|
||||
use iced_futures::{Subscription, stream};
|
||||
|
||||
pub async fn settings_daemon_proxy() -> zbus::Result<CosmicSettingsDaemonProxy<'static>> {
|
||||
let conn = zbus::Connection::session().await?;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
//! Integrations for cosmic-config — the cosmic configuration system.
|
||||
|
||||
use notify::{
|
||||
RecommendedWatcher, Watcher,
|
||||
event::{EventKind, ModifyKind, RenameMode},
|
||||
};
|
||||
use serde::{Serialize, de::DeserializeOwned};
|
||||
use std::{
|
||||
env, fmt, fs,
|
||||
io::Write,
|
||||
path::{Path, PathBuf},
|
||||
sync::Mutex,
|
||||
};
|
||||
use notify::event::{EventKind, ModifyKind, RenameMode};
|
||||
use notify::{RecommendedWatcher, Watcher};
|
||||
use serde::Serialize;
|
||||
use serde::de::DeserializeOwned;
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Mutex;
|
||||
use std::{env, fmt, fs};
|
||||
|
||||
/// Get the config directory, with Flatpak sandbox support.
|
||||
/// In Flatpak, HOST_XDG_CONFIG_HOME points to the real user config directory,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
use iced_futures::futures::channel::mpsc;
|
||||
use iced_futures::futures::{SinkExt, Stream};
|
||||
use iced_futures::{futures::channel::mpsc, stream};
|
||||
use iced_futures::stream;
|
||||
use notify::RecommendedWatcher;
|
||||
use std::{borrow::Cow, hash::Hash};
|
||||
use std::borrow::Cow;
|
||||
use std::hash::Hash;
|
||||
|
||||
use crate::{Config, CosmicConfigEntry};
|
||||
|
||||
|
|
@ -77,7 +79,8 @@ async fn start_listening<T: 'static + Send + Sync + PartialEq + Clone + CosmicCo
|
|||
state: ConfigState<T>,
|
||||
output: &mut mpsc::Sender<crate::Update<T>>,
|
||||
) -> ConfigState<T> {
|
||||
use iced_futures::futures::{StreamExt, future::pending};
|
||||
use iced_futures::futures::StreamExt;
|
||||
use iced_futures::futures::future::pending;
|
||||
|
||||
match state {
|
||||
ConfigState::Init(config_id, version, is_state) => {
|
||||
|
|
|
|||
|
|
@ -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::{
|
||||
Component, Container, CornerRadii, CosmicPalette, CosmicPaletteInner, DARK_PALETTE,
|
||||
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 palette::{
|
||||
IntoColor, Oklcha, Srgb, Srgba, WithAlpha, color_difference::Wcag21RelativeContrast, rgb::Rgb,
|
||||
};
|
||||
use palette::color_difference::Wcag21RelativeContrast;
|
||||
use palette::rgb::Rgb;
|
||||
use palette::{IntoColor, Oklcha, Srgb, Srgba, WithAlpha};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::num::NonZeroUsize;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
use crate::{Component, Theme, composite::over, steps::steps};
|
||||
use palette::{Darken, IntoColor, Lighten, Srgba, WithAlpha, rgb::Rgba};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::{self, Write},
|
||||
num::NonZeroUsize,
|
||||
path::Path,
|
||||
};
|
||||
use crate::composite::over;
|
||||
use crate::steps::steps;
|
||||
use crate::{Component, Theme};
|
||||
use palette::rgb::Rgba;
|
||||
use palette::{Darken, IntoColor, Lighten, Srgba, WithAlpha};
|
||||
use std::fs::{self, File};
|
||||
use std::io::{self, Write};
|
||||
use std::num::NonZeroUsize;
|
||||
use std::path::Path;
|
||||
|
||||
use super::{OutputError, to_rgba};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use configparser::ini::WriteOptions;
|
||||
use palette::{Srgba, rgb::Rgba};
|
||||
use palette::Srgba;
|
||||
use palette::rgb::Rgba;
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::Theme;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
use crate::Theme;
|
||||
use configparser::ini::Ini;
|
||||
use palette::{Mix, Srgba, WithAlpha, blend::Compose, rgb::Rgba};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::Write,
|
||||
path::PathBuf,
|
||||
vec,
|
||||
};
|
||||
use palette::blend::Compose;
|
||||
use palette::rgb::Rgba;
|
||||
use palette::{Mix, Srgba, WithAlpha};
|
||||
use std::fs::{self, File};
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
use std::vec;
|
||||
|
||||
use super::{OutputError, qt_settings_ini_style};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
use crate::Theme;
|
||||
use configparser::ini::Ini;
|
||||
use cosmic_config::CosmicConfigEntry;
|
||||
use palette::{Mix, Srgba, blend::Compose};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::{self, Write},
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use palette::blend::Compose;
|
||||
use palette::{Mix, Srgba};
|
||||
use std::fs::{self, File};
|
||||
use std::io::{self, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use super::{OutputError, qt_settings_ini_style};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
use std::num::NonZeroUsize;
|
||||
|
||||
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
|
||||
/// over the full range of lightness.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ use cosmic::app::{Core, Settings, Task};
|
|||
use cosmic::executor;
|
||||
use cosmic::iced::{alignment, Length, Size};
|
||||
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
|
||||
#[rustfmt::skip]
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ use cosmic::iced::core::window;
|
|||
use cosmic::iced::window::Id;
|
||||
use cosmic::iced::{Length, Rectangle};
|
||||
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;
|
||||
|
||||
const ID: &str = "com.system76.CosmicAppletExample";
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@
|
|||
|
||||
use cosmic::app::Settings;
|
||||
use cosmic::iced::{Alignment, Length, Size};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::menu::{self, KeyBind};
|
||||
use cosmic::widget::nav_bar;
|
||||
use cosmic::{executor, iced, prelude::*, widget, Core};
|
||||
use cosmic::{executor, iced, widget, Core};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,15 +23,11 @@ use cosmic::{
|
|||
Element,
|
||||
};
|
||||
use cosmic_time::{Instant, Timeline};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
rc::Rc,
|
||||
sync::{
|
||||
atomic::{AtomicU32, Ordering},
|
||||
Arc,
|
||||
},
|
||||
vec,
|
||||
};
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::vec;
|
||||
|
||||
// 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"));
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use super::{Page, Window};
|
||||
use cosmic::{
|
||||
iced::widget::{column, text},
|
||||
widget::{list_column, settings, toggler},
|
||||
Element,
|
||||
};
|
||||
use cosmic::iced::widget::{column, text};
|
||||
use cosmic::widget::{list_column, settings, toggler};
|
||||
use cosmic::Element;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Message {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
use std::{cell::RefCell, rc::Rc};
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use apply::Apply;
|
||||
use cosmic::{
|
||||
cosmic_theme,
|
||||
iced::widget::{checkbox, column, progress_bar, radio, slider, text},
|
||||
iced::{Alignment, Length},
|
||||
iced_core::id,
|
||||
theme::ThemeType,
|
||||
widget::{
|
||||
button, color_picker::ColorPickerUpdate, dropdown, icon, layer_container as container,
|
||||
segmented_button, segmented_control, settings, spin_button, tab_bar, toggler,
|
||||
ColorPickerModel,
|
||||
},
|
||||
Element,
|
||||
use cosmic::iced::widget::{checkbox, column, progress_bar, radio, slider, text};
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::iced_core::id;
|
||||
use cosmic::theme::ThemeType;
|
||||
use cosmic::widget::color_picker::ColorPickerUpdate;
|
||||
use cosmic::widget::{
|
||||
button, dropdown, icon, layer_container as container, segmented_button, segmented_control,
|
||||
settings, spin_button, tab_bar, toggler, ColorPickerModel,
|
||||
};
|
||||
use cosmic::{cosmic_theme, Element};
|
||||
use cosmic_time::{anim, chain, Timeline};
|
||||
use fraction::{Decimal, ToPrimitive};
|
||||
use once_cell::sync::Lazy;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
use cosmic::{
|
||||
iced::widget::{column, container, horizontal_space, image, row, svg, text},
|
||||
iced::Length,
|
||||
theme,
|
||||
widget::{list_column, settings, toggler},
|
||||
Element,
|
||||
};
|
||||
use cosmic::iced::widget::{column, container, horizontal_space, image, row, svg, text};
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::widget::{list_column, settings, toggler};
|
||||
use cosmic::{theme, Element};
|
||||
|
||||
use super::{Page, SubPage, Window};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use cosmic::{
|
||||
iced::widget::{horizontal_space, row, text},
|
||||
iced::Length,
|
||||
widget::{icon, list_column, settings},
|
||||
Element,
|
||||
};
|
||||
use cosmic::iced::widget::{horizontal_space, row, text};
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::widget::{icon, list_column, settings};
|
||||
use cosmic::Element;
|
||||
|
||||
use super::{Message, Page, SubPage, Window};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ use std::{env, process};
|
|||
use cosmic::app::{Core, Settings, Task};
|
||||
use cosmic::iced::alignment::{Horizontal, Vertical};
|
||||
use cosmic::iced::keyboard::Key;
|
||||
use cosmic::iced::window;
|
||||
use cosmic::iced::{Length, Size};
|
||||
use cosmic::iced::{window, Length, Size};
|
||||
use cosmic::widget::menu::action::MenuAction;
|
||||
use cosmic::widget::menu::key_bind::KeyBind;
|
||||
use cosmic::widget::menu::key_bind::Modifier;
|
||||
use cosmic::widget::menu::key_bind::{KeyBind, Modifier};
|
||||
use cosmic::widget::menu::{self, ItemHeight, ItemWidth};
|
||||
use cosmic::widget::RcElementWrapper;
|
||||
use cosmic::{executor, Element};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use cosmic::{
|
||||
app::Core,
|
||||
iced::core::{id, Alignment, Length, Point},
|
||||
iced::widget::{column, container, scrollable, text},
|
||||
iced::{self, event, window, Subscription},
|
||||
prelude::*,
|
||||
widget::{button, header_bar},
|
||||
};
|
||||
use cosmic::app::Core;
|
||||
use cosmic::iced::core::{id, Alignment, Length, Point};
|
||||
use cosmic::iced::widget::{column, container, scrollable, text};
|
||||
use cosmic::iced::{self, event, window, Subscription};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::{button, header_bar};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Message {
|
||||
|
|
|
|||
|
|
@ -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::Apply;
|
||||
use cosmic::{
|
||||
app::{Core, Task},
|
||||
iced::{
|
||||
self,
|
||||
alignment::{Horizontal, Vertical},
|
||||
Alignment, Size,
|
||||
},
|
||||
Application, Element,
|
||||
};
|
||||
use cosmic::{Application, Apply, Element};
|
||||
use fraction::Decimal;
|
||||
|
||||
pub struct SpinButtonExamplApp {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
use cosmic::app::{Core, Settings, Task};
|
||||
use cosmic::iced::Subscription;
|
||||
use cosmic::{executor, prelude::*, widget};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::{executor, widget};
|
||||
|
||||
/// Runs application with these settings
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ use chrono::Datelike;
|
|||
use cosmic::app::{Core, Settings, Task};
|
||||
use cosmic::iced::Size;
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::table;
|
||||
use cosmic::widget::{self, nav_bar};
|
||||
use cosmic::widget::{self, nav_bar, table};
|
||||
use cosmic::{executor, iced};
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]
|
||||
|
|
|
|||
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
|
|
@ -0,0 +1 @@
|
|||
imports_granularity = "Module"
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::surface;
|
||||
use crate::config::CosmicTk;
|
||||
use crate::theme::Theme;
|
||||
use crate::widget::nav_bar;
|
||||
use crate::{config::CosmicTk, keyboard_nav};
|
||||
use crate::{keyboard_nav, surface};
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
use cctk::sctk::reexports::csd_frame::{WindowManagerCapabilities, WindowState};
|
||||
use cosmic_theme::ThemeMode;
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ use crate::prelude::*;
|
|||
use crate::theme::THEME;
|
||||
use crate::widget::{container, id_container, menu, nav_bar, popover, space};
|
||||
use apply::Apply;
|
||||
use iced::{Length, Subscription};
|
||||
use iced::{theme, window};
|
||||
use iced::{Length, Subscription, theme, window};
|
||||
pub use settings::Settings;
|
||||
use std::borrow::Cow;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[cold]
|
||||
pub(crate) fn iced_settings<App: Application>(
|
||||
|
|
|
|||
|
|
@ -2,14 +2,10 @@
|
|||
use crate::iced;
|
||||
use iced::core::alignment::{self, Alignment};
|
||||
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::{
|
||||
Clipboard, Element, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget,
|
||||
widget,
|
||||
layout, mouse, overlay, renderer, widget,
|
||||
};
|
||||
|
||||
/// A container that distributes its contents vertically.
|
||||
|
|
|
|||
|
|
@ -1,37 +1,31 @@
|
|||
#[cfg(feature = "applet-token")]
|
||||
pub mod token;
|
||||
|
||||
use crate::app::{BootData, BootDataInner, cosmic};
|
||||
use crate::{
|
||||
Application, Element, Renderer,
|
||||
app::iced_settings,
|
||||
cctk::sctk,
|
||||
theme::{self, Button, THEME, system_dark, system_light},
|
||||
widget::{
|
||||
self,
|
||||
autosize::{self, Autosize, autosize},
|
||||
column::Column,
|
||||
layer_container,
|
||||
row::Row,
|
||||
space::horizontal,
|
||||
space::vertical,
|
||||
},
|
||||
};
|
||||
use crate::app::{BootData, BootDataInner, cosmic, iced_settings};
|
||||
use crate::cctk::sctk;
|
||||
use crate::theme::{self, Button, THEME, system_dark, system_light};
|
||||
use crate::widget::autosize::{self, Autosize, autosize};
|
||||
use crate::widget::column::Column;
|
||||
use crate::widget::row::Row;
|
||||
use crate::widget::space::{horizontal, vertical};
|
||||
use crate::widget::{self, layer_container};
|
||||
use crate::{Application, Element, Renderer};
|
||||
|
||||
pub use cosmic_panel_config;
|
||||
use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize};
|
||||
use iced::{
|
||||
self, Color, Length, Limits, Rectangle,
|
||||
alignment::{Alignment, Horizontal, Vertical},
|
||||
widget::Container,
|
||||
window,
|
||||
};
|
||||
use iced::alignment::{Alignment, Horizontal, Vertical};
|
||||
use iced::widget::Container;
|
||||
use iced::{self, Color, Length, Limits, Rectangle, window};
|
||||
use iced_core::{Padding, Shadow};
|
||||
use iced_runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner};
|
||||
use iced_widget::Text;
|
||||
use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity};
|
||||
use std::borrow::Cow;
|
||||
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;
|
||||
|
||||
pub mod column;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@ use crate::iced;
|
|||
use iced::core::alignment::{self, Alignment};
|
||||
use iced::core::event::{self, Event};
|
||||
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::{
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
use crate::iced;
|
||||
use cctk::sctk::reexports::calloop;
|
||||
use futures::{
|
||||
SinkExt, StreamExt,
|
||||
channel::mpsc::{UnboundedReceiver, unbounded},
|
||||
};
|
||||
use futures::channel::mpsc::{UnboundedReceiver, unbounded};
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use iced::Subscription;
|
||||
use iced_futures::futures;
|
||||
use iced_futures::stream;
|
||||
use std::{fmt::Debug, hash::Hash, thread::JoinHandle};
|
||||
use iced_futures::{futures, stream};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::thread::JoinHandle;
|
||||
|
||||
use super::wayland_handler::wayland_handler;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,20 @@
|
|||
use std::os::{
|
||||
fd::{FromRawFd, RawFd},
|
||||
unix::net::UnixStream,
|
||||
};
|
||||
use std::os::fd::{FromRawFd, RawFd};
|
||||
use std::os::unix::net::UnixStream;
|
||||
|
||||
use super::subscription::{TokenRequest, TokenUpdate};
|
||||
use cctk::{
|
||||
sctk::{
|
||||
self,
|
||||
activation::{RequestData, RequestDataExt},
|
||||
reexports::{calloop, calloop_wayland_source::WaylandSource},
|
||||
seat::{SeatHandler, SeatState},
|
||||
},
|
||||
wayland_client::{
|
||||
self,
|
||||
protocol::{wl_seat::WlSeat, wl_surface::WlSurface},
|
||||
},
|
||||
};
|
||||
use cctk::sctk::activation::{RequestData, RequestDataExt};
|
||||
use cctk::sctk::reexports::calloop;
|
||||
use cctk::sctk::reexports::calloop_wayland_source::WaylandSource;
|
||||
use cctk::sctk::seat::{SeatHandler, SeatState};
|
||||
use cctk::sctk::{self};
|
||||
use cctk::wayland_client::protocol::wl_seat::WlSeat;
|
||||
use cctk::wayland_client::protocol::wl_surface::WlSurface;
|
||||
use cctk::wayland_client::{self};
|
||||
use iced_futures::futures::channel::mpsc::UnboundedSender;
|
||||
use sctk::{
|
||||
activation::{ActivationHandler, ActivationState},
|
||||
registry::{ProvidesRegistryState, RegistryState},
|
||||
};
|
||||
use wayland_client::{Connection, QueueHandle, globals::registry_queue_init};
|
||||
use sctk::activation::{ActivationHandler, ActivationState};
|
||||
use sctk::registry::{ProvidesRegistryState, RegistryState};
|
||||
use wayland_client::globals::registry_queue_init;
|
||||
use wayland_client::{Connection, QueueHandle};
|
||||
|
||||
struct AppData {
|
||||
exit: bool,
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use {
|
||||
crate::ApplicationExt,
|
||||
iced::Subscription,
|
||||
iced_futures::futures::{
|
||||
SinkExt,
|
||||
channel::mpsc::{Receiver, Sender},
|
||||
},
|
||||
std::{any::TypeId, collections::HashMap},
|
||||
url::Url,
|
||||
zbus::{interface, proxy, zvariant::Value},
|
||||
};
|
||||
use crate::ApplicationExt;
|
||||
use iced::Subscription;
|
||||
use iced_futures::futures::SinkExt;
|
||||
use iced_futures::futures::channel::mpsc::{Receiver, Sender};
|
||||
use std::any::TypeId;
|
||||
use std::collections::HashMap;
|
||||
use url::Url;
|
||||
use zbus::zvariant::Value;
|
||||
use zbus::{interface, proxy};
|
||||
|
||||
#[cold]
|
||||
pub fn subscription<App: ApplicationExt>() -> Subscription<crate::Action<App::Message>> {
|
||||
|
|
|
|||
|
|
@ -872,7 +872,8 @@ trait SystemdManger {
|
|||
#[cfg(all(test, not(windows)))]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::{env, fs, path::Path, path::PathBuf};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{env, fs};
|
||||
use tempfile::tempdir;
|
||||
|
||||
struct EnvVarGuard {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use i18n_embed::{
|
||||
DefaultLocalizer, LanguageLoader, Localizer,
|
||||
fluent::{FluentLanguageLoader, fluent_language_loader},
|
||||
};
|
||||
use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader};
|
||||
use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer};
|
||||
use rust_embed::RustEmbed;
|
||||
use std::sync::{LazyLock, OnceLock};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ use super::Action;
|
|||
use crate::Application;
|
||||
|
||||
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.
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
pub mod action;
|
||||
|
||||
use iced::Limits;
|
||||
use iced::Size;
|
||||
use iced::Task;
|
||||
use iced::{Limits, Size, Task};
|
||||
use std::future::Future;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,8 @@
|
|||
pub mod portal;
|
||||
pub mod style;
|
||||
|
||||
use cosmic_config::CosmicConfigEntry;
|
||||
use cosmic_config::config_subscription;
|
||||
use cosmic_theme::Component;
|
||||
use cosmic_theme::LayeredTheme;
|
||||
use cosmic_theme::Spacing;
|
||||
use cosmic_theme::ThemeMode;
|
||||
use cosmic_config::{CosmicConfigEntry, config_subscription};
|
||||
use cosmic_theme::{Component, LayeredTheme, Spacing, ThemeMode};
|
||||
use iced_futures::Subscription;
|
||||
use iced_runtime::{Appearance, DefaultStyle};
|
||||
use std::sync::{Arc, LazyLock, Mutex};
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@
|
|||
use cosmic_theme::Component;
|
||||
use iced_core::{Background, Color};
|
||||
|
||||
use crate::{
|
||||
theme::TRANSPARENT_COMPONENT,
|
||||
widget::button::{Catalog, Style},
|
||||
};
|
||||
use crate::theme::TRANSPARENT_COMPONENT;
|
||||
use crate::widget::button::{Catalog, Style};
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum Button {
|
||||
|
|
|
|||
|
|
@ -5,18 +5,17 @@
|
|||
|
||||
use crate::theme::{CosmicComponent, TRANSPARENT_COMPONENT, Theme};
|
||||
use cosmic_theme::composite::over;
|
||||
use iced::{
|
||||
overlay::menu,
|
||||
theme::Base,
|
||||
widget::{
|
||||
button as iced_button, checkbox as iced_checkbox, combo_box, container as iced_container,
|
||||
pane_grid, pick_list, progress_bar, radio, rule, scrollable,
|
||||
slider::{self, Rail},
|
||||
svg, toggler,
|
||||
},
|
||||
use iced::overlay::menu;
|
||||
use iced::theme::Base;
|
||||
use iced::widget::slider::{self, Rail};
|
||||
use iced::widget::{
|
||||
button as iced_button, checkbox as iced_checkbox, combo_box, container as iced_container,
|
||||
pane_grid, pick_list, progress_bar, radio, rule, scrollable, svg, toggler,
|
||||
};
|
||||
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 std::rc::Rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
//! Contains stylesheet implementation for [`crate::widget::segmented_button`].
|
||||
|
||||
use crate::widget::segmented_button::{Appearance, ItemAppearance, StyleSheet};
|
||||
use crate::{theme::Theme, widget::segmented_button::ItemStatusAppearance};
|
||||
use crate::theme::Theme;
|
||||
use crate::widget::segmented_button::{
|
||||
Appearance, ItemAppearance, ItemStatusAppearance, StyleSheet,
|
||||
};
|
||||
use iced::Border;
|
||||
use iced_core::{Background, border::Radius};
|
||||
use iced_core::Background;
|
||||
use iced_core::border::Radius;
|
||||
use palette::WithAlpha;
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
@ -143,7 +146,8 @@ mod horizontal {
|
|||
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
|
||||
use cosmic_theme::{Component, Container};
|
||||
use iced::Border;
|
||||
use iced_core::{Background, border::Radius};
|
||||
use iced_core::Background;
|
||||
use iced_core::border::Radius;
|
||||
use palette::WithAlpha;
|
||||
|
||||
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 cosmic_theme::{Component, Container};
|
||||
use iced::Border;
|
||||
use iced_core::{Background, border::Radius};
|
||||
use iced_core::Background;
|
||||
use iced_core::border::Radius;
|
||||
use palette::WithAlpha;
|
||||
|
||||
pub fn tab_bar(cosmic: &cosmic_theme::Theme, container: &Container) -> Appearance {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
use crate::{
|
||||
Apply, Element, fl,
|
||||
iced::{Alignment, Length},
|
||||
widget::{self, list},
|
||||
};
|
||||
use crate::iced::{Alignment, Length};
|
||||
use crate::widget::{self, list};
|
||||
use crate::{Apply, Element, fl};
|
||||
use std::rc::Rc;
|
||||
|
||||
#[derive(Debug, Default, Clone, derive_setters::Setters)]
|
||||
|
|
|
|||
|
|
@ -3,13 +3,10 @@
|
|||
use iced::Size;
|
||||
use iced::widget::Container;
|
||||
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::{
|
||||
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget,
|
||||
layout, mouse, overlay, renderer,
|
||||
};
|
||||
|
||||
pub use iced_widget::container::{Catalog, Style};
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
//! Autosize Container, which will resize the window to its contents.
|
||||
|
||||
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::{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 fn autosize<'a, Message: 'static, Theme, E>(
|
||||
|
|
|
|||
|
|
@ -3,9 +3,13 @@
|
|||
|
||||
use super::{Builder, ButtonClass};
|
||||
use crate::Element;
|
||||
use crate::widget::{icon::Handle, tooltip};
|
||||
use crate::widget::icon::Handle;
|
||||
use crate::widget::tooltip;
|
||||
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;
|
||||
|
||||
pub type Button<'a, Message> = Builder<'a, Message, Icon>;
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use super::Builder;
|
||||
use crate::{
|
||||
Element,
|
||||
widget::{self, image::Handle},
|
||||
};
|
||||
use iced_core::{Length, Padding, font::Weight, widget::Id};
|
||||
use crate::Element;
|
||||
use crate::widget::image::Handle;
|
||||
use crate::widget::{self};
|
||||
use iced_core::font::Weight;
|
||||
use iced_core::widget::Id;
|
||||
use iced_core::{Length, Padding};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub type Button<'a, Message> = Builder<'a, Message, Image<'a, Handle, Message>>;
|
||||
|
|
|
|||
|
|
@ -3,14 +3,15 @@
|
|||
|
||||
//! Hyperlink button widget
|
||||
|
||||
use super::Builder;
|
||||
use super::ButtonClass;
|
||||
use super::{Builder, ButtonClass};
|
||||
use crate::Element;
|
||||
use crate::prelude::*;
|
||||
use crate::widget::icon::{self, Handle};
|
||||
use crate::widget::{button, row, tooltip};
|
||||
use iced_core::font::Weight;
|
||||
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;
|
||||
|
||||
pub type Button<'a, Message> = Builder<'a, Message, Hyperlink>;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
//! 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@
|
|||
use super::{Builder, ButtonClass};
|
||||
use crate::widget::{icon, row, tooltip};
|
||||
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;
|
||||
|
||||
pub type Button<'a, Message> = Builder<'a, Message, Text>;
|
||||
|
|
|
|||
|
|
@ -11,15 +11,12 @@ use iced_runtime::{Action, Task, keyboard, task};
|
|||
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::renderer::{self, Quad, Renderer};
|
||||
use iced_core::touch;
|
||||
use iced_core::widget::Operation;
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
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 crate::theme::THEME;
|
||||
|
|
@ -647,10 +644,8 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
|
|||
state: &Tree,
|
||||
p: mouse::Cursor,
|
||||
) -> iced_accessibility::A11yTree {
|
||||
use iced_accessibility::{
|
||||
A11yNode, A11yTree,
|
||||
accesskit::{Action, Node, NodeId, Rect, Role},
|
||||
};
|
||||
use iced_accessibility::accesskit::{Action, Node, NodeId, Rect, Role};
|
||||
use iced_accessibility::{A11yNode, A11yTree};
|
||||
// TODO why is state None sometimes?
|
||||
if matches!(state.state, iced_core::widget::tree::State::None) {
|
||||
tracing::info!("Button state is missing.");
|
||||
|
|
|
|||
|
|
@ -8,10 +8,8 @@ use crate::widget::{button, column, grid, icon, row, text};
|
|||
use apply::Apply;
|
||||
use iced::alignment::Vertical;
|
||||
use iced_core::{Alignment, Length};
|
||||
use jiff::{
|
||||
ToSpan,
|
||||
civil::{Date, Weekday},
|
||||
};
|
||||
use jiff::ToSpan;
|
||||
use jiff::civil::{Date, Weekday};
|
||||
|
||||
/// A widget that displays an interactive calendar.
|
||||
pub fn calendar<M>(
|
||||
|
|
|
|||
|
|
@ -1,23 +1,18 @@
|
|||
//! An expandable stack of cards
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::{
|
||||
anim,
|
||||
widget::{
|
||||
button,
|
||||
card::style::Style,
|
||||
column,
|
||||
icon::{self, Handle},
|
||||
row, text,
|
||||
},
|
||||
};
|
||||
use crate::anim;
|
||||
use crate::widget::card::style::Style;
|
||||
use crate::widget::icon::{self, Handle};
|
||||
use crate::widget::{button, column, row, text};
|
||||
use float_cmp::approx_eq;
|
||||
use iced::widget;
|
||||
use iced_core::{
|
||||
Border, Element, Event, Length, Shadow, Size, Vector, Widget, border::Radius, id::Id,
|
||||
layout::Node, renderer::Quad, widget::Tree,
|
||||
};
|
||||
use iced_core::{widget::tree, window};
|
||||
use iced_core::border::Radius;
|
||||
use iced_core::id::Id;
|
||||
use iced_core::layout::Node;
|
||||
use iced_core::renderer::Quad;
|
||||
use iced_core::widget::{Tree, tree};
|
||||
use iced_core::{Border, Element, Event, Length, Shadow, Size, Vector, Widget, window};
|
||||
|
||||
const ICON_SIZE: u16 = 16;
|
||||
const TOP_SPACING: u16 = 4;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ use std::time::{Duration, Instant};
|
|||
use crate::Element;
|
||||
use crate::theme::iced::Slider;
|
||||
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 iced::Task;
|
||||
use iced_core::event::{self, Event};
|
||||
|
|
@ -25,10 +27,8 @@ use iced_core::{
|
|||
};
|
||||
|
||||
use iced_widget::slider::HandleShape;
|
||||
use iced_widget::{
|
||||
Row, canvas, column, row, scrollable,
|
||||
space::{horizontal, vertical},
|
||||
};
|
||||
use iced_widget::space::{horizontal, vertical};
|
||||
use iced_widget::{Row, canvas, column, row, scrollable};
|
||||
use palette::{FromColor, RgbHue};
|
||||
|
||||
use super::divider::horizontal;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use crate::Element;
|
|||
|
||||
use iced::advanced::layout::{self, Layout};
|
||||
use iced::advanced::widget::{self, Operation};
|
||||
use iced::advanced::{Clipboard, Shell};
|
||||
use iced::advanced::{overlay, renderer};
|
||||
use iced::advanced::{Clipboard, Shell, overlay, renderer};
|
||||
use iced::{Event, Point, Size, mouse};
|
||||
use iced_core::{Renderer, touch};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,10 @@ use crate::widget::{self, LayerContainer, button, column, container, icon, row,
|
|||
use crate::{Apply, Element, Renderer, Theme, fl};
|
||||
use std::borrow::Cow;
|
||||
|
||||
use iced_core::Alignment;
|
||||
use iced_core::event::Event;
|
||||
use iced_core::widget::{Operation, Tree};
|
||||
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,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,8 @@ impl<Message: Clone + 'static> ContextMenu<'_, Message> {
|
|||
my_state: &mut LocalState,
|
||||
) {
|
||||
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::{
|
||||
SctkPopupSettings, SctkPositioner,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
use crate::{
|
||||
Element,
|
||||
iced::{Length, Pixels},
|
||||
style, theme, widget,
|
||||
};
|
||||
use crate::iced::{Length, Pixels};
|
||||
use crate::{Element, style, theme, widget};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub fn dialog<'a, Message>() -> Dialog<'a, Message> {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,17 @@
|
|||
use std::{
|
||||
borrow::Cow,
|
||||
sync::atomic::{AtomicU64, Ordering},
|
||||
};
|
||||
use std::borrow::Cow;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
|
||||
use iced::Vector;
|
||||
|
||||
use crate::{
|
||||
Element,
|
||||
widget::{Id, Widget},
|
||||
};
|
||||
use crate::Element;
|
||||
use crate::widget::{Id, Widget};
|
||||
|
||||
use iced::{
|
||||
Event, Length, Rectangle,
|
||||
clipboard::{
|
||||
dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent},
|
||||
mime::AllowedMimeTypes,
|
||||
},
|
||||
event,
|
||||
id::Internal,
|
||||
mouse, overlay,
|
||||
};
|
||||
use iced_core::{
|
||||
self, Clipboard, Shell, layout,
|
||||
widget::{Tree, tree},
|
||||
};
|
||||
use iced::clipboard::dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent};
|
||||
use iced::clipboard::mime::AllowedMimeTypes;
|
||||
use iced::id::Internal;
|
||||
use iced::{Event, Length, Rectangle, event, mouse, overlay};
|
||||
use iced_core::widget::{Tree, tree};
|
||||
use iced_core::{self, Clipboard, Shell, layout};
|
||||
|
||||
pub fn dnd_destination<'a, Message: 'static>(
|
||||
child: impl Into<Element<'a, Message>>,
|
||||
|
|
|
|||
|
|
@ -1,20 +1,14 @@
|
|||
use std::any::Any;
|
||||
|
||||
use iced_core::{widget::Operation, window};
|
||||
use iced_core::widget::Operation;
|
||||
use iced_core::window;
|
||||
|
||||
use crate::{
|
||||
Element,
|
||||
widget::{Id, Widget, container},
|
||||
};
|
||||
use iced::{
|
||||
Event, Length, Point, Rectangle, Vector,
|
||||
clipboard::dnd::{DndAction, DndEvent, SourceEvent},
|
||||
event, mouse, overlay,
|
||||
};
|
||||
use iced_core::{
|
||||
self, Clipboard, Shell, layout, renderer,
|
||||
widget::{Tree, tree},
|
||||
};
|
||||
use crate::Element;
|
||||
use crate::widget::{Id, Widget, container};
|
||||
use iced::clipboard::dnd::{DndAction, DndEvent, SourceEvent};
|
||||
use iced::{Event, Length, Point, Rectangle, Vector, event, mouse, overlay};
|
||||
use iced_core::widget::{Tree, tree};
|
||||
use iced_core::{self, Clipboard, Shell, layout, renderer};
|
||||
|
||||
pub fn dnd_source<
|
||||
'a,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||
|
||||
//! 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.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ use iced_core::event::{self, Event};
|
|||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
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 std::ffi::OsStr;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ use iced_core::event::{self, Event};
|
|||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
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 std::borrow::Cow;
|
||||
use std::ffi::OsStr;
|
||||
|
|
|
|||
|
|
@ -2,14 +2,12 @@
|
|||
//! Based on <https://github.com/tarkah/iced_gif/>
|
||||
|
||||
use std::ffi::OsStr;
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
use std::path::Path;
|
||||
use std::time::{Duration, Instant};
|
||||
use std::{fmt, io};
|
||||
|
||||
use ::image as image_rs;
|
||||
use iced::Task;
|
||||
use iced::mouse;
|
||||
use iced::{Task, mouse};
|
||||
use iced_core::image::Renderer as ImageRenderer;
|
||||
use iced_core::mouse::Cursor;
|
||||
use iced_core::widget::{Tree, tree};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ use crate::cosmic_theme::{Density, Spacing};
|
|||
use crate::{Element, theme, widget};
|
||||
use apply::Apply;
|
||||
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;
|
||||
|
||||
#[must_use]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
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)]
|
||||
/// Fallback icon to use if the icon was not found.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
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::{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 fn id_container<'a, Message: 'static, Theme, E>(
|
||||
|
|
|
|||
|
|
@ -2,13 +2,10 @@ use crate::Theme;
|
|||
use cosmic_theme::LayeredTheme;
|
||||
use iced::widget::Container;
|
||||
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::{
|
||||
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget,
|
||||
layout, mouse, overlay, renderer,
|
||||
};
|
||||
pub use iced_widget::container::{Catalog, Style};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
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 iced::{Length, Padding};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
// From iced_aw, license MIT
|
||||
|
||||
use iced_core::{Widget, widget::Tree};
|
||||
use iced_widget::core::{
|
||||
Alignment, Element, Padding, Point, Size,
|
||||
layout::{Limits, Node},
|
||||
renderer,
|
||||
};
|
||||
use iced_core::Widget;
|
||||
use iced_core::widget::Tree;
|
||||
use iced_widget::core::layout::{Limits, Node};
|
||||
use iced_widget::core::{Alignment, Element, Padding, Point, Size, renderer};
|
||||
|
||||
use crate::widget::RcElementWrapper;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
// From iced_aw, license MIT
|
||||
|
||||
//! A widget that handles menu trees
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::{
|
||||
menu_inner::{
|
||||
CloseCondition, Direction, ItemHeight, ItemWidth, Menu, MenuState, PathHighlight,
|
||||
},
|
||||
menu_tree::MenuTree,
|
||||
use super::menu_inner::{
|
||||
CloseCondition, Direction, ItemHeight, ItemWidth, Menu, MenuState, PathHighlight,
|
||||
};
|
||||
use super::menu_tree::MenuTree;
|
||||
use crate::Renderer;
|
||||
#[cfg(all(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
|
|
@ -17,26 +17,21 @@ use super::{
|
|||
feature = "surface-message"
|
||||
))]
|
||||
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
|
||||
use crate::{
|
||||
Renderer,
|
||||
style::menu_bar::StyleSheet,
|
||||
widget::{
|
||||
RcWrapper,
|
||||
dropdown::menu::{self, State},
|
||||
menu::menu_inner::init_root_menu,
|
||||
},
|
||||
};
|
||||
use crate::style::menu_bar::StyleSheet;
|
||||
use crate::widget::RcWrapper;
|
||||
use crate::widget::dropdown::menu::{self, State};
|
||||
use crate::widget::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_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::{
|
||||
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, event,
|
||||
layout::{Limits, Node},
|
||||
mouse::{self, Cursor},
|
||||
overlay,
|
||||
renderer::{self, Renderer as IcedRenderer},
|
||||
touch,
|
||||
widget::{Tree, tree},
|
||||
overlay, touch,
|
||||
};
|
||||
|
||||
/// A `MenuBar` collects `MenuTree`s and handles all the layout, event processing, and drawing.
|
||||
|
|
@ -590,7 +585,8 @@ where
|
|||
viewport: &Rectangle,
|
||||
) {
|
||||
use event::Event::{Mouse, Touch};
|
||||
use mouse::{Button::Left, Event::ButtonReleased};
|
||||
use mouse::Button::Left;
|
||||
use mouse::Event::ButtonReleased;
|
||||
use touch::Event::{FingerLifted, FingerLost};
|
||||
|
||||
process_root_events(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
// From iced_aw, license MIT
|
||||
|
||||
//! 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(
|
||||
feature = "multi-window",
|
||||
feature = "wayland",
|
||||
|
|
@ -16,12 +18,12 @@ use crate::style::menu_bar::StyleSheet;
|
|||
|
||||
use iced::window;
|
||||
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::{
|
||||
Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, event,
|
||||
layout::{Limits, Node},
|
||||
mouse::{self, Cursor},
|
||||
overlay, renderer, touch,
|
||||
widget::Tree,
|
||||
Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, event, overlay,
|
||||
renderer, touch,
|
||||
};
|
||||
|
||||
/// The condition of when to close a menu
|
||||
|
|
@ -559,14 +561,10 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
|
|||
clipboard: &mut dyn Clipboard,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
) -> Option<(usize, MenuState)> {
|
||||
use event::{
|
||||
Event::{Mouse, Touch},
|
||||
Status::{Captured, Ignored},
|
||||
};
|
||||
use mouse::{
|
||||
Button::Left,
|
||||
Event::{ButtonPressed, ButtonReleased, CursorMoved, WheelScrolled},
|
||||
};
|
||||
use event::Event::{Mouse, Touch};
|
||||
use event::Status::{Captured, Ignored};
|
||||
use mouse::Button::Left;
|
||||
use mouse::Event::{ButtonPressed, ButtonReleased, CursorMoved, WheelScrolled};
|
||||
use touch::Event::{FingerLifted, FingerMoved, FingerPressed};
|
||||
|
||||
if !self
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ pub use dialog::{Dialog, dialog};
|
|||
pub mod divider {
|
||||
/// Horizontal variant of a divider.
|
||||
pub mod horizontal {
|
||||
use iced::{widget::Rule, widget::rule};
|
||||
use iced::widget::{Rule, rule};
|
||||
|
||||
/// Horizontal divider with default thickness
|
||||
#[must_use]
|
||||
|
|
|
|||
|
|
@ -6,10 +6,9 @@
|
|||
//! For details on the model, see the [`segmented_button`] module for more details.
|
||||
|
||||
use apply::Apply;
|
||||
use iced::{
|
||||
Background, Length,
|
||||
clipboard::{dnd::DndAction, mime::AllowedMimeTypes},
|
||||
};
|
||||
use iced::clipboard::dnd::DndAction;
|
||||
use iced::clipboard::mime::AllowedMimeTypes;
|
||||
use iced::{Background, Length};
|
||||
use iced_core::{Border, Color, Shadow};
|
||||
|
||||
use crate::widget::{Container, Icon, container, menu, scrollable, segmented_button};
|
||||
|
|
|
|||
|
|
@ -5,14 +5,10 @@
|
|||
|
||||
use iced::widget;
|
||||
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::{
|
||||
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};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
//! Show a circular progress indicator.
|
||||
use super::animation::{Animation, Progress};
|
||||
use super::style::StyleSheet;
|
||||
use iced::advanced::layout;
|
||||
use iced::advanced::renderer;
|
||||
use iced::advanced::widget::tree::{self, Tree};
|
||||
use iced::advanced::{self, Clipboard, Layout, Shell, Widget};
|
||||
use iced::mouse;
|
||||
use iced::advanced::{self, Clipboard, Layout, Shell, Widget, layout, renderer};
|
||||
use iced::widget::canvas;
|
||||
use iced::window;
|
||||
use iced::{Element, Event, Length, Radians, Rectangle, Renderer, Size, Vector};
|
||||
use iced::{Element, Event, Length, Radians, Rectangle, Renderer, Size, Vector, mouse, window};
|
||||
|
||||
use std::f32::consts::PI;
|
||||
use std::time::Duration;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
//! Show a linear progress indicator.
|
||||
use super::animation::{Animation, Progress};
|
||||
use super::style::StyleSheet;
|
||||
use iced::advanced::layout;
|
||||
use iced::advanced::renderer;
|
||||
use iced::advanced::widget::tree::{self, Tree};
|
||||
use iced::advanced::{self, Clipboard, Layout, Shell, Widget};
|
||||
use iced::mouse;
|
||||
use iced::window;
|
||||
use iced::{Background, Element, Event, Length, Rectangle, Size};
|
||||
use iced::advanced::{self, Clipboard, Layout, Shell, Widget, layout, renderer};
|
||||
use iced::{Background, Element, Event, Length, Rectangle, Size, mouse, window};
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,10 @@
|
|||
use crate::{Theme, theme};
|
||||
use iced::border;
|
||||
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::{
|
||||
Border, Clipboard, Element, Layout, Length, Pixels, Rectangle, Shell, Size, Vector, Widget,
|
||||
layout, mouse, overlay, renderer, touch,
|
||||
};
|
||||
|
||||
use iced_widget::radio as iced_radio;
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ use iced::widget::Container;
|
|||
pub use subscription::*;
|
||||
|
||||
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::{Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget};
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use iced_core::{
|
||||
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};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
use iced::{
|
||||
Rectangle,
|
||||
futures::{
|
||||
StreamExt,
|
||||
channel::mpsc::{UnboundedReceiver, unbounded},
|
||||
stream,
|
||||
},
|
||||
};
|
||||
use iced::Rectangle;
|
||||
use iced::futures::channel::mpsc::{UnboundedReceiver, unbounded};
|
||||
use iced::futures::{StreamExt, stream};
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
use iced::{Limits, Size};
|
||||
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::{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>(
|
||||
content: E,
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ use std::collections::HashMap;
|
|||
|
||||
use apply::Apply;
|
||||
|
||||
use crate::{
|
||||
Core, Element,
|
||||
widget::{button, icon, responsive_container},
|
||||
};
|
||||
use crate::widget::{button, icon, responsive_container};
|
||||
use crate::{Core, Element};
|
||||
|
||||
use super::menu::{self, ItemHeight, ItemWidth};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,11 @@ use iced_core::id::Internal;
|
|||
use iced_core::mouse::ScrollDelta;
|
||||
use iced_core::text::{self, Ellipsize, LineHeight, Renderer as TextRenderer, Shaping, Wrapping};
|
||||
use iced_core::widget::operation::Focusable;
|
||||
use iced_core::widget::{self, operation, tree};
|
||||
use iced_core::{Border, Point, Renderer as IcedRenderer, Shadow, Text};
|
||||
use iced_core::{Clipboard, Layout, Shell, Widget, layout, renderer, widget::Tree};
|
||||
use iced_core::widget::{self, Tree, operation, tree};
|
||||
use iced_core::{
|
||||
Border, Clipboard, Layout, Point, Renderer as IcedRenderer, Shadow, Shell, Text, Widget,
|
||||
layout, renderer,
|
||||
};
|
||||
use iced_runtime::{Action, task};
|
||||
use slotmap::{Key, SecondaryMap};
|
||||
use std::borrow::Cow;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{
|
||||
Element, Theme, theme,
|
||||
widget::{FlexRow, Row, column, container, flex_row, list, row, text},
|
||||
};
|
||||
use crate::widget::{FlexRow, Row, column, container, flex_row, list, row, text};
|
||||
use crate::{Element, Theme, theme};
|
||||
use derive_setters::Setters;
|
||||
use iced_core::{Length, text::Wrapping};
|
||||
use iced_core::Length;
|
||||
use iced_core::text::Wrapping;
|
||||
use iced_widget::space;
|
||||
use taffy::AlignContent;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,10 @@
|
|||
|
||||
//! A control for incremental adjustments of a value.
|
||||
|
||||
use crate::{
|
||||
Element, theme,
|
||||
widget::{button, column, container, icon, row, text},
|
||||
};
|
||||
use crate::widget::{button, column, container, icon, row, text};
|
||||
use crate::{Element, theme};
|
||||
use apply::Apply;
|
||||
use iced::{Alignment, Length};
|
||||
use iced::{Border, Shadow};
|
||||
use iced::{Alignment, Border, Length, Shadow};
|
||||
use std::borrow::Cow;
|
||||
use std::ops::{Add, Sub};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,9 @@
|
|||
//!
|
||||
|
||||
pub mod model;
|
||||
pub use model::{
|
||||
Entity, Model,
|
||||
category::ItemCategory,
|
||||
category::ItemInterface,
|
||||
selection::{MultiSelect, SingleSelect},
|
||||
};
|
||||
pub use model::category::{ItemCategory, ItemInterface};
|
||||
pub use model::selection::{MultiSelect, SingleSelect};
|
||||
pub use model::{Entity, Model};
|
||||
pub mod widget;
|
||||
pub use widget::compact::CompactTableView;
|
||||
pub use widget::standard::TableView;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
|
||||
use slotmap::{SecondaryMap, SparseSecondaryMap};
|
||||
|
||||
use super::{
|
||||
Entity, Model, Selectable,
|
||||
category::{ItemCategory, ItemInterface},
|
||||
};
|
||||
use super::category::{ItemCategory, ItemInterface};
|
||||
use super::{Entity, Model, Selectable};
|
||||
|
||||
/// A newly-inserted item which may have additional actions applied to it.
|
||||
pub struct EntityMut<
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ pub mod category;
|
|||
pub mod entity;
|
||||
pub mod selection;
|
||||
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
collections::{HashMap, VecDeque},
|
||||
};
|
||||
use std::any::{Any, TypeId};
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
|
||||
use category::{ItemCategory, ItemInterface};
|
||||
use entity::EntityMut;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
|
||||
//! Describes logic specific to the single-select and multi-select modes of a model.
|
||||
|
||||
use super::{
|
||||
Entity, Model,
|
||||
category::{ItemCategory, ItemInterface},
|
||||
};
|
||||
use super::category::{ItemCategory, ItemInterface};
|
||||
use super::{Entity, Model};
|
||||
use std::collections::HashSet;
|
||||
|
||||
/// Describes a type that has selectable items.
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
use derive_setters::Setters;
|
||||
|
||||
use crate::widget::table::model::{
|
||||
Entity, Model,
|
||||
category::{ItemCategory, ItemInterface},
|
||||
selection::Selectable,
|
||||
};
|
||||
use crate::{
|
||||
Apply, Element, theme,
|
||||
widget::{self, container, menu},
|
||||
};
|
||||
use crate::widget::table::model::category::{ItemCategory, ItemInterface};
|
||||
use crate::widget::table::model::selection::Selectable;
|
||||
use crate::widget::table::model::{Entity, Model};
|
||||
use crate::widget::{self, container, menu};
|
||||
use crate::{Apply, Element, theme};
|
||||
use iced::{Alignment, Border, Padding};
|
||||
|
||||
#[derive(Setters)]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
use derive_setters::Setters;
|
||||
|
||||
use crate::widget::table::model::{
|
||||
Entity, Model,
|
||||
category::{ItemCategory, ItemInterface},
|
||||
selection::Selectable,
|
||||
};
|
||||
use crate::{
|
||||
Apply, Element, theme,
|
||||
widget::{self, container, divider, menu},
|
||||
};
|
||||
use crate::widget::table::model::category::{ItemCategory, ItemInterface};
|
||||
use crate::widget::table::model::selection::Selectable;
|
||||
use crate::widget::table::model::{Entity, Model};
|
||||
use crate::widget::{self, container, divider, menu};
|
||||
use crate::{Apply, Element, theme};
|
||||
use iced::{Alignment, Border, Length, Padding};
|
||||
|
||||
// THIS IS A PLACEHOLDER UNTIL A MORE SOPHISTICATED WIDGET CAN BE DEVELOPED
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use super::{cursor::Cursor, value::Value};
|
||||
use super::cursor::Cursor;
|
||||
use super::value::Value;
|
||||
|
||||
pub struct Editor<'a> {
|
||||
value: &'a mut Value,
|
||||
|
|
|
|||
|
|
@ -28,18 +28,14 @@ use iced_core::overlay::Group;
|
|||
use iced_core::renderer::{self, Renderer as CoreRenderer};
|
||||
use iced_core::text::{self, Affinity, Paragraph, Renderer, Text};
|
||||
use iced_core::time::{Duration, Instant};
|
||||
use iced_core::touch;
|
||||
use iced_core::widget::Id;
|
||||
use iced_core::widget::operation::{self, Operation};
|
||||
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::{
|
||||
Clipboard, Color, Element, Layout, Length, Padding, Pixels, Point, Rectangle, Shell, Size,
|
||||
Vector, Widget,
|
||||
Background, Border, Clipboard, Color, Element, Layout, Length, Padding, Pixels, Point,
|
||||
Rectangle, Shadow, Shell, Size, Vector, Widget, alignment, keyboard, layout, overlay, touch,
|
||||
window,
|
||||
};
|
||||
use iced_core::{layout, overlay};
|
||||
use iced_runtime::{Action, Task, task};
|
||||
|
||||
thread_local! {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
//! 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.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -6,16 +6,13 @@
|
|||
use std::collections::VecDeque;
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::widget::Column;
|
||||
use crate::widget::container;
|
||||
use crate::widget::{Column, container};
|
||||
use iced::Task;
|
||||
use iced_core::Element;
|
||||
use slotmap::SlotMap;
|
||||
use slotmap::new_key_type;
|
||||
use slotmap::{SlotMap, new_key_type};
|
||||
use widget::Toaster;
|
||||
|
||||
use super::column;
|
||||
use super::{button, icon, row, text};
|
||||
use super::{button, column, icon, row, text};
|
||||
|
||||
mod widget;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,16 +4,14 @@
|
|||
use iced::{Limits, Size};
|
||||
use iced_core::layout::Node;
|
||||
|
||||
use iced_core::Element;
|
||||
use iced_core::Overlay;
|
||||
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::widget::Operation;
|
||||
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> {
|
||||
toasts: Element<'a, Message, Theme, Renderer>,
|
||||
|
|
|
|||
|
|
@ -3,15 +3,14 @@
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
use crate::{Element, anim};
|
||||
use iced_core::renderer::{self, Renderer};
|
||||
use iced_core::widget::{self, Tree, tree};
|
||||
use iced_core::{
|
||||
Border, Clipboard, Event, Layout, Length, Pixels, Rectangle, Shell, Size, Widget, alignment,
|
||||
event, layout, mouse,
|
||||
renderer::{self, Renderer},
|
||||
text, touch,
|
||||
widget::{self, Tree, tree},
|
||||
window,
|
||||
event, layout, mouse, text, touch, window,
|
||||
};
|
||||
use iced_widget::{Id, toggler::Status};
|
||||
use iced_widget::Id;
|
||||
use iced_widget::toggler::Status;
|
||||
|
||||
pub use iced_widget::toggler::{Catalog, Style};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ pub mod widget;
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,16 +14,12 @@ use iced::Task;
|
|||
use iced_runtime::core::widget::Id;
|
||||
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::renderer;
|
||||
use iced_core::touch;
|
||||
use iced_core::widget::Operation;
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
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};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
use std::{
|
||||
borrow::Borrow,
|
||||
cell::RefCell,
|
||||
rc::Rc,
|
||||
thread::{self, ThreadId},
|
||||
};
|
||||
use std::borrow::Borrow;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::thread::{self, ThreadId};
|
||||
|
||||
use crate::Element;
|
||||
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)]
|
||||
pub struct RcWrapper<T> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue