Remove widget module re-exports in iced_native
This commit is contained in:
parent
e5e477aa69
commit
0aafcde0ef
81 changed files with 166 additions and 154 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/// #
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use std::{
|
|||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// # use iced_native::Image;
|
||||
/// # use iced_native::widget::Image;
|
||||
/// #
|
||||
/// let image = Image::new("resources/ferris.png");
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::pane_grid::Axis;
|
||||
use crate::widget::pane_grid::Axis;
|
||||
|
||||
/// The arrangement of a [`PaneGrid`].
|
||||
///
|
||||
|
|
|
|||
|
|
@ -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`].
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue