Move Icon definitions after Widget implementation

This commit is contained in:
Héctor Ramón Jiménez 2023-04-11 05:53:22 +02:00
parent 870b2fe513
commit 57265ff211
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 35 additions and 35 deletions

View file

@ -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>,
}

View file

@ -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);