diff options
author | 2023-04-11 05:53:22 +0200 | |
---|---|---|
committer | 2023-04-11 05:53:22 +0200 | |
commit | 57265ff211e8d040dce2a13e71409bdd6482204c (patch) | |
tree | 265a41fa4d6ab6aea961ed076be46f8afe1156ed | |
parent | 870b2fe513bd5b3fbcf3ba369afb14d68324aaa2 (diff) | |
download | iced-57265ff211e8d040dce2a13e71409bdd6482204c.tar.gz iced-57265ff211e8d040dce2a13e71409bdd6482204c.tar.bz2 iced-57265ff211e8d040dce2a13e71409bdd6482204c.zip |
Move `Icon` definitions after `Widget` implementation
Diffstat (limited to '')
-rw-r--r-- | native/src/widget/checkbox.rs | 22 | ||||
-rw-r--r-- | native/src/widget/text_input.rs | 48 |
2 files changed, 35 insertions, 35 deletions
diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index 9b69e574..ad05a8e7 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -14,17 +14,6 @@ use crate::{ pub use iced_style::checkbox::{Appearance, StyleSheet}; -/// The icon in a [`Checkbox`]. -#[derive(Debug, Clone, PartialEq)] -pub struct Icon<Font> { - /// Font that will be used to display the `code_point`, - pub font: Font, - /// The unicode code point that will be used as the icon. - pub code_point: char, - /// Font size of the content. - pub size: Option<f32>, -} - /// A box that can be checked. /// /// # Example @@ -319,3 +308,14 @@ where Element::new(checkbox) } } + +/// The icon in a [`Checkbox`]. +#[derive(Debug, Clone, PartialEq)] +pub struct Icon<Font> { + /// Font that will be used to display the `code_point`, + pub font: Font, + /// The unicode code point that will be used as the icon. + pub code_point: char, + /// Font size of the content. + pub size: Option<f32>, +} diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index a7fdcb1c..c43b735c 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -31,30 +31,6 @@ use crate::{ pub use iced_style::text_input::{Appearance, StyleSheet}; -/// The position of the [`Icon`]. -#[derive(Debug, Clone)] -pub enum IconPosition { - /// Position the [`Icon`] to the left. - Left, - /// Position the [`Icon`] to the right. - Right, -} - -/// The content of the [`Icon`]. -#[derive(Debug, Clone)] -pub struct Icon<Font> { - /// Font that will be used to display the `code_point`. - pub font: Font, - /// The unicode code point that will be used as the icon. - pub code_point: char, - /// Font size of the content. - pub size: Option<f32>, - /// The spacing between the [`Icon`] and the text in a [`TextInput`]. - pub spacing: f32, - /// Position of the icon. - pub position: IconPosition, -} - /// A field that can be filled with text. /// /// # Example @@ -360,6 +336,30 @@ where } } +/// The content of the [`Icon`]. +#[derive(Debug, Clone)] +pub struct Icon<Font> { + /// The font that will be used to display the `code_point`. + pub font: Font, + /// The unicode code point that will be used as the icon. + pub code_point: char, + /// The font size of the content. + pub size: Option<f32>, + /// The spacing between the [`Icon`] and the text in a [`TextInput`]. + pub spacing: f32, + /// The position of the icon. + pub position: IconPosition, +} + +/// The position of an [`Icon`]. +#[derive(Debug, Clone)] +pub enum IconPosition { + /// Position the [`Icon`] on the left side of a [`TextInput`]. + Left, + /// Position the [`Icon`] on the right side of a [`TextInput`]. + Right, +} + /// The identifier of a [`TextInput`]. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Id(widget::Id); |