summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 15:35:12 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:14:34 +0700
commit0aafcde0ef1533c9eeba0379de8c0082e30c7504 (patch)
treeec1a6e47a5f97f9893da58ed276c71f8c93f305c /native/src
parente5e477aa692e33eb639e4d3acbc073fdb47f9c9a (diff)
downloadiced-0aafcde0ef1533c9eeba0379de8c0082e30c7504.tar.gz
iced-0aafcde0ef1533c9eeba0379de8c0082e30c7504.tar.bz2
iced-0aafcde0ef1533c9eeba0379de8c0082e30c7504.zip
Remove `widget` module re-exports in `iced_native`
Diffstat (limited to 'native/src')
-rw-r--r--native/src/element.rs5
-rw-r--r--native/src/lib.rs2
-rw-r--r--native/src/overlay/menu.rs7
-rw-r--r--native/src/renderer/null.rs2
-rw-r--r--native/src/renderer/text.rs2
-rw-r--r--native/src/user_interface.rs6
-rw-r--r--native/src/widget.rs8
-rw-r--r--native/src/widget/button.rs8
-rw-r--r--native/src/widget/checkbox.rs7
-rw-r--r--native/src/widget/image.rs2
-rw-r--r--native/src/widget/image/viewer.rs2
-rw-r--r--native/src/widget/pane_grid.rs4
-rw-r--r--native/src/widget/pane_grid/configuration.rs2
-rw-r--r--native/src/widget/pane_grid/content.rs4
-rw-r--r--native/src/widget/pane_grid/node.rs6
-rw-r--r--native/src/widget/pane_grid/state.rs6
-rw-r--r--native/src/widget/pane_grid/title_bar.rs2
-rw-r--r--native/src/widget/progress_bar.rs2
-rw-r--r--native/src/widget/radio.rs7
-rw-r--r--native/src/widget/scrollable.rs5
-rw-r--r--native/src/widget/slider.rs2
-rw-r--r--native/src/widget/text.rs2
-rw-r--r--native/src/widget/text_input.rs5
-rw-r--r--native/src/widget/text_input/editor.rs2
-rw-r--r--native/src/widget/toggler.rs5
25 files changed, 51 insertions, 54 deletions
diff --git a/native/src/element.rs b/native/src/element.rs
index d69b24fc..f4ae88b5 100644
--- a/native/src/element.rs
+++ b/native/src/element.rs
@@ -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 {
diff --git a/native/src/lib.rs b/native/src/lib.rs
index 55265fbf..f11f7d96 100644
--- a/native/src/lib.rs
+++ b/native/src/lib.rs
@@ -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;
diff --git a/native/src/overlay/menu.rs b/native/src/overlay/menu.rs
index 1ba953f3..646d5133 100644
--- a/native/src/overlay/menu.rs
+++ b/native/src/overlay/menu.rs
@@ -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;
diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs
index dbd3a820..e57841f4 100644
--- a/native/src/renderer/null.rs
+++ b/native/src/renderer/null.rs
@@ -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.
diff --git a/native/src/renderer/text.rs b/native/src/renderer/text.rs
index fbf116a1..fc1a2c66 100644
--- a/native/src/renderer/text.rs
+++ b/native/src/renderer/text.rs
@@ -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.
diff --git a/native/src/user_interface.rs b/native/src/user_interface.rs
index ac7fa367..a25fb0c4 100644
--- a/native/src/user_interface.rs
+++ b/native/src/user_interface.rs
@@ -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;
/// #
diff --git a/native/src/widget.rs b/native/src/widget.rs
index 9999701e..6a2bbfbd 100644
--- a/native/src/widget.rs
+++ b/native/src/widget.rs
@@ -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;
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs
index a654cf12..a577fe84 100644
--- a/native/src/widget/button.rs
+++ b/native/src/widget/button.rs
@@ -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 {
diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs
index 83bc2aa3..b81a444e 100644
--- a/native/src/widget/checkbox.rs
+++ b/native/src/widget/checkbox.rs
@@ -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),
diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs
index b87c0aab..d23d393a 100644
--- a/native/src/widget/image.rs
+++ b/native/src/widget/image.rs
@@ -17,7 +17,7 @@ use std::{
/// # Example
///
/// ```
-/// # use iced_native::Image;
+/// # use iced_native::widget::Image;
/// #
/// let image = Image::new("resources/ferris.png");
/// ```
diff --git a/native/src/widget/image/viewer.rs b/native/src/widget/image/viewer.rs
index d9eccfad..d3c794a7 100644
--- a/native/src/widget/image/viewer.rs
+++ b/native/src/widget/image/viewer.rs
@@ -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,
diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs
index 5f0e73e4..22c18c05 100644
--- a/native/src/widget/pane_grid.rs
+++ b/native/src/widget/pane_grid.rs
@@ -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,
diff --git a/native/src/widget/pane_grid/configuration.rs b/native/src/widget/pane_grid/configuration.rs
index 4c43826e..4c52bad4 100644
--- a/native/src/widget/pane_grid/configuration.rs
+++ b/native/src/widget/pane_grid/configuration.rs
@@ -1,4 +1,4 @@
-use crate::pane_grid::Axis;
+use crate::widget::pane_grid::Axis;
/// The arrangement of a [`PaneGrid`].
///
diff --git a/native/src/widget/pane_grid/content.rs b/native/src/widget/pane_grid/content.rs
index ddc659cc..83d96917 100644
--- a/native/src/widget/pane_grid/content.rs
+++ b/native/src/widget/pane_grid/content.rs
@@ -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`].
diff --git a/native/src/widget/pane_grid/node.rs b/native/src/widget/pane_grid/node.rs
index 84714e00..af6573a0 100644
--- a/native/src/widget/pane_grid/node.rs
+++ b/native/src/widget/pane_grid/node.rs
@@ -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;
diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs
index fb96f89f..bcc724a8 100644
--- a/native/src/widget/pane_grid/state.rs
+++ b/native/src/widget/pane_grid/state.rs
@@ -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};
diff --git a/native/src/widget/pane_grid/title_bar.rs b/native/src/widget/pane_grid/title_bar.rs
index 493c74db..2d66ba6c 100644
--- a/native/src/widget/pane_grid/title_bar.rs
+++ b/native/src/widget/pane_grid/title_bar.rs
@@ -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,
};
diff --git a/native/src/widget/progress_bar.rs b/native/src/widget/progress_bar.rs
index 9e857226..48bf485e 100644
--- a/native/src/widget/progress_bar.rs
+++ b/native/src/widget/progress_bar.rs
@@ -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);
diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs
index 5601a597..91de8be5 100644
--- a/native/src/widget/radio.rs
+++ b/native/src/widget/radio.rs
@@ -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 {
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 4b514818..781fe73e 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -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};
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs
index 60124160..977a5240 100644
--- a/native/src/widget/slider.rs
+++ b/native/src/widget/slider.rs
@@ -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 {
diff --git a/native/src/widget/text.rs b/native/src/widget/text.rs
index 2432dbc8..563ab8c4 100644
--- a/native/src/widget/text.rs
+++ b/native/src/widget/text.rs
@@ -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])
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index c2950db9..5d67ddfe 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -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),
diff --git a/native/src/widget/text_input/editor.rs b/native/src/widget/text_input/editor.rs
index 0b50a382..bac530e1 100644
--- a/native/src/widget/text_input/editor.rs
+++ b/native/src/widget/text_input/editor.rs
@@ -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,
diff --git a/native/src/widget/toggler.rs b/native/src/widget/toggler.rs
index a11d0307..20cfea74 100644
--- a/native/src/widget/toggler.rs
+++ b/native/src/widget/toggler.rs
@@ -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),