chore: format for 2024 edition
This commit is contained in:
parent
8cf372c9b9
commit
0aa518984e
57 changed files with 196 additions and 199 deletions
|
|
@ -7,10 +7,9 @@
|
|||
use iced::application;
|
||||
use iced::window;
|
||||
use iced::{
|
||||
self,
|
||||
self, Program,
|
||||
program::{self, with_style, with_subscription, with_theme, with_title},
|
||||
runtime::{Appearance, DefaultStyle},
|
||||
Program,
|
||||
};
|
||||
use iced::{Element, Result, Settings, Subscription, Task};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
//! Configure a new COSMIC application.
|
||||
|
||||
use crate::{font, Theme};
|
||||
use iced_core::layout::Limits;
|
||||
use crate::{Theme, font};
|
||||
use iced_core::Font;
|
||||
use iced_core::layout::Limits;
|
||||
|
||||
/// Configure a new COSMIC application.
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@
|
|||
pub mod token;
|
||||
|
||||
use crate::{
|
||||
Application, Element, Renderer,
|
||||
app::iced_settings,
|
||||
cctk::sctk,
|
||||
iced::{
|
||||
self,
|
||||
self, Color, Length, Limits, Rectangle,
|
||||
alignment::{Horizontal, Vertical},
|
||||
widget::Container,
|
||||
window, Color, Length, Limits, Rectangle,
|
||||
window,
|
||||
},
|
||||
iced_widget,
|
||||
theme::{self, system_dark, system_light, Button, THEME},
|
||||
theme::{self, Button, THEME, system_dark, system_light},
|
||||
widget::{
|
||||
self,
|
||||
autosize::{self, autosize, Autosize},
|
||||
autosize::{self, Autosize, autosize},
|
||||
layer_container,
|
||||
},
|
||||
Application, Element, Renderer,
|
||||
};
|
||||
pub use cosmic_panel_config;
|
||||
use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize};
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ use crate::iced;
|
|||
use crate::iced_futures::futures;
|
||||
use cctk::sctk::reexports::calloop;
|
||||
use futures::{
|
||||
channel::mpsc::{unbounded, UnboundedReceiver},
|
||||
SinkExt, StreamExt,
|
||||
channel::mpsc::{UnboundedReceiver, unbounded},
|
||||
};
|
||||
use iced::Subscription;
|
||||
use iced_futures::stream;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use sctk::{
|
|||
activation::{ActivationHandler, ActivationState},
|
||||
registry::{ProvidesRegistryState, RegistryState},
|
||||
};
|
||||
use wayland_client::{globals::registry_queue_init, Connection, QueueHandle};
|
||||
use wayland_client::{Connection, QueueHandle, globals::registry_queue_init};
|
||||
|
||||
struct AppData {
|
||||
exit: bool,
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
//! example in our repository.
|
||||
|
||||
#[cfg(feature = "xdg-portal")]
|
||||
pub use portal::{file, files, folder, folders, FileResponse, MultiFileResponse};
|
||||
pub use portal::{FileResponse, MultiFileResponse, file, files, folder, folders};
|
||||
|
||||
#[cfg(feature = "rfd")]
|
||||
pub use rust_fd::{file, files, folder, folders, FileResponse, MultiFileResponse};
|
||||
pub use rust_fd::{FileResponse, MultiFileResponse, file, files, folder, folders};
|
||||
|
||||
use super::Error;
|
||||
use std::path::PathBuf;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
//! example in our repository.
|
||||
|
||||
#[cfg(feature = "xdg-portal")]
|
||||
pub use portal::{file, Response};
|
||||
pub use portal::{Response, file};
|
||||
|
||||
#[cfg(feature = "rfd")]
|
||||
pub use rust_fd::{file, Response};
|
||||
pub use rust_fd::{Response, file};
|
||||
|
||||
use super::Error;
|
||||
use std::path::PathBuf;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
/// Recommended default imports.
|
||||
pub mod prelude {
|
||||
pub use crate::ext::*;
|
||||
#[cfg(feature = "winit")]
|
||||
pub use crate::ApplicationExt;
|
||||
pub use crate::ext::*;
|
||||
pub use crate::{Also, Apply, Element, Renderer, Task, Theme};
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ pub mod task;
|
|||
pub mod theme;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use theme::{style, Theme};
|
||||
pub use theme::{Theme, style};
|
||||
|
||||
pub mod widget;
|
||||
type Plain = iced_core::text::paragraph::Plain<<Renderer as iced_core::text::Renderer>::Paragraph>;
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ pub fn destroy_subsurface(id: iced_core::window::Id) -> Action {
|
|||
#[must_use]
|
||||
pub fn app_popup<App: Application>(
|
||||
settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
view: Option<
|
||||
Box<
|
||||
dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action<App::Message>>
|
||||
|
|
@ -58,9 +58,9 @@ pub fn app_popup<App: Application>(
|
|||
#[must_use]
|
||||
pub fn simple_subsurface<Message: 'static, V>(
|
||||
settings: impl Fn() -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
view: Option<
|
||||
Box<dyn Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static>,
|
||||
>,
|
||||
|
|
@ -87,9 +87,9 @@ pub fn simple_subsurface<Message: 'static, V>(
|
|||
#[must_use]
|
||||
pub fn simple_popup<Message: 'static, V>(
|
||||
settings: impl Fn() -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
view: Option<
|
||||
impl Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static,
|
||||
>,
|
||||
|
|
@ -117,10 +117,13 @@ pub fn simple_popup<Message: 'static, V>(
|
|||
#[cfg(all(feature = "wayland", feature = "winit"))]
|
||||
#[must_use]
|
||||
pub fn subsurface<App: Application>(
|
||||
settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
settings: impl Fn(
|
||||
&mut App,
|
||||
)
|
||||
-> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
// XXX Boxed trait object is required for less cumbersome type inference, but we box it anyways.
|
||||
view: Option<
|
||||
Box<
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::widget::dropdown;
|
||||
use crate::Theme;
|
||||
use crate::widget::dropdown;
|
||||
use iced::{Background, Color};
|
||||
|
||||
impl dropdown::menu::StyleSheet for Theme {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
//! Contains stylesheet implementations for widgets native to iced.
|
||||
|
||||
use crate::theme::{CosmicComponent, Theme, TRANSPARENT_COMPONENT};
|
||||
use crate::theme::{CosmicComponent, TRANSPARENT_COMPONENT, Theme};
|
||||
use cosmic_theme::composite::over;
|
||||
use iced::{
|
||||
overlay::menu,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
use crate::widget::segmented_button::{Appearance, ItemAppearance, StyleSheet};
|
||||
use crate::{theme::Theme, widget::segmented_button::ItemStatusAppearance};
|
||||
use cosmic_theme::{Component, Container};
|
||||
use iced_core::{border::Radius, Background};
|
||||
use iced_core::{Background, border::Radius};
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum SegmentedButton {
|
||||
|
|
@ -165,7 +165,7 @@ impl StyleSheet for Theme {
|
|||
mod horizontal {
|
||||
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
|
||||
use cosmic_theme::Component;
|
||||
use iced_core::{border::Radius, Background};
|
||||
use iced_core::{Background, border::Radius};
|
||||
|
||||
pub fn selection_active(
|
||||
cosmic: &cosmic_theme::Theme,
|
||||
|
|
@ -252,7 +252,7 @@ pub fn hover(
|
|||
mod vertical {
|
||||
use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance};
|
||||
use cosmic_theme::Component;
|
||||
use iced_core::{border::Radius, Background};
|
||||
use iced_core::{Background, border::Radius};
|
||||
|
||||
pub fn selection_active(
|
||||
cosmic: &cosmic_theme::Theme,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use {
|
||||
crate::{
|
||||
Element,
|
||||
iced::{Alignment, Length},
|
||||
widget::{self, horizontal_space},
|
||||
Element,
|
||||
},
|
||||
license::License,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
use super::Builder;
|
||||
use super::ButtonClass;
|
||||
use crate::Element;
|
||||
use crate::prelude::*;
|
||||
use crate::widget::icon::{self, Handle};
|
||||
use crate::widget::{button, row, tooltip};
|
||||
use crate::Element;
|
||||
use iced_core::text::LineHeight;
|
||||
use iced_core::{font::Weight, widget::Id, Alignment, Length, Padding};
|
||||
use iced_core::{Alignment, Length, Padding, font::Weight, widget::Id};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub type Button<'a, Message> = Builder<'a, Message, Hyperlink>;
|
||||
|
|
|
|||
|
|
@ -8,21 +8,21 @@ pub use crate::theme::Button as ButtonClass;
|
|||
pub mod link;
|
||||
use derive_setters::Setters;
|
||||
#[doc(inline)]
|
||||
pub use link::link;
|
||||
#[doc(inline)]
|
||||
pub use link::Button as LinkButton;
|
||||
#[doc(inline)]
|
||||
pub use link::link;
|
||||
|
||||
mod icon;
|
||||
#[doc(inline)]
|
||||
pub use icon::icon;
|
||||
#[doc(inline)]
|
||||
pub use icon::Button as IconButton;
|
||||
#[doc(inline)]
|
||||
pub use icon::icon;
|
||||
|
||||
mod image;
|
||||
#[doc(inline)]
|
||||
pub use image::image;
|
||||
#[doc(inline)]
|
||||
pub use image::Button as ImageButton;
|
||||
#[doc(inline)]
|
||||
pub use image::image;
|
||||
|
||||
mod style;
|
||||
#[doc(inline)]
|
||||
|
|
@ -36,7 +36,7 @@ pub use text::{destructive, standard, suggested, text};
|
|||
|
||||
mod widget;
|
||||
#[doc(inline)]
|
||||
pub use widget::{draw, focus, layout, mouse_interaction, Button};
|
||||
pub use widget::{Button, draw, focus, layout, mouse_interaction};
|
||||
|
||||
use iced_core::font::Weight;
|
||||
use iced_core::widget::Id;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
//! Change the apperance of a button.
|
||||
use iced_core::{border::Radius, Background, Color, Vector};
|
||||
use iced_core::{Background, Color, Vector, border::Radius};
|
||||
|
||||
use crate::theme::THEME;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
use super::{Builder, ButtonClass};
|
||||
use crate::widget::{icon, row, tooltip};
|
||||
use crate::{Apply, Element};
|
||||
use iced_core::{font::Weight, text::LineHeight, widget::Id, Alignment, Length, Padding};
|
||||
use iced_core::{Alignment, Length, Padding, font::Weight, text::LineHeight, widget::Id};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub type Button<'a, Message> = Builder<'a, Message, Text>;
|
||||
|
|
|
|||
|
|
@ -9,30 +9,30 @@ use std::rc::Rc;
|
|||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
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::Element;
|
||||
use derive_setters::Setters;
|
||||
use iced::Task;
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::gradient::{ColorStop, Linear};
|
||||
use iced_core::renderer::Quad;
|
||||
use iced_core::widget::{tree, Tree};
|
||||
use iced_core::widget::{Tree, tree};
|
||||
use iced_core::{
|
||||
layout, mouse, renderer, Background, Border, Clipboard, Color, Layout, Length, Radians,
|
||||
Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget,
|
||||
Background, Border, Clipboard, Color, Layout, Length, Radians, Rectangle, Renderer, Shadow,
|
||||
Shell, Size, Vector, Widget, layout, mouse, renderer,
|
||||
};
|
||||
|
||||
use iced_widget::slider::HandleShape;
|
||||
use iced_widget::{canvas, column, horizontal_space, row, scrollable, vertical_space, Row};
|
||||
use iced_widget::{Row, canvas, column, horizontal_space, row, scrollable, vertical_space};
|
||||
use lazy_static::lazy_static;
|
||||
use palette::{FromColor, RgbHue};
|
||||
|
||||
use super::divider::horizontal;
|
||||
use super::icon::{self, from_name};
|
||||
use super::segmented_button::{self, SingleSelect};
|
||||
use super::{button, segmented_control, text, text_input, tooltip, Icon};
|
||||
use super::{Icon, button, segmented_control, text, text_input, tooltip};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use ColorPickerModel as Model;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use crate::Element;
|
|||
|
||||
use iced::advanced::layout::{self, Layout};
|
||||
use iced::advanced::widget::{self, Operation};
|
||||
use iced::advanced::{overlay, renderer};
|
||||
use iced::advanced::{Clipboard, Shell};
|
||||
use iced::{event, mouse, Event, Point, Rectangle, Size};
|
||||
use iced::advanced::{overlay, renderer};
|
||||
use iced::{Event, Point, Rectangle, Size, event, mouse};
|
||||
use iced_core::Renderer;
|
||||
|
||||
pub(super) struct Overlay<'a, 'b, Message> {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use crate::widget::menu::{
|
|||
use derive_setters::Setters;
|
||||
use iced::touch::Finger;
|
||||
use iced::{Event, Vector};
|
||||
use iced_core::widget::{tree, Tree, Widget};
|
||||
use iced_core::{event, mouse, touch, Length, Point, Size};
|
||||
use iced_core::widget::{Tree, Widget, tree};
|
||||
use iced_core::{Length, Point, Size, event, mouse, touch};
|
||||
use std::collections::HashSet;
|
||||
|
||||
/// A context menu is a menu in a graphical user interface that appears upon user interaction, such as a right-click mouse operation.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{iced::Length, style, theme, widget, Element};
|
||||
use crate::{Element, iced::Length, style, theme, widget};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub fn dialog<'a, Message>() -> Dialog<'a, Message> {
|
||||
|
|
|
|||
|
|
@ -6,22 +6,22 @@ use std::{
|
|||
use iced::Vector;
|
||||
|
||||
use crate::{
|
||||
Element,
|
||||
iced::{
|
||||
Event, Length, Rectangle,
|
||||
clipboard::{
|
||||
dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent},
|
||||
mime::AllowedMimeTypes,
|
||||
},
|
||||
event,
|
||||
id::Internal,
|
||||
mouse, overlay, Event, Length, Rectangle,
|
||||
mouse, overlay,
|
||||
},
|
||||
iced_core::{
|
||||
self, layout,
|
||||
widget::{tree, Tree},
|
||||
Clipboard, Shell,
|
||||
self, Clipboard, Shell, layout,
|
||||
widget::{Tree, tree},
|
||||
},
|
||||
widget::{Id, Widget},
|
||||
Element,
|
||||
};
|
||||
|
||||
pub fn dnd_destination<'a, Message: 'static>(
|
||||
|
|
|
|||
|
|
@ -3,17 +3,17 @@ use std::any::Any;
|
|||
use iced_core::window;
|
||||
|
||||
use crate::{
|
||||
Element,
|
||||
iced::{
|
||||
Event, Length, Point, Rectangle, Vector,
|
||||
clipboard::dnd::{DndAction, DndEvent, SourceEvent},
|
||||
event, mouse, overlay, Event, Length, Point, Rectangle, Vector,
|
||||
event, mouse, overlay,
|
||||
},
|
||||
iced_core::{
|
||||
self, layout, renderer,
|
||||
widget::{tree, Tree},
|
||||
Clipboard, Shell,
|
||||
self, Clipboard, Shell, layout, renderer,
|
||||
widget::{Tree, tree},
|
||||
},
|
||||
widget::{container, Id, Widget},
|
||||
Element,
|
||||
widget::{Id, Widget, container},
|
||||
};
|
||||
|
||||
pub fn dnd_source<
|
||||
|
|
@ -40,10 +40,10 @@ pub struct DndSource<'a, Message, D> {
|
|||
}
|
||||
|
||||
impl<
|
||||
'a,
|
||||
Message: Clone + 'static,
|
||||
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
|
||||
> DndSource<'a, Message, D>
|
||||
'a,
|
||||
Message: Clone + 'static,
|
||||
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
|
||||
> DndSource<'a, Message, D>
|
||||
{
|
||||
pub fn new(child: impl Into<Element<'a, Message>>) -> Self {
|
||||
Self {
|
||||
|
|
@ -152,10 +152,8 @@ impl<
|
|||
}
|
||||
}
|
||||
|
||||
impl<
|
||||
Message: Clone + 'static,
|
||||
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
|
||||
> Widget<Message, crate::Theme, crate::Renderer> for DndSource<'_, Message, D>
|
||||
impl<Message: Clone + 'static, D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static>
|
||||
Widget<Message, crate::Theme, crate::Renderer> for DndSource<'_, Message, D>
|
||||
{
|
||||
fn children(&self) -> Vec<Tree> {
|
||||
vec![Tree::new(&self.container)]
|
||||
|
|
@ -400,10 +398,10 @@ impl<
|
|||
}
|
||||
|
||||
impl<
|
||||
'a,
|
||||
Message: Clone + 'static,
|
||||
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
|
||||
> From<DndSource<'a, Message, D>> for Element<'a, Message>
|
||||
'a,
|
||||
Message: Clone + 'static,
|
||||
D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static,
|
||||
> From<DndSource<'a, Message, D>> for Element<'a, Message>
|
||||
{
|
||||
fn from(e: DndSource<'a, Message, D>) -> Element<'a, Message> {
|
||||
Element::new(e)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||
|
||||
//! Change the appearance of menus.
|
||||
use iced_core::{border::Radius, Background, Color};
|
||||
use iced_core::{Background, Color, border::Radius};
|
||||
|
||||
/// The appearance of a menu.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ use std::sync::{Arc, Mutex};
|
|||
pub use appearance::{Appearance, StyleSheet};
|
||||
|
||||
use crate::surface;
|
||||
use crate::widget::{icon, Container, RcWrapper};
|
||||
use crate::widget::{Container, RcWrapper, icon};
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::layout::{self, Layout};
|
||||
use iced_core::text::{self, Text};
|
||||
use iced_core::widget::Tree;
|
||||
use iced_core::{
|
||||
alignment, mouse, overlay, renderer, svg, touch, Border, Clipboard, Element, Length, Padding,
|
||||
Pixels, Point, Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget,
|
||||
Border, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, Renderer, Shadow, Shell,
|
||||
Size, Vector, Widget, alignment, mouse, overlay, renderer, svg, touch,
|
||||
};
|
||||
use iced_widget::scrollable::Scrollable;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ use iced_core::layout::{self, Layout};
|
|||
use iced_core::text::{self, Text};
|
||||
use iced_core::widget::Tree;
|
||||
use iced_core::{
|
||||
alignment, mouse, overlay, renderer, svg, touch, Border, Clipboard, Element, Length, Padding,
|
||||
Pixels, Point, Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget,
|
||||
Border, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, Renderer, Shadow, Shell,
|
||||
Size, Vector, Widget, alignment, mouse, overlay, renderer, svg, touch,
|
||||
};
|
||||
use iced_widget::scrollable::Scrollable;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||
|
||||
mod model;
|
||||
pub use model::{list, model, List, Model};
|
||||
pub use model::{List, Model, list, model};
|
||||
|
||||
pub mod menu;
|
||||
pub use menu::Menu;
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ use derive_setters::Setters;
|
|||
use iced_core::event::{self, Event};
|
||||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::{alignment, keyboard, layout, mouse, overlay, renderer, svg, touch, Shadow};
|
||||
use iced_core::{
|
||||
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget,
|
||||
};
|
||||
use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch};
|
||||
use iced_widget::pick_list;
|
||||
use std::ffi::OsStr;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
use super::menu::{self, Menu};
|
||||
use crate::widget::icon::{self, Handle};
|
||||
use crate::{surface, Element};
|
||||
use crate::{Element, surface};
|
||||
use derive_setters::Setters;
|
||||
use iced::window;
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::{alignment, keyboard, layout, mouse, overlay, renderer, svg, touch, Shadow};
|
||||
use iced_core::{
|
||||
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget,
|
||||
};
|
||||
use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch};
|
||||
use iced_widget::pick_list::{self, Catalog};
|
||||
use std::borrow::Cow;
|
||||
use std::ffi::OsStr;
|
||||
|
|
@ -149,10 +149,10 @@ where
|
|||
}
|
||||
|
||||
impl<
|
||||
S: AsRef<str> + Send + Sync + Clone + 'static,
|
||||
Message: 'static + Clone,
|
||||
AppMessage: 'static + Clone,
|
||||
> Widget<Message, crate::Theme, crate::Renderer> for Dropdown<'_, S, Message, AppMessage>
|
||||
S: AsRef<str> + Send + Sync + Clone + 'static,
|
||||
Message: 'static + Clone,
|
||||
AppMessage: 'static + Clone,
|
||||
> Widget<Message, crate::Theme, crate::Renderer> for Dropdown<'_, S, Message, AppMessage>
|
||||
where
|
||||
[S]: std::borrow::ToOwned,
|
||||
{
|
||||
|
|
@ -344,11 +344,11 @@ where
|
|||
}
|
||||
|
||||
impl<
|
||||
'a,
|
||||
S: AsRef<str> + Send + Sync + Clone + 'static,
|
||||
Message: 'static + std::clone::Clone,
|
||||
AppMessage: 'static + std::clone::Clone,
|
||||
> From<Dropdown<'a, S, Message, AppMessage>> for crate::Element<'a, Message>
|
||||
'a,
|
||||
S: AsRef<str> + Send + Sync + Clone + 'static,
|
||||
Message: 'static + std::clone::Clone,
|
||||
AppMessage: 'static + std::clone::Clone,
|
||||
> From<Dropdown<'a, S, Message, AppMessage>> for crate::Element<'a, Message>
|
||||
where
|
||||
[S]: std::borrow::ToOwned,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use derive_setters::Setters;
|
|||
use iced_core::event::{self, Event};
|
||||
use iced_core::widget::{Operation, Tree};
|
||||
use iced_core::{
|
||||
layout, mouse, overlay, renderer, Alignment, Clipboard, Layout, Length, Padding, Rectangle,
|
||||
Shell, Vector, Widget,
|
||||
Alignment, Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse,
|
||||
overlay, renderer,
|
||||
};
|
||||
|
||||
/// Responsively generates rows and columns of widgets based on its dimmensions.
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ pub fn from_path(path: PathBuf) -> Handle {
|
|||
/// Create an image handle from memory.
|
||||
pub fn from_raster_bytes(
|
||||
bytes: impl Into<Cow<'static, [u8]>>
|
||||
+ std::convert::AsRef<[u8]>
|
||||
+ std::marker::Send
|
||||
+ std::marker::Sync
|
||||
+ 'static,
|
||||
+ std::convert::AsRef<[u8]>
|
||||
+ std::marker::Send
|
||||
+ std::marker::Sync
|
||||
+ 'static,
|
||||
) -> Handle {
|
||||
fn inner(bytes: Cow<'static, [u8]>) -> Handle {
|
||||
Handle {
|
||||
|
|
@ -72,9 +72,9 @@ pub fn from_raster_pixels(
|
|||
width: u32,
|
||||
height: u32,
|
||||
pixels: impl Into<Cow<'static, [u8]>>
|
||||
+ std::convert::AsRef<[u8]>
|
||||
+ std::marker::Send
|
||||
+ std::marker::Sync,
|
||||
+ std::convert::AsRef<[u8]>
|
||||
+ std::marker::Send
|
||||
+ std::marker::Sync,
|
||||
) -> Handle {
|
||||
fn inner(width: u32, height: u32, pixels: Cow<'static, [u8]>) -> Handle {
|
||||
Handle {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use std::sync::Arc;
|
|||
pub use named::{IconFallback, Named};
|
||||
|
||||
mod handle;
|
||||
pub use handle::{from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes, Data, Handle};
|
||||
pub use handle::{Data, Handle, from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes};
|
||||
|
||||
use crate::Element;
|
||||
use derive_setters::Setters;
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@
|
|||
|
||||
pub mod column;
|
||||
|
||||
pub use self::column::{list_column, ListColumn};
|
||||
pub use self::column::{ListColumn, list_column};
|
||||
|
|
|
|||
|
|
@ -64,12 +64,12 @@ pub use key_bind::KeyBind;
|
|||
|
||||
mod menu_bar;
|
||||
pub(crate) use menu_bar::MenuBarState;
|
||||
pub use menu_bar::{menu_bar as bar, MenuBar};
|
||||
pub use menu_bar::{MenuBar, menu_bar as bar};
|
||||
|
||||
mod menu_inner;
|
||||
mod menu_tree;
|
||||
pub use menu_tree::{
|
||||
menu_button, menu_items as items, menu_root as root, MenuItem as Item, MenuTree as Tree,
|
||||
MenuItem as Item, MenuTree as Tree, menu_button, menu_items as items, menu_root as root,
|
||||
};
|
||||
|
||||
pub use crate::style::menu_bar::{Appearance, StyleSheet};
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
use iced_core::widget::Tree;
|
||||
use iced_widget::core::{
|
||||
Alignment, Element, Padding, Point, Size,
|
||||
layout::{Limits, Node},
|
||||
renderer, Alignment, Element, Padding, Point, Size,
|
||||
renderer,
|
||||
};
|
||||
|
||||
/// The main axis of a flex layout.
|
||||
|
|
|
|||
|
|
@ -12,12 +12,11 @@ use crate::style::menu_bar::StyleSheet;
|
|||
use iced::{Point, Vector};
|
||||
use iced_core::Border;
|
||||
use iced_widget::core::{
|
||||
event,
|
||||
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, event,
|
||||
layout::{Limits, Node},
|
||||
mouse::{self, Cursor},
|
||||
overlay, renderer, touch,
|
||||
widget::{tree, Tree},
|
||||
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget,
|
||||
widget::{Tree, tree},
|
||||
};
|
||||
|
||||
/// A `MenuBar` collects `MenuTree`s and handles all the layout, event processing, and drawing.
|
||||
|
|
|
|||
|
|
@ -6,12 +6,11 @@ use crate::style::menu_bar::StyleSheet;
|
|||
|
||||
use iced_core::{Border, Shadow};
|
||||
use iced_widget::core::{
|
||||
event,
|
||||
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,
|
||||
};
|
||||
|
||||
/// The condition of when to close a menu
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ use std::borrow::Cow;
|
|||
use std::collections::HashMap;
|
||||
use std::rc::Rc;
|
||||
|
||||
use iced_widget::core::{renderer, Element};
|
||||
use iced_widget::core::{Element, renderer};
|
||||
|
||||
use crate::iced_core::{Alignment, Length};
|
||||
use crate::widget::menu::action::MenuAction;
|
||||
use crate::widget::menu::key_bind::KeyBind;
|
||||
use crate::widget::{icon, Button};
|
||||
use crate::widget::{Button, icon};
|
||||
use crate::{theme, widget};
|
||||
|
||||
/// Nested menu is essentially a tree of items, a menu is a collection of items
|
||||
|
|
|
|||
|
|
@ -48,46 +48,46 @@
|
|||
|
||||
// Re-exports from Iced
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{canvas, Canvas};
|
||||
pub use iced::widget::{Canvas, canvas};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{checkbox, Checkbox};
|
||||
pub use iced::widget::{Checkbox, checkbox};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{combo_box, ComboBox};
|
||||
pub use iced::widget::{ComboBox, combo_box};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{container, Container};
|
||||
pub use iced::widget::{Container, container};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{horizontal_space, vertical_space, Space};
|
||||
pub use iced::widget::{Space, horizontal_space, vertical_space};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{image, Image};
|
||||
pub use iced::widget::{Image, image};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{lazy, Lazy};
|
||||
pub use iced::widget::{Lazy, lazy};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{mouse_area, MouseArea};
|
||||
pub use iced::widget::{MouseArea, mouse_area};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{pane_grid, PaneGrid};
|
||||
pub use iced::widget::{PaneGrid, pane_grid};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{progress_bar, ProgressBar};
|
||||
pub use iced::widget::{ProgressBar, progress_bar};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{responsive, Responsive};
|
||||
pub use iced::widget::{Responsive, responsive};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{slider, vertical_slider, Slider, VerticalSlider};
|
||||
pub use iced::widget::{Slider, VerticalSlider, slider, vertical_slider};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{svg, Svg};
|
||||
pub use iced::widget::{Svg, svg};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced::widget::{text_editor, TextEditor};
|
||||
pub use iced::widget::{TextEditor, text_editor};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use iced_core::widget::{Id, Operation, Widget};
|
||||
|
|
@ -113,7 +113,7 @@ pub(crate) mod common;
|
|||
|
||||
pub mod calendar;
|
||||
#[doc(inline)]
|
||||
pub use calendar::{calendar, Calendar};
|
||||
pub use calendar::{Calendar, calendar};
|
||||
|
||||
pub mod card;
|
||||
#[doc(inline)]
|
||||
|
|
@ -129,10 +129,10 @@ pub use iced::widget::qr_code;
|
|||
|
||||
pub mod context_drawer;
|
||||
#[doc(inline)]
|
||||
pub use context_drawer::{context_drawer, ContextDrawer};
|
||||
pub use context_drawer::{ContextDrawer, context_drawer};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use column::{column, Column};
|
||||
pub use column::{Column, column};
|
||||
pub mod column {
|
||||
//! A container which aligns its children in a column.
|
||||
|
||||
|
|
@ -159,21 +159,21 @@ pub mod column {
|
|||
|
||||
pub mod layer_container;
|
||||
#[doc(inline)]
|
||||
pub use layer_container::{layer_container, LayerContainer};
|
||||
pub use layer_container::{LayerContainer, layer_container};
|
||||
|
||||
pub mod context_menu;
|
||||
#[doc(inline)]
|
||||
pub use context_menu::{context_menu, ContextMenu};
|
||||
pub use context_menu::{ContextMenu, context_menu};
|
||||
|
||||
pub mod dialog;
|
||||
#[doc(inline)]
|
||||
pub use dialog::{dialog, Dialog};
|
||||
pub use dialog::{Dialog, dialog};
|
||||
|
||||
/// An element to distinguish a boundary between two elements.
|
||||
pub mod divider {
|
||||
/// Horizontal variant of a divider.
|
||||
pub mod horizontal {
|
||||
use iced::widget::{horizontal_rule, Rule};
|
||||
use iced::widget::{Rule, horizontal_rule};
|
||||
|
||||
/// Horizontal divider with default thickness
|
||||
#[must_use]
|
||||
|
|
@ -196,7 +196,7 @@ pub mod divider {
|
|||
|
||||
/// Vertical variant of a divider.
|
||||
pub mod vertical {
|
||||
use iced::widget::{vertical_rule, Rule};
|
||||
use iced::widget::{Rule, vertical_rule};
|
||||
|
||||
/// Vertical divider with default thickness
|
||||
#[must_use]
|
||||
|
|
@ -220,35 +220,35 @@ pub mod divider {
|
|||
|
||||
pub mod dnd_destination;
|
||||
#[doc(inline)]
|
||||
pub use dnd_destination::{dnd_destination, DndDestination};
|
||||
pub use dnd_destination::{DndDestination, dnd_destination};
|
||||
|
||||
pub mod dnd_source;
|
||||
#[doc(inline)]
|
||||
pub use dnd_source::{dnd_source, DndSource};
|
||||
pub use dnd_source::{DndSource, dnd_source};
|
||||
|
||||
pub mod dropdown;
|
||||
#[doc(inline)]
|
||||
pub use dropdown::{dropdown, Dropdown};
|
||||
pub use dropdown::{Dropdown, dropdown};
|
||||
|
||||
pub mod flex_row;
|
||||
#[doc(inline)]
|
||||
pub use flex_row::{flex_row, FlexRow};
|
||||
pub use flex_row::{FlexRow, flex_row};
|
||||
|
||||
pub mod grid;
|
||||
#[doc(inline)]
|
||||
pub use grid::{grid, Grid};
|
||||
pub use grid::{Grid, grid};
|
||||
|
||||
mod header_bar;
|
||||
#[doc(inline)]
|
||||
pub use header_bar::{header_bar, HeaderBar};
|
||||
pub use header_bar::{HeaderBar, header_bar};
|
||||
|
||||
pub mod icon;
|
||||
#[doc(inline)]
|
||||
pub use icon::{icon, Icon};
|
||||
pub use icon::{Icon, icon};
|
||||
|
||||
pub mod id_container;
|
||||
#[doc(inline)]
|
||||
pub use id_container::{id_container, IdContainer};
|
||||
pub use id_container::{IdContainer, id_container};
|
||||
|
||||
#[cfg(feature = "animated-image")]
|
||||
pub mod frames;
|
||||
|
|
@ -257,7 +257,7 @@ pub use taffy::JustifyContent;
|
|||
|
||||
pub mod list;
|
||||
#[doc(inline)]
|
||||
pub use list::{list_column, ListColumn};
|
||||
pub use list::{ListColumn, list_column};
|
||||
|
||||
pub mod menu;
|
||||
|
||||
|
|
@ -267,22 +267,22 @@ pub use nav_bar::{nav_bar, nav_bar_dnd};
|
|||
|
||||
pub mod nav_bar_toggle;
|
||||
#[doc(inline)]
|
||||
pub use nav_bar_toggle::{nav_bar_toggle, NavBarToggle};
|
||||
pub use nav_bar_toggle::{NavBarToggle, nav_bar_toggle};
|
||||
|
||||
pub mod popover;
|
||||
#[doc(inline)]
|
||||
pub use popover::{popover, Popover};
|
||||
pub use popover::{Popover, popover};
|
||||
|
||||
pub mod radio;
|
||||
#[doc(inline)]
|
||||
pub use radio::{radio, Radio};
|
||||
pub use radio::{Radio, radio};
|
||||
|
||||
pub mod rectangle_tracker;
|
||||
#[doc(inline)]
|
||||
pub use rectangle_tracker::{rectangle_tracking_container, RectangleTracker};
|
||||
pub use rectangle_tracker::{RectangleTracker, rectangle_tracking_container};
|
||||
|
||||
#[doc(inline)]
|
||||
pub use row::{row, Row};
|
||||
pub use row::{Row, row};
|
||||
|
||||
pub mod row {
|
||||
//! A container which aligns its children in a row.
|
||||
|
|
@ -319,30 +319,30 @@ pub mod settings;
|
|||
|
||||
pub mod spin_button;
|
||||
#[doc(inline)]
|
||||
pub use spin_button::{spin_button, vertical as vertical_spin_button, SpinButton};
|
||||
pub use spin_button::{SpinButton, spin_button, vertical as vertical_spin_button};
|
||||
|
||||
pub mod tab_bar;
|
||||
|
||||
pub mod text;
|
||||
#[doc(inline)]
|
||||
pub use text::{text, Text};
|
||||
pub use text::{Text, text};
|
||||
|
||||
pub mod text_input;
|
||||
#[doc(inline)]
|
||||
pub use text_input::{
|
||||
editable_input, inline_input, search_input, secure_input, text_input, TextInput,
|
||||
TextInput, editable_input, inline_input, search_input, secure_input, text_input,
|
||||
};
|
||||
|
||||
pub mod toaster;
|
||||
#[doc(inline)]
|
||||
pub use toaster::{toaster, Toast, ToastId, Toasts};
|
||||
pub use toaster::{Toast, ToastId, Toasts, toaster};
|
||||
|
||||
mod toggler;
|
||||
#[doc(inline)]
|
||||
pub use toggler::toggler;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use tooltip::{tooltip, Tooltip};
|
||||
pub use tooltip::{Tooltip, tooltip};
|
||||
|
||||
#[cfg(all(feature = "wayland", feature = "winit"))]
|
||||
pub mod wayland;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
//! A button for toggling the navigation side panel.
|
||||
|
||||
use crate::{widget, Element};
|
||||
use crate::{Element, widget};
|
||||
use derive_setters::Setters;
|
||||
|
||||
#[derive(Setters)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use iced_core::mouse;
|
|||
use iced_core::overlay;
|
||||
use iced_core::renderer;
|
||||
use iced_core::touch;
|
||||
use iced_core::widget::{tree, Operation, Tree};
|
||||
use iced_core::widget::{Operation, Tree, tree};
|
||||
use iced_core::{
|
||||
Clipboard, Element, Layout, Length, Point, Rectangle, Shell, Size, Vector, Widget,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
mod subscription;
|
||||
|
||||
use iced::Vector;
|
||||
use iced::futures::channel::mpsc::UnboundedSender;
|
||||
use iced::widget::Container;
|
||||
use iced::Vector;
|
||||
pub use subscription::*;
|
||||
|
||||
use iced_core::event::{self, Event};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use iced_core::layout;
|
|||
use iced_core::mouse;
|
||||
use iced_core::overlay;
|
||||
use iced_core::renderer;
|
||||
use iced_core::widget::{tree, Id, Tree};
|
||||
use iced_core::widget::{Id, Tree, tree};
|
||||
use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget};
|
||||
|
||||
pub(crate) fn responsive_container<'a, Message: 'static, Theme, E>(
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use std::collections::HashMap;
|
|||
use apply::Apply;
|
||||
|
||||
use crate::{
|
||||
widget::{button, icon, responsive_container},
|
||||
Core, Element,
|
||||
widget::{button, icon, responsive_container},
|
||||
};
|
||||
|
||||
use super::menu;
|
||||
|
|
|
|||
|
|
@ -79,14 +79,14 @@ mod style;
|
|||
mod vertical;
|
||||
mod widget;
|
||||
|
||||
pub use self::horizontal::{horizontal, HorizontalSegmentedButton};
|
||||
pub use self::horizontal::{HorizontalSegmentedButton, horizontal};
|
||||
pub use self::model::{
|
||||
BuilderEntity, Entity, EntityMut, Model, ModelBuilder, MultiSelect, MultiSelectEntityMut,
|
||||
MultiSelectModel, Selectable, SingleSelect, SingleSelectEntityMut, SingleSelectModel,
|
||||
};
|
||||
pub use self::style::{Appearance, ItemAppearance, ItemStatusAppearance, StyleSheet};
|
||||
pub use self::vertical::{vertical, VerticalSegmentedButton};
|
||||
pub use self::widget::{focus, Id, SegmentedButton, SegmentedVariant};
|
||||
pub use self::vertical::{VerticalSegmentedButton, vertical};
|
||||
pub use self::widget::{Id, SegmentedButton, SegmentedVariant, focus};
|
||||
|
||||
/// Associates extra data with an external secondary map.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use iced_core::{border::Radius, Background, Color};
|
||||
use iced_core::{Background, Color, border::Radius};
|
||||
|
||||
/// Appearance of the segmented button.
|
||||
#[derive(Default, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
use crate::{
|
||||
theme,
|
||||
widget::{column, container, flex_row, horizontal_space, row, text, FlexRow, Row},
|
||||
Element,
|
||||
Element, theme,
|
||||
widget::{FlexRow, Row, column, container, flex_row, horizontal_space, row, text},
|
||||
};
|
||||
use derive_setters::Setters;
|
||||
use iced_core::{text::Wrapping, Length};
|
||||
use iced_core::{Length, text::Wrapping};
|
||||
use taffy::AlignContent;
|
||||
|
||||
/// A settings item aligned in a row
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ pub mod item;
|
|||
pub mod section;
|
||||
|
||||
pub use self::item::{flex_item, flex_item_row, item, item_row};
|
||||
pub use self::section::{section, Section};
|
||||
pub use self::section::{Section, section};
|
||||
|
||||
use crate::widget::{column, Column};
|
||||
use crate::{theme, Element};
|
||||
use crate::widget::{Column, column};
|
||||
use crate::{Element, theme};
|
||||
|
||||
/// A column with a predefined style for creating a settings panel
|
||||
#[must_use]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::widget::{column, text, ListColumn};
|
||||
use crate::Element;
|
||||
use crate::widget::{ListColumn, column, text};
|
||||
use std::borrow::Cow;
|
||||
|
||||
/// A section within a settings view column.
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@
|
|||
//! A control for incremental adjustments of a value.
|
||||
|
||||
use crate::{
|
||||
theme,
|
||||
Element, theme,
|
||||
widget::{button, column, container, icon, row, text},
|
||||
Element,
|
||||
};
|
||||
use apply::Apply;
|
||||
use iced::{Alignment, Length};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
//! Change the appearance of a text input.
|
||||
|
||||
use iced_core::{border::Radius, Background, Color};
|
||||
use iced_core::{Background, Color, border::Radius};
|
||||
|
||||
/// The appearance of a text input.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@
|
|||
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::tree::Tree;
|
||||
use iced_core::widget::Operation;
|
||||
use iced_core::Element;
|
||||
use iced_core::Overlay;
|
||||
use iced_core::widget::tree::Tree;
|
||||
use iced_core::{Clipboard, Layout, Length, Point, Rectangle, Shell, Vector, Widget};
|
||||
|
||||
pub struct Toaster<'a, Message, Theme, Renderer> {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use iced::{widget, Length};
|
||||
use iced::{Length, widget};
|
||||
use iced_core::text;
|
||||
|
||||
pub fn toggler<'a, Message, Theme: iced_widget::toggler::Catalog, Renderer>(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use super::icon;
|
||||
use crate::{theme, widget, Element, Renderer, Theme};
|
||||
use crate::{Element, Renderer, Theme, theme, widget};
|
||||
use apply::Apply;
|
||||
use iced::{Alignment, Background, Color, Length};
|
||||
use iced_core::{Border, Shadow};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pub mod widget;
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use iced_core::{border::Radius, Background, Color, Vector};
|
||||
use iced_core::{Background, Color, Vector, border::Radius};
|
||||
|
||||
use crate::theme::THEME;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@ use iced_runtime::core::widget::Id;
|
|||
use iced_core::event::{self, Event};
|
||||
use iced_core::renderer;
|
||||
use iced_core::touch;
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::widget::Operation;
|
||||
use iced_core::{layout, svg};
|
||||
use iced_core::{mouse, Border};
|
||||
use iced_core::{overlay, Shadow};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::{
|
||||
Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget,
|
||||
};
|
||||
use iced_core::{Border, mouse};
|
||||
use iced_core::{Shadow, overlay};
|
||||
use iced_core::{layout, svg};
|
||||
|
||||
pub use super::{Catalog, Style};
|
||||
|
||||
|
|
@ -75,14 +75,14 @@ impl<'a, Message, TopLevelMessage> Tooltip<'a, Message, TopLevelMessage> {
|
|||
content: impl Into<crate::Element<'a, Message>>,
|
||||
settings: Option<
|
||||
impl Fn(Rectangle) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
>,
|
||||
view: impl Fn() -> crate::Element<'static, crate::Action<TopLevelMessage>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
>,
|
||||
view: impl Fn() -> crate::Element<'static, crate::Action<TopLevelMessage>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
on_leave: Message,
|
||||
on_surface_action: impl Fn(crate::surface::Action) -> Message + 'static,
|
||||
) -> Self {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ use std::{
|
|||
};
|
||||
|
||||
use crate::Element;
|
||||
use iced::{event, Length, Rectangle, Size};
|
||||
use iced_core::{id::Id, widget, widget::tree, Widget};
|
||||
use iced::{Length, Rectangle, Size, event};
|
||||
use iced_core::{Widget, id::Id, widget, widget::tree};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RcWrapper<T> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue