Move Icon definitions after Widget implementation
This commit is contained in:
parent
870b2fe513
commit
57265ff211
2 changed files with 35 additions and 35 deletions
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue