Run cargo fmt
This commit is contained in:
parent
28caeccf22
commit
9ceb467e6e
59 changed files with 100 additions and 98 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
use criterion::{criterion_group, criterion_main, Bencher, Criterion};
|
||||
use criterion::{Bencher, Criterion, criterion_group, criterion_main};
|
||||
|
||||
use iced::alignment;
|
||||
use iced::mouse;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::gradient::{self, Gradient};
|
||||
use crate::Color;
|
||||
use crate::gradient::{self, Gradient};
|
||||
|
||||
/// The background of some element.
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
|
|
|
|||
|
|
@ -227,12 +227,8 @@ macro_rules! color {
|
|||
($r:expr, $g:expr, $b:expr) => {
|
||||
$crate::Color::from_rgb8($r, $g, $b)
|
||||
};
|
||||
($r:expr, $g:expr, $b:expr, $a:expr) => {{
|
||||
$crate::Color::from_rgba8($r, $g, $b, $a)
|
||||
}};
|
||||
($hex:expr) => {{
|
||||
$crate::color!($hex, 1.0)
|
||||
}};
|
||||
($r:expr, $g:expr, $b:expr, $a:expr) => {{ $crate::Color::from_rgba8($r, $g, $b, $a) }};
|
||||
($hex:expr) => {{ $crate::color!($hex, 1.0) }};
|
||||
($hex:expr, $a:expr) => {{
|
||||
let hex = $hex as u32;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::SmolStr;
|
||||
use crate::keyboard::key;
|
||||
use crate::keyboard::{Key, Location, Modifiers};
|
||||
use crate::SmolStr;
|
||||
|
||||
/// A keyboard event.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::InputMethod;
|
||||
use crate::event;
|
||||
use crate::window;
|
||||
use crate::InputMethod;
|
||||
|
||||
/// A connection to the state of a shell.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//! Define the colors of a theme.
|
||||
use crate::{color, Color};
|
||||
use crate::{Color, color};
|
||||
|
||||
use palette::color_difference::Wcag21RelativeContrast;
|
||||
use palette::rgb::Rgb;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! Operate on widgets that can be focused.
|
||||
use crate::widget::operation::{self, Operation, Outcome};
|
||||
use crate::widget::Id;
|
||||
use crate::Rectangle;
|
||||
use crate::widget::Id;
|
||||
use crate::widget::operation::{self, Operation, Outcome};
|
||||
|
||||
/// The internal state of a widget that can be focused.
|
||||
pub trait Focusable {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! Operate on widgets that have text input.
|
||||
use crate::widget::operation::Operation;
|
||||
use crate::widget::Id;
|
||||
use crate::Rectangle;
|
||||
use crate::widget::Id;
|
||||
use crate::widget::operation::Operation;
|
||||
|
||||
/// The internal state of a widget that has text input.
|
||||
pub trait TextInput {
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ mod platform;
|
|||
#[path = "settings/other.rs"]
|
||||
mod platform;
|
||||
|
||||
use crate::window::{Icon, Level, Position};
|
||||
use crate::Size;
|
||||
use crate::window::{Icon, Level, Position};
|
||||
|
||||
pub use platform::PlatformSpecific;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ impl crate::Executor for Executor {
|
|||
|
||||
pub mod time {
|
||||
//! Listen and react to time.
|
||||
use crate::MaybeSend;
|
||||
use crate::core::time::{Duration, Instant};
|
||||
use crate::subscription::Subscription;
|
||||
use crate::MaybeSend;
|
||||
|
||||
use futures::stream;
|
||||
use std::future::Future;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
//! Listen to runtime events.
|
||||
use crate::MaybeSend;
|
||||
use crate::core::event::{self, Event};
|
||||
use crate::core::window;
|
||||
use crate::subscription::{self, Subscription};
|
||||
use crate::MaybeSend;
|
||||
|
||||
/// Returns a [`Subscription`] to all the ignored runtime events.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
//! Listen to keyboard events.
|
||||
use crate::MaybeSend;
|
||||
use crate::core;
|
||||
use crate::core::event;
|
||||
use crate::core::keyboard::{Event, Key, Modifiers};
|
||||
use crate::subscription::{self, Subscription};
|
||||
use crate::MaybeSend;
|
||||
|
||||
/// Listens to keyboard key presses and calls the given function
|
||||
/// to map them into actual messages.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
use crate::subscription;
|
||||
use crate::{BoxFuture, BoxStream, Executor, MaybeSend};
|
||||
|
||||
use futures::{channel::mpsc, Sink};
|
||||
use futures::{Sink, channel::mpsc};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// A batteries-included runtime of commands and subscriptions.
|
||||
|
|
|
|||
|
|
@ -120,9 +120,7 @@ pub trait Default {
|
|||
#[derive(Clone, PartialEq, Eq, Debug, Error)]
|
||||
pub enum SurfaceError {
|
||||
/// A timeout was encountered while trying to acquire the next frame.
|
||||
#[error(
|
||||
"A timeout was encountered while trying to acquire the next frame"
|
||||
)]
|
||||
#[error("A timeout was encountered while trying to acquire the next frame")]
|
||||
Timeout,
|
||||
/// The underlying surface has changed, and therefore the surface must be updated.
|
||||
#[error(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::geometry::path::{arc, Arc, Path};
|
||||
use crate::geometry::path::{Arc, Path, arc};
|
||||
|
||||
use crate::core::border;
|
||||
use crate::core::{Point, Radians, Size};
|
||||
|
|
@ -171,8 +171,12 @@ impl Builder {
|
|||
radius: border::Radius,
|
||||
) {
|
||||
let min_size = (size.height / 2.0).min(size.width / 2.0);
|
||||
let [top_left_corner, top_right_corner, bottom_right_corner, bottom_left_corner] =
|
||||
radius.into();
|
||||
let [
|
||||
top_left_corner,
|
||||
top_right_corner,
|
||||
bottom_right_corner,
|
||||
bottom_left_corner,
|
||||
] = radius.into();
|
||||
|
||||
self.move_to(Point::new(
|
||||
top_left.x + min_size.min(top_left_corner),
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
#[cfg(feature = "image")]
|
||||
pub use ::image as image_rs;
|
||||
|
||||
use crate::core::Rectangle;
|
||||
use crate::core::image;
|
||||
use crate::core::svg;
|
||||
use crate::core::Rectangle;
|
||||
|
||||
/// A raster or vector image.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::core::{Font, Pixels};
|
||||
use crate::Antialiasing;
|
||||
use crate::core::{Font, Pixels};
|
||||
|
||||
/// The settings of a renderer.
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
//! A syntax highlighter for iced.
|
||||
use iced_core as core;
|
||||
|
||||
use crate::core::Color;
|
||||
use crate::core::font::{self, Font};
|
||||
use crate::core::text::highlighter::{self, Format};
|
||||
use crate::core::Color;
|
||||
|
||||
use std::ops::Range;
|
||||
use std::sync::LazyLock;
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ impl<A, B> core::text::Renderer for Renderer<A, B>
|
|||
where
|
||||
A: core::text::Renderer,
|
||||
B: core::text::Renderer<
|
||||
Font = A::Font,
|
||||
Paragraph = A::Paragraph,
|
||||
Editor = A::Editor,
|
||||
>,
|
||||
Font = A::Font,
|
||||
Paragraph = A::Paragraph,
|
||||
Editor = A::Editor,
|
||||
>,
|
||||
{
|
||||
type Font = A::Font;
|
||||
type Paragraph = A::Paragraph;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//! Load and use fonts.
|
||||
use crate::task::{self, Task};
|
||||
use crate::Action;
|
||||
use crate::task::{self, Task};
|
||||
use std::borrow::Cow;
|
||||
|
||||
/// An error while loading a font.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
//! Build interactive programs using The Elm Architecture.
|
||||
use crate::Task;
|
||||
use crate::core::text;
|
||||
use crate::core::window;
|
||||
use crate::core::{Element, Renderer};
|
||||
use crate::Task;
|
||||
|
||||
/// The core of a user interface for a multi-window application following The Elm Architecture.
|
||||
pub trait Program: Sized {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
//! Build interactive programs using The Elm Architecture.
|
||||
use crate::Task;
|
||||
|
||||
use iced_core::text;
|
||||
use iced_core::Element;
|
||||
use iced_core::text;
|
||||
|
||||
mod state;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
//! Create runtime tasks.
|
||||
use crate::Action;
|
||||
use crate::core::widget;
|
||||
use crate::futures::futures::channel::mpsc;
|
||||
use crate::futures::futures::channel::oneshot;
|
||||
use crate::futures::futures::future::{self, FutureExt};
|
||||
use crate::futures::futures::stream::{self, Stream, StreamExt};
|
||||
use crate::futures::{boxed_stream, BoxStream, MaybeSend};
|
||||
use crate::Action;
|
||||
use crate::futures::{BoxStream, MaybeSend, boxed_stream};
|
||||
|
||||
use std::future::Future;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[doc(no_inline)]
|
||||
pub use sipper::{sipper, stream, Never, Sender, Sipper, Straw};
|
||||
pub use sipper::{Never, Sender, Sipper, Straw, sipper, stream};
|
||||
|
||||
/// A set of concurrent actions to be performed by the iced runtime.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use crate::core::window::{
|
|||
UserAttention,
|
||||
};
|
||||
use crate::core::{Point, Size};
|
||||
use crate::futures::Subscription;
|
||||
use crate::futures::event;
|
||||
use crate::futures::futures::channel::oneshot;
|
||||
use crate::futures::Subscription;
|
||||
use crate::task::{self, Task};
|
||||
|
||||
pub use raw_window_handle;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
pub mod subscription {
|
||||
//! Write your own subscriptions.
|
||||
pub use crate::runtime::futures::subscription::{
|
||||
from_recipe, into_recipes, Event, EventStream, Hasher, MacOS,
|
||||
PlatformSpecific, Recipe,
|
||||
Event, EventStream, Hasher, MacOS, PlatformSpecific, Recipe,
|
||||
from_recipe, into_recipes,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -13,6 +13,7 @@ pub mod widget {
|
|||
pub use crate::runtime::task::widget as operate;
|
||||
}
|
||||
|
||||
pub use crate::core::Shell;
|
||||
pub use crate::core::clipboard::{self, Clipboard};
|
||||
pub use crate::core::image;
|
||||
pub use crate::core::layout::{self, Layout};
|
||||
|
|
@ -21,6 +22,5 @@ pub use crate::core::overlay::{self, Overlay};
|
|||
pub use crate::core::renderer::{self, Renderer};
|
||||
pub use crate::core::svg;
|
||||
pub use crate::core::text::{self, Text};
|
||||
pub use crate::core::Shell;
|
||||
pub use crate::renderer::graphics;
|
||||
pub use widget::Widget;
|
||||
|
|
|
|||
14
src/lib.rs
14
src/lib.rs
|
|
@ -505,22 +505,22 @@ pub use crate::core::gradient;
|
|||
pub use crate::core::padding;
|
||||
pub use crate::core::theme;
|
||||
pub use crate::core::{
|
||||
never, Alignment, Animation, Background, Border, Color, ContentFit,
|
||||
Degrees, Function, Gradient, Length, Padding, Pixels, Point, Radians,
|
||||
Rectangle, Rotation, Settings, Shadow, Size, Theme, Transformation, Vector,
|
||||
Alignment, Animation, Background, Border, Color, ContentFit, Degrees,
|
||||
Function, Gradient, Length, Padding, Pixels, Point, Radians, Rectangle,
|
||||
Rotation, Settings, Shadow, Size, Theme, Transformation, Vector, never,
|
||||
};
|
||||
pub use crate::runtime::exit;
|
||||
pub use iced_futures::Subscription;
|
||||
|
||||
pub use alignment::Horizontal::{Left, Right};
|
||||
pub use alignment::Vertical::{Bottom, Top};
|
||||
pub use Alignment::Center;
|
||||
pub use Length::{Fill, FillPortion, Shrink};
|
||||
pub use alignment::Horizontal::{Left, Right};
|
||||
pub use alignment::Vertical::{Bottom, Top};
|
||||
|
||||
pub mod task {
|
||||
//! Create runtime tasks.
|
||||
pub use crate::runtime::task::{
|
||||
sipper, stream, Handle, Never, Sipper, Straw, Task,
|
||||
Handle, Never, Sipper, Straw, Task, sipper, stream,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -683,7 +683,7 @@ pub fn run<State, Message, Theme, Renderer>(
|
|||
title: impl application::Title<State> + 'static,
|
||||
update: impl application::Update<State, Message> + 'static,
|
||||
view: impl for<'a> application::View<'a, State, Message, Theme, Renderer>
|
||||
+ 'static,
|
||||
+ 'static,
|
||||
) -> Result
|
||||
where
|
||||
State: Default + 'static,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use crate::Primitive;
|
||||
use crate::core::renderer::Quad;
|
||||
use crate::core::{
|
||||
Background, Color, Gradient, Rectangle, Size, Transformation, Vector,
|
||||
};
|
||||
use crate::graphics::{Image, Text};
|
||||
use crate::text;
|
||||
use crate::Primitive;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Engine {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use crate::Primitive;
|
||||
use crate::core::text::LineHeight;
|
||||
use crate::core::{self, Pixels, Point, Radians, Rectangle, Size, Svg, Vector};
|
||||
use crate::graphics::cache::{self, Cached};
|
||||
|
|
@ -5,7 +6,6 @@ use crate::graphics::geometry::fill::{self, Fill};
|
|||
use crate::graphics::geometry::stroke::{self, Stroke};
|
||||
use crate::graphics::geometry::{self, Path, Style};
|
||||
use crate::graphics::{self, Gradient, Image, Text};
|
||||
use crate::Primitive;
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use crate::Primitive;
|
||||
use crate::core::renderer::Quad;
|
||||
use crate::core::{
|
||||
self, Background, Color, Point, Rectangle, Svg, Transformation,
|
||||
|
|
@ -6,7 +7,6 @@ use crate::graphics::damage;
|
|||
use crate::graphics::layer;
|
||||
use crate::graphics::text::{Editor, Paragraph, Text};
|
||||
use crate::graphics::{self, Image};
|
||||
use crate::Primitive;
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ use crate::core::{
|
|||
Background, Color, Font, Pixels, Point, Rectangle, Size, Transformation,
|
||||
};
|
||||
use crate::engine::Engine;
|
||||
use crate::graphics::Viewport;
|
||||
use crate::graphics::compositor;
|
||||
use crate::graphics::text::{Editor, Paragraph};
|
||||
use crate::graphics::Viewport;
|
||||
|
||||
/// A [`tiny-skia`] graphics renderer for [`iced`].
|
||||
///
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ fn into_fill_rule(rule: fill::Rule) -> lyon::tessellation::FillRule {
|
|||
|
||||
pub(super) fn dashed(path: &Path, line_dash: LineDash<'_>) -> Path {
|
||||
use lyon::algorithms::walk::{
|
||||
walk_along_path, RepeatedPattern, WalkerEvent,
|
||||
RepeatedPattern, WalkerEvent, walk_along_path,
|
||||
};
|
||||
use lyon::path::iterator::PathIterator;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ mod raster;
|
|||
#[cfg(feature = "svg")]
|
||||
mod vector;
|
||||
|
||||
use crate::core::{Rectangle, Size, Transformation};
|
||||
use crate::Buffer;
|
||||
use crate::core::{Rectangle, Size, Transformation};
|
||||
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::core::image;
|
||||
use crate::core::Size;
|
||||
use crate::core::image;
|
||||
use crate::graphics;
|
||||
use crate::graphics::image::image_rs;
|
||||
use crate::image::atlas::{self, Atlas};
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use crate::core::{
|
||||
self, renderer, Background, Color, Point, Rectangle, Svg, Transformation,
|
||||
self, Background, Color, Point, Rectangle, Svg, Transformation, renderer,
|
||||
};
|
||||
use crate::graphics;
|
||||
use crate::graphics::Mesh;
|
||||
use crate::graphics::color;
|
||||
use crate::graphics::layer;
|
||||
use crate::graphics::text::{Editor, Paragraph};
|
||||
use crate::graphics::Mesh;
|
||||
use crate::image::{self, Image};
|
||||
use crate::primitive::{self, Primitive};
|
||||
use crate::quad::{self, Quad};
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ use crate::core::{
|
|||
Background, Color, Font, Pixels, Point, Rectangle, Size, Transformation,
|
||||
Vector,
|
||||
};
|
||||
use crate::graphics::text::{Editor, Paragraph};
|
||||
use crate::graphics::Viewport;
|
||||
use crate::graphics::text::{Editor, Paragraph};
|
||||
|
||||
/// A [`wgpu`] graphics renderer for [`iced`].
|
||||
///
|
||||
|
|
@ -403,9 +403,9 @@ impl Renderer {
|
|||
overlay: &[impl AsRef<str>],
|
||||
viewport: &Viewport,
|
||||
) {
|
||||
use crate::core::Renderer as _;
|
||||
use crate::core::alignment;
|
||||
use crate::core::text::Renderer as _;
|
||||
use crate::core::Renderer as _;
|
||||
|
||||
self.with_layer(
|
||||
Rectangle::with_size(viewport.logical_size()),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::Buffer;
|
||||
use crate::graphics::gradient;
|
||||
use crate::quad::{self, Quad};
|
||||
use crate::Buffer;
|
||||
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use std::ops::Range;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::Buffer;
|
||||
use crate::graphics::color;
|
||||
use crate::quad::{self, Quad};
|
||||
use crate::Buffer;
|
||||
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use std::ops::Range;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use crate::core::{Rectangle, Size, Transformation};
|
|||
use crate::graphics::cache;
|
||||
use crate::graphics::color;
|
||||
use crate::graphics::text::cache::{self as text_cache, Cache as BufferCache};
|
||||
use crate::graphics::text::{font_system, to_color, Editor, Paragraph};
|
||||
use crate::graphics::text::{Editor, Paragraph, font_system, to_color};
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
use std::collections::hash_map;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
//! Draw meshes of triangles.
|
||||
mod msaa;
|
||||
|
||||
use crate::core::{Rectangle, Size, Transformation};
|
||||
use crate::graphics::mesh::{self, Mesh};
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::Buffer;
|
||||
use crate::core::{Rectangle, Size, Transformation};
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::graphics::mesh::{self, Mesh};
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
use std::collections::hash_map;
|
||||
|
|
@ -644,10 +644,10 @@ impl Uniforms {
|
|||
}
|
||||
|
||||
mod solid {
|
||||
use crate::graphics::mesh;
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::triangle;
|
||||
use crate::Buffer;
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::graphics::mesh;
|
||||
use crate::triangle;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Pipeline {
|
||||
|
|
@ -795,11 +795,11 @@ mod solid {
|
|||
}
|
||||
|
||||
mod gradient {
|
||||
use crate::Buffer;
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::graphics::color;
|
||||
use crate::graphics::mesh;
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::triangle;
|
||||
use crate::Buffer;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Pipeline {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ use crate::core::overlay;
|
|||
use crate::core::renderer;
|
||||
use crate::core::theme::palette;
|
||||
use crate::core::touch;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::widget::Operation;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::window;
|
||||
use crate::core::{
|
||||
Background, Clipboard, Color, Element, Event, Layout, Length, Padding,
|
||||
|
|
|
|||
|
|
@ -52,13 +52,13 @@ mod program;
|
|||
|
||||
pub use program::Program;
|
||||
|
||||
pub use crate::Action;
|
||||
pub use crate::core::event::Event;
|
||||
pub use crate::graphics::cache::Group;
|
||||
pub use crate::graphics::geometry::{
|
||||
fill, gradient, path, stroke, Fill, Gradient, Image, LineCap, LineDash,
|
||||
LineJoin, Path, Stroke, Style, Text,
|
||||
Fill, Gradient, Image, LineCap, LineDash, LineJoin, Path, Stroke, Style,
|
||||
Text, fill, gradient, path, stroke,
|
||||
};
|
||||
pub use crate::Action;
|
||||
|
||||
use crate::core::event;
|
||||
use crate::core::layout::{self, Layout};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::Action;
|
||||
use crate::canvas::mouse;
|
||||
use crate::canvas::{Event, Geometry};
|
||||
use crate::core::Rectangle;
|
||||
use crate::graphics::geometry;
|
||||
use crate::Action;
|
||||
|
||||
/// The state and logic of a [`Canvas`].
|
||||
///
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ use crate::core::theme;
|
|||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::widget::{self, Operation};
|
||||
use crate::core::{
|
||||
self, color, Background, Clipboard, Color, Element, Event, Layout, Length,
|
||||
self, Background, Clipboard, Color, Element, Event, Layout, Length,
|
||||
Padding, Pixels, Point, Rectangle, Shadow, Shell, Size, Theme, Vector,
|
||||
Widget,
|
||||
Widget, color,
|
||||
};
|
||||
use crate::runtime::task::{self, Task};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ use crate::pick_list::{self, PickList};
|
|||
use crate::progress_bar::{self, ProgressBar};
|
||||
use crate::radio::{self, Radio};
|
||||
use crate::rule::{self, Rule};
|
||||
use crate::runtime::task::{self, Task};
|
||||
use crate::runtime::Action;
|
||||
use crate::runtime::task::{self, Task};
|
||||
use crate::scrollable::{self, Scrollable};
|
||||
use crate::slider::{self, Slider};
|
||||
use crate::text::{self, Text};
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use crate::core::layout;
|
|||
use crate::core::mouse;
|
||||
use crate::core::overlay;
|
||||
use crate::core::renderer;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::widget::Operation;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::{
|
||||
Alignment, Clipboard, Element, Event, Layout, Length, Padding, Pixels,
|
||||
Rectangle, Shell, Size, Vector, Widget,
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ pub use responsive::Responsive;
|
|||
|
||||
mod cache;
|
||||
|
||||
use crate::core::Element;
|
||||
use crate::core::layout::{self, Layout};
|
||||
use crate::core::mouse;
|
||||
use crate::core::overlay;
|
||||
use crate::core::renderer;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::widget::{self, Widget};
|
||||
use crate::core::Element;
|
||||
use crate::core::{
|
||||
self, Clipboard, Event, Length, Point, Rectangle, Shell, Size, Vector,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#![allow(dead_code)]
|
||||
use crate::core::overlay;
|
||||
use crate::core::Element;
|
||||
use crate::core::overlay;
|
||||
|
||||
use ouroboros::self_referencing;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ use crate::core::font::{self, Font};
|
|||
use crate::core::padding;
|
||||
use crate::core::theme;
|
||||
use crate::core::{
|
||||
self, color, Color, Element, Length, Padding, Pixels, Theme,
|
||||
self, Color, Element, Length, Padding, Pixels, Theme, color,
|
||||
};
|
||||
use crate::{column, container, rich_text, row, scrollable, span, text};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use crate::core::mouse;
|
|||
use crate::core::overlay;
|
||||
use crate::core::renderer;
|
||||
use crate::core::touch;
|
||||
use crate::core::widget::{tree, Operation, Tree};
|
||||
use crate::core::widget::{Operation, Tree, tree};
|
||||
use crate::core::{
|
||||
Clipboard, Element, Event, Layout, Length, Point, Rectangle, Shell, Size,
|
||||
Vector, Widget,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
//! qr_code(&state.data).into()
|
||||
//! }
|
||||
//! ```
|
||||
use crate::Renderer;
|
||||
use crate::canvas;
|
||||
use crate::core::layout;
|
||||
use crate::core::mouse;
|
||||
|
|
@ -29,7 +30,6 @@ use crate::core::{
|
|||
Color, Element, Layout, Length, Pixels, Point, Rectangle, Size, Theme,
|
||||
Vector, Widget,
|
||||
};
|
||||
use crate::Renderer;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use thiserror::Error;
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ use crate::core::{
|
|||
Length, Padding, Pixels, Point, Rectangle, Shell, Size, Theme, Vector,
|
||||
Widget,
|
||||
};
|
||||
use crate::runtime::task::{self, Task};
|
||||
use crate::runtime::Action;
|
||||
use crate::runtime::task::{self, Task};
|
||||
|
||||
pub use operation::scrollable::{AbsoluteOffset, RelativeOffset};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ use crate::renderer::wgpu::primitive;
|
|||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub use crate::graphics::Viewport;
|
||||
pub use crate::Action;
|
||||
pub use crate::graphics::Viewport;
|
||||
pub use primitive::{Primitive, Storage};
|
||||
|
||||
/// A widget which can render custom shaders with Iced's `wgpu` backend.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::core::mouse;
|
||||
use crate::core::Rectangle;
|
||||
use crate::core::mouse;
|
||||
use crate::renderer::wgpu::Primitive;
|
||||
use crate::shader::{self, Action};
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ use crate::core::{
|
|||
Background, Border, Color, Element, Event, InputMethod, Layout, Length,
|
||||
Padding, Pixels, Point, Rectangle, Shell, Size, Theme, Vector, Widget,
|
||||
};
|
||||
use crate::runtime::task::{self, Task};
|
||||
use crate::runtime::Action;
|
||||
use crate::runtime::task::{self, Task};
|
||||
|
||||
/// A field that can be filled with text.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use crate::core::layout;
|
|||
use crate::core::mouse;
|
||||
use crate::core::overlay;
|
||||
use crate::core::renderer;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::widget::Operation;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::{
|
||||
Background, Clipboard, Color, Element, Event, Layout, Length, Point,
|
||||
Rectangle, Shell, Size, Vector, Widget,
|
||||
|
|
|
|||
|
|
@ -470,8 +470,10 @@ where
|
|||
|
||||
layout::Node::with_children(
|
||||
tooltip_bounds.size(),
|
||||
vec![tooltip_layout
|
||||
.translate(Vector::new(self.padding, self.padding))],
|
||||
vec![
|
||||
tooltip_layout
|
||||
.translate(Vector::new(self.padding, self.padding)),
|
||||
],
|
||||
)
|
||||
.translate(Vector::new(tooltip_bounds.x, tooltip_bounds.y))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ use crate::futures::futures::{Future, StreamExt};
|
|||
use crate::futures::subscription::{self, Subscription};
|
||||
use crate::futures::{Executor, Runtime};
|
||||
use crate::graphics;
|
||||
use crate::graphics::{compositor, Compositor};
|
||||
use crate::runtime::user_interface::{self, UserInterface};
|
||||
use crate::graphics::{Compositor, compositor};
|
||||
use crate::runtime::Debug;
|
||||
use crate::runtime::user_interface::{self, UserInterface};
|
||||
use crate::runtime::{self, Action, Task};
|
||||
use crate::{Clipboard, Error, Proxy, Settings};
|
||||
|
||||
|
|
@ -406,7 +406,9 @@ where
|
|||
.with_canvas(self.canvas.take())
|
||||
};
|
||||
|
||||
log::info!("Window attributes for id `{id:#?}`: {window_attributes:#?}");
|
||||
log::info!(
|
||||
"Window attributes for id `{id:#?}`: {window_attributes:#?}"
|
||||
);
|
||||
|
||||
// On macOS, the `position` in `WindowAttributes` represents the "inner"
|
||||
// position of the window; while on other platforms it's the "outer" position.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::conversion;
|
||||
use crate::core::{mouse, theme, window};
|
||||
use crate::core::{Color, Size};
|
||||
use crate::core::{mouse, theme, window};
|
||||
use crate::graphics::Viewport;
|
||||
use crate::program::Program;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::futures::futures::{
|
||||
Future, Sink, StreamExt,
|
||||
channel::mpsc,
|
||||
select,
|
||||
task::{Context, Poll},
|
||||
Future, Sink, StreamExt,
|
||||
};
|
||||
use crate::runtime::Action;
|
||||
use std::pin::Pin;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue