Derive Debug for text_input::Icon
This commit is contained in:
parent
9852b4b364
commit
870b2fe513
1 changed files with 3 additions and 19 deletions
|
|
@ -32,19 +32,16 @@ use crate::{
|
||||||
pub use iced_style::text_input::{Appearance, StyleSheet};
|
pub use iced_style::text_input::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// The position of the [`Icon`].
|
/// The position of the [`Icon`].
|
||||||
#[derive(Clone, Default, Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum IconPosition {
|
pub enum IconPosition {
|
||||||
/// Position the [`Icon`] to the left.
|
/// Position the [`Icon`] to the left.
|
||||||
Left,
|
Left,
|
||||||
/// Position the [`Icon`] to the left.
|
/// Position the [`Icon`] to the right.
|
||||||
///
|
|
||||||
/// This is the default.
|
|
||||||
#[default]
|
|
||||||
Right,
|
Right,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The content of the [`Icon`].
|
/// The content of the [`Icon`].
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Icon<Font> {
|
pub struct Icon<Font> {
|
||||||
/// Font that will be used to display the `code_point`.
|
/// Font that will be used to display the `code_point`.
|
||||||
pub font: Font,
|
pub font: Font,
|
||||||
|
|
@ -58,19 +55,6 @@ pub struct Icon<Font> {
|
||||||
pub position: IconPosition,
|
pub position: IconPosition,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Renderer> std::fmt::Debug for Icon<Renderer>
|
|
||||||
where
|
|
||||||
Renderer: text::Renderer,
|
|
||||||
{
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
f.debug_struct("Icon")
|
|
||||||
.field("code_point", &self.code_point)
|
|
||||||
.field("size", &self.size)
|
|
||||||
.field("position", &self.position)
|
|
||||||
.finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A field that can be filled with text.
|
/// A field that can be filled with text.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue