Remove widget module re-exports in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2021-10-31 15:35:12 +07:00
parent e5e477aa69
commit 0aafcde0ef
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
81 changed files with 166 additions and 154 deletions

View file

@ -1,9 +1,7 @@
use iced_glow::Renderer;
use iced_glutin::slider;
use iced_glutin::{
Alignment, Color, Column, Command, Element, Length, Program, Row, Slider,
Text,
};
use iced_glutin::widget::slider::{self, Slider};
use iced_glutin::widget::{Column, Row, Text};
use iced_glutin::{Alignment, Color, Command, Element, Length, Program};
pub struct Controls {
background_color: Color,

View file

@ -1,8 +1,7 @@
use iced_wgpu::Renderer;
use iced_winit::{
slider, Alignment, Color, Column, Command, Element, Length, Program, Row,
Slider, Text,
};
use iced_winit::widget::slider::{self, Slider};
use iced_winit::widget::{Column, Row, Text};
use iced_winit::{Alignment, Color, Command, Element, Length, Program};
pub struct Controls {
background_color: Color,

View file

@ -237,7 +237,10 @@ impl backend::Text for Backend {
#[cfg(feature = "image")]
impl backend::Image for Backend {
fn dimensions(&self, _handle: &iced_native::image::Handle) -> (u32, u32) {
fn dimensions(
&self,
_handle: &iced_native::widget::image::Handle,
) -> (u32, u32) {
(50, 50)
}
}
@ -246,7 +249,7 @@ impl backend::Image for Backend {
impl backend::Svg for Backend {
fn viewport_dimensions(
&self,
_handle: &iced_native::svg::Handle,
_handle: &iced_native::widget::svg::Handle,
) -> (u32, u32) {
(50, 50)
}

View file

@ -5,7 +5,7 @@ use iced_graphics::font;
use glow_glyph::ab_glyph;
use std::{cell::RefCell, collections::HashMap};
pub use iced_native::text::Hit;
pub use iced_native::widget::text::Hit;
#[derive(Debug)]
pub struct Pipeline {

View file

@ -66,13 +66,14 @@ pub mod qr_code;
#[doc(no_inline)]
pub use qr_code::QRCode;
pub use iced_native::{Image, Space};
pub use iced_native::widget::{Image, Space};
/// A container that distributes its contents vertically.
pub type Column<'a, Message> = iced_native::Column<'a, Message, Renderer>;
pub type Column<'a, Message> =
iced_native::widget::Column<'a, Message, Renderer>;
/// A container that distributes its contents horizontally.
pub type Row<'a, Message> = iced_native::Row<'a, Message, Renderer>;
pub type Row<'a, Message> = iced_native::widget::Row<'a, Message, Renderer>;
/// A paragraph of text.
pub type Text = iced_native::Text<Renderer>;
pub type Text = iced_native::widget::Text<Renderer>;

View file

@ -4,9 +4,10 @@
use crate::Renderer;
pub use iced_graphics::button::{Style, StyleSheet};
pub use iced_native::button::State;
pub use iced_native::widget::button::State;
/// A widget that produces a message when clicked.
///
/// This is an alias of an `iced_native` button with an `iced_wgpu::Renderer`.
pub type Button<'a, Message> = iced_native::Button<'a, Message, Renderer>;
pub type Button<'a, Message> =
iced_native::widget::Button<'a, Message, Renderer>;

View file

@ -6,4 +6,5 @@ pub use iced_graphics::checkbox::{Style, StyleSheet};
/// A box that can be checked.
///
/// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`.
pub type Checkbox<'a, Message> = iced_native::Checkbox<'a, Message, Renderer>;
pub type Checkbox<'a, Message> =
iced_native::widget::Checkbox<'a, Message, Renderer>;

View file

@ -7,4 +7,5 @@ pub use iced_graphics::container::{Style, StyleSheet};
///
/// This is an alias of an `iced_native` container with a default
/// `Renderer`.
pub type Container<'a, Message> = iced_native::Container<'a, Message, Renderer>;
pub type Container<'a, Message> =
iced_native::widget::Container<'a, Message, Renderer>;

View file

@ -20,12 +20,13 @@ pub use iced_graphics::pane_grid::{
/// [![Pane grid - Iced](https://thumbs.gfycat.com/MixedFlatJellyfish-small.gif)](https://gfycat.com/mixedflatjellyfish)
///
/// This is an alias of an `iced_native` pane grid with an `iced_wgpu::Renderer`.
pub type PaneGrid<'a, Message> = iced_native::PaneGrid<'a, Message, Renderer>;
pub type PaneGrid<'a, Message> =
iced_native::widget::PaneGrid<'a, Message, Renderer>;
/// The content of a [`Pane`].
pub type Content<'a, Message> =
iced_native::pane_grid::Content<'a, Message, Renderer>;
iced_native::widget::pane_grid::Content<'a, Message, Renderer>;
/// The title bar of a [`Pane`].
pub type TitleBar<'a, Message> =
iced_native::pane_grid::TitleBar<'a, Message, Renderer>;
iced_native::widget::pane_grid::TitleBar<'a, Message, Renderer>;

View file

@ -1,9 +1,9 @@
//! Display a dropdown list of selectable values.
pub use iced_native::pick_list::State;
pub use iced_native::widget::pick_list::State;
pub use iced_graphics::overlay::menu::Style as Menu;
pub use iced_graphics::pick_list::{Style, StyleSheet};
/// A widget allowing the selection of a single value from a list of options.
pub type PickList<'a, T, Message> =
iced_native::PickList<'a, T, Message, crate::Renderer>;
iced_native::widget::PickList<'a, T, Message, crate::Renderer>;

View file

@ -7,4 +7,4 @@ pub use iced_graphics::radio::{Style, StyleSheet};
///
/// This is an alias of an `iced_native` radio button with an
/// `iced_wgpu::Renderer`.
pub type Radio<'a, Message> = iced_native::Radio<'a, Message, Renderer>;
pub type Radio<'a, Message> = iced_native::widget::Radio<'a, Message, Renderer>;

View file

@ -2,7 +2,7 @@
use crate::Renderer;
pub use iced_graphics::scrollable::{Scrollbar, Scroller, StyleSheet};
pub use iced_native::scrollable::State;
pub use iced_native::widget::scrollable::State;
/// A widget that can vertically display an infinite amount of content
/// with a scrollbar.
@ -10,4 +10,4 @@ pub use iced_native::scrollable::State;
/// This is an alias of an `iced_native` scrollable with a default
/// `Renderer`.
pub type Scrollable<'a, Message> =
iced_native::Scrollable<'a, Message, Renderer>;
iced_native::widget::Scrollable<'a, Message, Renderer>;

View file

@ -2,4 +2,4 @@
//!
//! A [`Slider`] has some local [`State`].
pub use iced_graphics::slider::{Handle, HandleShape, Style, StyleSheet};
pub use iced_native::slider::{Slider, State};
pub use iced_native::widget::slider::{Slider, State};

View file

@ -4,9 +4,10 @@
use crate::Renderer;
pub use iced_graphics::text_input::{Style, StyleSheet};
pub use iced_native::text_input::State;
pub use iced_native::widget::text_input::State;
/// A field that can be filled with text.
///
/// This is an alias of an `iced_native` text input with an `iced_wgpu::Renderer`.
pub type TextInput<'a, Message> = iced_native::TextInput<'a, Message, Renderer>;
pub type TextInput<'a, Message> =
iced_native::widget::TextInput<'a, Message, Renderer>;

View file

@ -6,4 +6,4 @@ pub use iced_graphics::toggler::{Style, StyleSheet};
/// A toggler that can be toggled.
///
/// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`.
pub type Toggler<Message> = iced_native::Toggler<Message, Renderer>;
pub type Toggler<Message> = iced_native::widget::Toggler<Message, Renderer>;

View file

@ -1,6 +1,6 @@
//! Display a widget over another.
/// A widget allowing the selection of a single value from a list of options.
pub type Tooltip<'a, Message> =
iced_native::Tooltip<'a, Message, crate::Renderer>;
iced_native::widget::Tooltip<'a, Message, crate::Renderer>;
pub use iced_native::tooltip::Position;
pub use iced_native::widget::tooltip::Position;

View file

@ -1,7 +1,7 @@
//! Write a graphics backend.
use iced_native::image;
use iced_native::svg;
use iced_native::text;
use iced_native::widget::image;
use iced_native::widget::svg;
use iced_native::widget::text;
use iced_native::{Font, Point, Size};
/// The graphics backend of a [`Renderer`].

View file

@ -1,6 +1,6 @@
use iced_native::{
image, svg, Background, Color, Font, Rectangle, Size, Vector,
};
use iced_native::widget::image;
use iced_native::widget::svg;
use iced_native::{Background, Color, Font, Rectangle, Size, Vector};
use crate::alignment;
use crate::triangle;

View file

@ -3,10 +3,10 @@
//! A [`Button`] has some local [`State`].
use crate::Renderer;
pub use iced_native::button::{State, Style, StyleSheet};
pub use iced_native::widget::button::{State, Style, StyleSheet};
/// A widget that produces a message when clicked.
///
/// This is an alias of an `iced_native` button with an `iced_wgpu::Renderer`.
pub type Button<'a, Message, Backend> =
iced_native::Button<'a, Message, Renderer<Backend>>;
iced_native::widget::Button<'a, Message, Renderer<Backend>>;

View file

@ -7,4 +7,4 @@ pub use iced_style::checkbox::{Style, StyleSheet};
///
/// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`.
pub type Checkbox<'a, Message, Backend> =
iced_native::Checkbox<'a, Message, Renderer<Backend>>;
iced_native::widget::Checkbox<'a, Message, Renderer<Backend>>;

View file

@ -2,4 +2,4 @@ use crate::Renderer;
/// A container that distributes its contents vertically.
pub type Column<'a, Message, Backend> =
iced_native::Column<'a, Message, Renderer<Backend>>;
iced_native::widget::Column<'a, Message, Renderer<Backend>>;

View file

@ -8,4 +8,4 @@ pub use iced_style::container::{Style, StyleSheet};
/// This is an alias of an `iced_native` container with a default
/// `Renderer`.
pub type Container<'a, Message, Backend> =
iced_native::Container<'a, Message, Renderer<Backend>>;
iced_native::widget::Container<'a, Message, Renderer<Backend>>;

View file

@ -4,9 +4,9 @@ pub mod viewer;
use crate::backend::{self, Backend};
use crate::{Primitive, Rectangle, Renderer};
use iced_native::image;
use iced_native::widget::image;
pub use iced_native::image::{Handle, Image, Viewer};
pub use iced_native::widget::image::{Handle, Image, Viewer};
impl<B> image::Renderer for Renderer<B>
where

View file

@ -1,2 +1,2 @@
//! Zoom and pan on an image.
pub use iced_native::image::Viewer;
pub use iced_native::widget::image::Viewer;

View file

@ -9,7 +9,7 @@
//! [`pane_grid` example]: https://github.com/hecrj/iced/tree/0.3/examples/pane_grid
use crate::Renderer;
pub use iced_native::pane_grid::{
pub use iced_native::widget::pane_grid::{
Axis, Configuration, Content, Direction, DragEvent, Node, Pane,
ResizeEvent, Split, State, TitleBar,
};
@ -23,4 +23,4 @@ pub use iced_style::pane_grid::{Line, StyleSheet};
///
/// This is an alias of an `iced_native` pane grid with an `iced_wgpu::Renderer`.
pub type PaneGrid<'a, Message, Backend> =
iced_native::PaneGrid<'a, Message, Renderer<Backend>>;
iced_native::widget::PaneGrid<'a, Message, Renderer<Backend>>;

View file

@ -1,9 +1,9 @@
//! Display a dropdown list of selectable values.
use crate::Renderer;
pub use iced_native::pick_list::State;
pub use iced_native::widget::pick_list::State;
pub use iced_style::pick_list::{Style, StyleSheet};
/// A widget allowing the selection of a single value from a list of options.
pub type PickList<'a, T, Message, Backend> =
iced_native::PickList<'a, T, Message, Renderer<Backend>>;
iced_native::widget::PickList<'a, T, Message, Renderer<Backend>>;

View file

@ -2,4 +2,4 @@
//!
//! A [`ProgressBar`] has a range of possible values and a current value,
//! as well as a length, height and style.
pub use iced_native::progress_bar::*;
pub use iced_native::widget::progress_bar::*;

View file

@ -8,4 +8,4 @@ pub use iced_style::radio::{Style, StyleSheet};
/// This is an alias of an `iced_native` radio button with an
/// `iced_wgpu::Renderer`.
pub type Radio<'a, Message, Backend> =
iced_native::Radio<'a, Message, Renderer<Backend>>;
iced_native::widget::Radio<'a, Message, Renderer<Backend>>;

View file

@ -2,4 +2,4 @@ use crate::Renderer;
/// A container that distributes its contents horizontally.
pub type Row<'a, Message, Backend> =
iced_native::Row<'a, Message, Renderer<Backend>>;
iced_native::widget::Row<'a, Message, Renderer<Backend>>;

View file

@ -1,3 +1,3 @@
//! Display a horizontal or vertical rule for dividing content.
pub use iced_native::rule::*;
pub use iced_native::widget::rule::*;

View file

@ -1,7 +1,7 @@
//! Navigate an endless amount of content with a scrollbar.
use crate::Renderer;
pub use iced_native::scrollable::State;
pub use iced_native::widget::scrollable::State;
pub use iced_style::scrollable::{Scrollbar, Scroller, StyleSheet};
/// A widget that can vertically display an infinite amount of content
@ -10,4 +10,4 @@ pub use iced_style::scrollable::{Scrollbar, Scroller, StyleSheet};
/// This is an alias of an `iced_native` scrollable with a default
/// `Renderer`.
pub type Scrollable<'a, Message, Backend> =
iced_native::Scrollable<'a, Message, Renderer<Backend>>;
iced_native::widget::Scrollable<'a, Message, Renderer<Backend>>;

View file

@ -1,5 +1,5 @@
//! Display an interactive selector of a single value from a range of values.
//!
//! A [`Slider`] has some local [`State`].
pub use iced_native::slider::{Slider, State};
pub use iced_native::widget::slider::{Slider, State};
pub use iced_style::slider::{Handle, HandleShape, Style, StyleSheet};

View file

@ -1 +1 @@
pub use iced_native::Space;
pub use iced_native::widget::Space;

View file

@ -1,9 +1,9 @@
//! Display vector graphics in your application.
use crate::backend::{self, Backend};
use crate::{Primitive, Rectangle, Renderer};
use iced_native::svg;
use iced_native::widget::svg;
pub use iced_native::svg::{Handle, Svg};
pub use iced_native::widget::svg::{Handle, Svg};
impl<B> svg::Renderer for Renderer<B>
where

View file

@ -4,4 +4,4 @@ use crate::Renderer;
/// A paragraph of text.
///
/// This is an alias of an `iced_native` text with an `iced_wgpu::Renderer`.
pub type Text<Backend> = iced_native::Text<Renderer<Backend>>;
pub type Text<Backend> = iced_native::widget::Text<Renderer<Backend>>;

View file

@ -3,11 +3,11 @@
//! A [`TextInput`] has some local [`State`].
use crate::Renderer;
pub use iced_native::text_input::State;
pub use iced_native::widget::text_input::State;
pub use iced_style::text_input::{Style, StyleSheet};
/// A field that can be filled with text.
///
/// This is an alias of an `iced_native` text input with an `iced_wgpu::Renderer`.
pub type TextInput<'a, Message, Backend> =
iced_native::TextInput<'a, Message, Renderer<Backend>>;
iced_native::widget::TextInput<'a, Message, Renderer<Backend>>;

View file

@ -7,4 +7,4 @@ pub use iced_style::toggler::{Style, StyleSheet};
///
/// This is an alias of an `iced_native` toggler with an `iced_wgpu::Renderer`.
pub type Toggler<Message, Backend> =
iced_native::Toggler<Message, Renderer<Backend>>;
iced_native::widget::Toggler<Message, Renderer<Backend>>;

View file

@ -6,6 +6,6 @@ use crate::Renderer;
/// This is an alias of an `iced_native` tooltip with a default
/// `Renderer`.
pub type Tooltip<'a, Message, Backend> =
iced_native::Tooltip<'a, Message, Renderer<Backend>>;
iced_native::widget::Tooltip<'a, Message, Renderer<Backend>>;
pub use iced_native::tooltip::Position;
pub use iced_native::widget::tooltip::Position;

View file

@ -80,7 +80,7 @@ where
///
/// ```
/// # mod counter {
/// # type Text = iced_native::Text<iced_native::renderer::Null>;
/// # type Text = iced_native::widget::Text<iced_native::renderer::Null>;
/// #
/// # #[derive(Debug, Clone, Copy)]
/// # pub enum Message {}
@ -107,7 +107,8 @@ where
/// # pub enum Message {
/// # Counter(usize, counter::Message)
/// # }
/// use iced_native::{Element, Row};
/// use iced_native::Element;
/// use iced_native::widget::Row;
/// use iced_wgpu::Renderer;
///
/// impl ManyCounters {

View file

@ -84,4 +84,4 @@ pub use renderer::Renderer;
pub use runtime::Runtime;
pub use subscription::Subscription;
pub use user_interface::{Cache, UserInterface};
pub use widget::*;
pub use widget::Widget;

View file

@ -6,11 +6,12 @@ use crate::mouse;
use crate::overlay;
use crate::renderer;
use crate::renderer::text;
use crate::scrollable;
use crate::touch;
use crate::widget::scrollable::{self, Scrollable};
use crate::widget::Container;
use crate::{
Clipboard, Color, Container, Element, Hasher, Layout, Length, Padding,
Point, Rectangle, Scrollable, Size, Vector, Widget,
Clipboard, Color, Element, Hasher, Layout, Length, Padding, Point,
Rectangle, Size, Vector, Widget,
};
pub use iced_style::menu::Style;

View file

@ -1,5 +1,5 @@
use crate::renderer::{self, Renderer};
use crate::text;
use crate::widget::text;
use crate::{Font, Point, Rectangle, Size, Vector};
/// A renderer that does nothing.

View file

@ -1,7 +1,7 @@
use crate::alignment;
use crate::{Color, Point, Rectangle, Renderer, Size};
pub use crate::text::Hit;
pub use crate::widget::text::Hit;
pub trait Text: Renderer {
/// The font type used.

View file

@ -49,7 +49,7 @@ where
/// # pub use iced_native::renderer::Null as Renderer;
/// # }
/// #
/// # use iced_native::Column;
/// # use iced_native::widget::Column;
/// #
/// # pub struct Counter;
/// #
@ -143,7 +143,7 @@ where
/// # pub use iced_native::renderer::Null as Renderer;
/// # }
/// #
/// # use iced_native::Column;
/// # use iced_native::widget::Column;
/// #
/// # pub struct Counter;
/// #
@ -279,7 +279,7 @@ where
/// # pub use iced_native::renderer::Null as Renderer;
/// # }
/// #
/// # use iced_native::Column;
/// # use iced_native::widget::Column;
/// #
/// # pub struct Counter;
/// #

View file

@ -10,14 +10,6 @@
//! [`Widget`] trait. You can use the API of the built-in widgets as a guide or
//! source of inspiration.
//!
//! # Re-exports
//! For convenience, the contents of this module are available at the root
//! module. Therefore, you can directly type:
//!
//! ```
//! use iced_native::{button, Button, Widget};
//! ```
//!
//! [renderer]: crate::renderer
pub mod button;
pub mod checkbox;

View file

@ -19,10 +19,10 @@ pub use iced_style::button::{Style, StyleSheet};
/// A generic widget that produces a message when pressed.
///
/// ```
/// # use iced_native::{button, Text};
/// # use iced_native::widget::{button, Text};
/// #
/// # type Button<'a, Message> =
/// # iced_native::Button<'a, Message, iced_native::renderer::Null>;
/// # iced_native::widget::Button<'a, Message, iced_native::renderer::Null>;
/// #
/// #[derive(Clone)]
/// enum Message {
@ -38,10 +38,10 @@ pub use iced_style::button::{Style, StyleSheet};
/// be disabled:
///
/// ```
/// # use iced_native::{button, Text};
/// # use iced_native::widget::{button, Text};
/// #
/// # type Button<'a, Message> =
/// # iced_native::Button<'a, Message, iced_native::renderer::Null>;
/// # iced_native::widget::Button<'a, Message, iced_native::renderer::Null>;
/// #
/// #[derive(Clone)]
/// enum Message {

View file

@ -6,11 +6,12 @@ use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
use crate::renderer;
use crate::text;
use crate::touch;
use crate::widget::text;
use crate::widget::{Row, Text};
use crate::{
Alignment, Clipboard, Color, Element, Hasher, Layout, Length, Point,
Rectangle, Row, Text, Widget,
Rectangle, Widget,
};
pub use iced_style::checkbox::{Style, StyleSheet};
@ -20,7 +21,7 @@ pub use iced_style::checkbox::{Style, StyleSheet};
/// # Example
///
/// ```
/// # type Checkbox<'a, Message> = iced_native::Checkbox<'a, Message, iced_native::renderer::Null>;
/// # type Checkbox<'a, Message> = iced_native::widget::Checkbox<'a, Message, iced_native::renderer::Null>;
/// #
/// pub enum Message {
/// CheckboxToggled(bool),

View file

@ -17,7 +17,7 @@ use std::{
/// # Example
///
/// ```
/// # use iced_native::Image;
/// # use iced_native::widget::Image;
/// #
/// let image = Image::new("resources/ferris.png");
/// ```

View file

@ -1,9 +1,9 @@
//! Zoom and pan on an image.
use crate::event::{self, Event};
use crate::image;
use crate::layout;
use crate::mouse;
use crate::renderer;
use crate::widget::image;
use crate::{
Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Size, Vector,
Widget,

View file

@ -62,10 +62,10 @@ pub use iced_style::pane_grid::{Line, StyleSheet};
/// ## Example
///
/// ```
/// # use iced_native::{pane_grid, Text};
/// # use iced_native::widget::{pane_grid, Text};
/// #
/// # type PaneGrid<'a, Message> =
/// # iced_native::PaneGrid<'a, Message, iced_native::renderer::Null>;
/// # iced_native::widget::PaneGrid<'a, Message, iced_native::renderer::Null>;
/// #
/// enum PaneState {
/// SomePane,

View file

@ -1,4 +1,4 @@
use crate::pane_grid::Axis;
use crate::widget::pane_grid::Axis;
/// The arrangement of a [`PaneGrid`].
///

View file

@ -1,10 +1,10 @@
use crate::container;
use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
use crate::overlay;
use crate::pane_grid::TitleBar;
use crate::renderer;
use crate::widget::container;
use crate::widget::pane_grid::TitleBar;
use crate::{Clipboard, Element, Hasher, Layout, Point, Rectangle, Size};
/// The content of a [`Pane`].

View file

@ -1,7 +1,5 @@
use crate::{
pane_grid::{Axis, Pane, Split},
Rectangle, Size,
};
use crate::widget::pane_grid::{Axis, Pane, Split};
use crate::{Rectangle, Size};
use std::collections::BTreeMap;

View file

@ -1,7 +1,7 @@
use crate::{
pane_grid::{Axis, Configuration, Direction, Node, Pane, Split},
Hasher, Point, Rectangle, Size,
use crate::widget::pane_grid::{
Axis, Configuration, Direction, Node, Pane, Split,
};
use crate::{Hasher, Point, Rectangle, Size};
use std::collections::{BTreeMap, HashMap};

View file

@ -1,9 +1,9 @@
use crate::container;
use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
use crate::overlay;
use crate::renderer;
use crate::widget::container;
use crate::{
Clipboard, Element, Hasher, Layout, Padding, Point, Rectangle, Size,
};

View file

@ -13,7 +13,7 @@ pub use iced_style::progress_bar::{Style, StyleSheet};
///
/// # Example
/// ```
/// # use iced_native::ProgressBar;
/// # use iced_native::widget::ProgressBar;
/// let value = 50.0;
///
/// ProgressBar::new(0.0..=100.0, value);

View file

@ -6,11 +6,12 @@ use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
use crate::renderer;
use crate::text;
use crate::touch;
use crate::widget::text;
use crate::widget::{Row, Text};
use crate::{
Alignment, Background, Clipboard, Color, Element, Hasher, Layout, Length,
Point, Rectangle, Row, Text, Widget,
Point, Rectangle, Widget,
};
pub use iced_style::radio::{Style, StyleSheet};
@ -20,7 +21,7 @@ pub use iced_style::radio::{Style, StyleSheet};
/// # Example
/// ```
/// # type Radio<'a, Message> =
/// # iced_native::Radio<'a, Message, iced_native::renderer::Null>;
/// # iced_native::widget::Radio<'a, Message, iced_native::renderer::Null>;
/// #
/// #[derive(Debug, Clone, Copy, PartialEq, Eq)]
/// pub enum Choice {

View file

@ -5,9 +5,10 @@ use crate::mouse;
use crate::overlay;
use crate::renderer;
use crate::touch;
use crate::widget::Column;
use crate::{
Alignment, Background, Clipboard, Color, Column, Element, Hasher, Layout,
Length, Padding, Point, Rectangle, Size, Vector, Widget,
Alignment, Background, Clipboard, Color, Element, Hasher, Layout, Length,
Padding, Point, Rectangle, Size, Vector, Widget,
};
use std::{f32, hash::Hash, u32};

View file

@ -26,7 +26,7 @@ pub use iced_style::slider::{Handle, HandleShape, Style, StyleSheet};
///
/// # Example
/// ```
/// # use iced_native::slider::{self, Slider};
/// # use iced_native::widget::slider::{self, Slider};
/// #
/// #[derive(Clone)]
/// pub enum Message {

View file

@ -15,7 +15,7 @@ use std::hash::Hash;
/// # Example
///
/// ```
/// # type Text = iced_native::Text<iced_native::renderer::Null>;
/// # type Text = iced_native::widget::Text<iced_native::renderer::Null>;
/// #
/// Text::new("I <3 iced!")
/// .color([0.0, 0.0, 1.0])

View file

@ -31,9 +31,10 @@ pub use iced_style::text_input::{Style, StyleSheet};
///
/// # Example
/// ```
/// # use iced_native::{text_input, renderer::Null};
/// # use iced_native::renderer::Null;
/// # use iced_native::widget::text_input;
/// #
/// # pub type TextInput<'a, Message> = iced_native::TextInput<'a, Message, Null>;
/// # pub type TextInput<'a, Message> = iced_native::widget::TextInput<'a, Message, Null>;
/// #[derive(Debug, Clone)]
/// enum Message {
/// TextInputChanged(String),

View file

@ -1,4 +1,4 @@
use crate::text_input::{Cursor, Value};
use crate::widget::text_input::{Cursor, Value};
pub struct Editor<'a> {
value: &'a mut Value,

View file

@ -7,9 +7,10 @@ use crate::layout;
use crate::mouse;
use crate::renderer;
use crate::widget::text;
use crate::widget::{Row, Text};
use crate::{
Alignment, Clipboard, Element, Event, Hasher, Layout, Length, Point,
Rectangle, Row, Text, Widget,
Rectangle, Widget,
};
pub use iced_style::toggler::{Style, StyleSheet};
@ -19,7 +20,7 @@ pub use iced_style::toggler::{Style, StyleSheet};
/// # Example
///
/// ```
/// # type Toggler<Message> = iced_native::Toggler<Message, iced_native::renderer::Null>;
/// # type Toggler<Message> = iced_native::widget::Toggler<Message, iced_native::renderer::Null>;
/// #
/// pub enum Message {
/// TogglerToggled(bool),

View file

@ -38,14 +38,14 @@ mod platform {
#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
pub mod image {
//! Display images in your user interface.
pub use crate::runtime::image::viewer;
pub use crate::runtime::image::{Handle, Image, Viewer};
pub use crate::runtime::widget::image::viewer;
pub use crate::runtime::widget::image::{Handle, Image, Viewer};
}
#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
pub mod svg {
//! Display vector graphics in your user interface.
pub use crate::runtime::svg::{Handle, Svg};
pub use crate::runtime::widget::svg::{Handle, Svg};
}
#[doc(no_inline)]

View file

@ -302,7 +302,10 @@ impl backend::Text for Backend {
#[cfg(feature = "image_rs")]
impl backend::Image for Backend {
fn dimensions(&self, handle: &iced_native::image::Handle) -> (u32, u32) {
fn dimensions(
&self,
handle: &iced_native::widget::image::Handle,
) -> (u32, u32) {
self.image_pipeline.dimensions(handle)
}
}
@ -311,7 +314,7 @@ impl backend::Image for Backend {
impl backend::Svg for Backend {
fn viewport_dimensions(
&self,
handle: &iced_native::svg::Handle,
handle: &iced_native::widget::svg::Handle,
) -> (u32, u32) {
self.image_pipeline.viewport_dimensions(handle)
}

View file

@ -17,10 +17,10 @@ use std::mem;
use bytemuck::{Pod, Zeroable};
#[cfg(feature = "image_rs")]
use iced_native::image;
use iced_native::widget::image;
#[cfg(feature = "svg")]
use iced_native::svg;
use iced_native::widget::svg;
#[derive(Debug)]
pub struct Pipeline {

View file

@ -1,5 +1,5 @@
use crate::image::atlas::{self, Atlas};
use iced_native::image;
use iced_native::widget::image;
use std::collections::{HashMap, HashSet};
use bitflags::bitflags;

View file

@ -1,6 +1,6 @@
use crate::image::atlas::{self, Atlas};
use iced_native::svg;
use iced_native::widget::svg;
use std::collections::{HashMap, HashSet};
use std::fs;

View file

@ -5,7 +5,7 @@ use iced_graphics::font;
use std::{cell::RefCell, collections::HashMap};
use wgpu_glyph::ab_glyph;
pub use iced_native::text::Hit;
pub use iced_native::widget::text::Hit;
#[derive(Debug)]
pub struct Pipeline {

View file

@ -66,13 +66,14 @@ pub mod qr_code;
#[doc(no_inline)]
pub use qr_code::QRCode;
pub use iced_native::Space;
pub use iced_native::widget::Space;
/// A container that distributes its contents vertically.
pub type Column<'a, Message> = iced_native::Column<'a, Message, Renderer>;
pub type Column<'a, Message> =
iced_native::widget::Column<'a, Message, Renderer>;
/// A container that distributes its contents horizontally.
pub type Row<'a, Message> = iced_native::Row<'a, Message, Renderer>;
pub type Row<'a, Message> = iced_native::widget::Row<'a, Message, Renderer>;
/// A paragraph of text.
pub type Text = iced_native::Text<Renderer>;
pub type Text = iced_native::widget::Text<Renderer>;

View file

@ -4,9 +4,10 @@
use crate::Renderer;
pub use iced_graphics::button::{Style, StyleSheet};
pub use iced_native::button::State;
pub use iced_native::widget::button::State;
/// A widget that produces a message when clicked.
///
/// This is an alias of an `iced_native` button with an `iced_wgpu::Renderer`.
pub type Button<'a, Message> = iced_native::Button<'a, Message, Renderer>;
pub type Button<'a, Message> =
iced_native::widget::Button<'a, Message, Renderer>;

View file

@ -6,4 +6,5 @@ pub use iced_graphics::checkbox::{Style, StyleSheet};
/// A box that can be checked.
///
/// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`.
pub type Checkbox<'a, Message> = iced_native::Checkbox<'a, Message, Renderer>;
pub type Checkbox<'a, Message> =
iced_native::widget::Checkbox<'a, Message, Renderer>;

View file

@ -7,4 +7,5 @@ pub use iced_graphics::container::{Style, StyleSheet};
///
/// This is an alias of an `iced_native` container with a default
/// `Renderer`.
pub type Container<'a, Message> = iced_native::Container<'a, Message, Renderer>;
pub type Container<'a, Message> =
iced_native::widget::Container<'a, Message, Renderer>;

View file

@ -20,12 +20,13 @@ pub use iced_graphics::pane_grid::{
/// [![Pane grid - Iced](https://thumbs.gfycat.com/MixedFlatJellyfish-small.gif)](https://gfycat.com/mixedflatjellyfish)
///
/// This is an alias of an `iced_native` pane grid with an `iced_wgpu::Renderer`.
pub type PaneGrid<'a, Message> = iced_native::PaneGrid<'a, Message, Renderer>;
pub type PaneGrid<'a, Message> =
iced_native::widget::PaneGrid<'a, Message, Renderer>;
/// The content of a [`Pane`].
pub type Content<'a, Message> =
iced_native::pane_grid::Content<'a, Message, Renderer>;
iced_native::widget::pane_grid::Content<'a, Message, Renderer>;
/// The title bar of a [`Pane`].
pub type TitleBar<'a, Message> =
iced_native::pane_grid::TitleBar<'a, Message, Renderer>;
iced_native::widget::pane_grid::TitleBar<'a, Message, Renderer>;

View file

@ -1,9 +1,9 @@
//! Display a dropdown list of selectable values.
pub use iced_native::pick_list::State;
pub use iced_native::widget::pick_list::State;
pub use iced_graphics::overlay::menu::Style as Menu;
pub use iced_graphics::pick_list::{Style, StyleSheet};
/// A widget allowing the selection of a single value from a list of options.
pub type PickList<'a, T, Message> =
iced_native::PickList<'a, T, Message, crate::Renderer>;
iced_native::widget::PickList<'a, T, Message, crate::Renderer>;

View file

@ -7,4 +7,4 @@ pub use iced_graphics::radio::{Style, StyleSheet};
///
/// This is an alias of an `iced_native` radio button with an
/// `iced_wgpu::Renderer`.
pub type Radio<'a, Message> = iced_native::Radio<'a, Message, Renderer>;
pub type Radio<'a, Message> = iced_native::widget::Radio<'a, Message, Renderer>;

View file

@ -2,7 +2,7 @@
use crate::Renderer;
pub use iced_graphics::scrollable::{Scrollbar, Scroller, StyleSheet};
pub use iced_native::scrollable::State;
pub use iced_native::widget::scrollable::State;
/// A widget that can vertically display an infinite amount of content
/// with a scrollbar.
@ -10,4 +10,4 @@ pub use iced_native::scrollable::State;
/// This is an alias of an `iced_native` scrollable with a default
/// `Renderer`.
pub type Scrollable<'a, Message> =
iced_native::Scrollable<'a, Message, Renderer>;
iced_native::widget::Scrollable<'a, Message, Renderer>;

View file

@ -2,4 +2,4 @@
//!
//! A [`Slider`] has some local [`State`].
pub use iced_graphics::slider::{Handle, HandleShape, Style, StyleSheet};
pub use iced_native::slider::{Slider, State};
pub use iced_native::widget::slider::{Slider, State};

View file

@ -4,9 +4,10 @@
use crate::Renderer;
pub use iced_graphics::text_input::{Style, StyleSheet};
pub use iced_native::text_input::State;
pub use iced_native::widget::text_input::State;
/// A field that can be filled with text.
///
/// This is an alias of an `iced_native` text input with an `iced_wgpu::Renderer`.
pub type TextInput<'a, Message> = iced_native::TextInput<'a, Message, Renderer>;
pub type TextInput<'a, Message> =
iced_native::widget::TextInput<'a, Message, Renderer>;

View file

@ -6,4 +6,4 @@ pub use iced_graphics::toggler::{Style, StyleSheet};
/// A toggler that can be toggled
///
/// This is an alias of an `iced_native` toggler with an `iced_wgpu::Renderer`.
pub type Toggler<Message> = iced_native::Toggler<Message, Renderer>;
pub type Toggler<Message> = iced_native::widget::Toggler<Message, Renderer>;

View file

@ -1,6 +1,6 @@
//! Display a widget over another.
/// A widget allowing the selection of a single value from a list of options.
pub type Tooltip<'a, Message> =
iced_native::Tooltip<'a, Message, crate::Renderer>;
iced_native::widget::Tooltip<'a, Message, crate::Renderer>;
pub use iced_native::tooltip::Position;
pub use iced_native::widget::tooltip::Position;