summaryrefslogtreecommitdiffstats
path: root/native/src/widget/text_input.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-11 05:54:51 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-11 05:54:51 +0200
commitcf9d8e01048845ee503a62eb55e634a76a0e9163 (patch)
tree136a26d73fc28a24c6d4bc3beddfb9fd3f9128a9 /native/src/widget/text_input.rs
parent57265ff211e8d040dce2a13e71409bdd6482204c (diff)
downloadiced-cf9d8e01048845ee503a62eb55e634a76a0e9163.tar.gz
iced-cf9d8e01048845ee503a62eb55e634a76a0e9163.tar.bz2
iced-cf9d8e01048845ee503a62eb55e634a76a0e9163.zip
Rename `IconPosition` to `Side` in `text_input`
Diffstat (limited to 'native/src/widget/text_input.rs')
-rw-r--r--native/src/widget/text_input.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index c43b735c..bb397645 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -347,16 +347,16 @@ pub struct Icon<Font> {
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 side of a [`TextInput`] where to display the [`Icon`].
+ pub side: Side,
}
-/// The position of an [`Icon`].
+/// The side of a [`TextInput`].
#[derive(Debug, Clone)]
-pub enum IconPosition {
- /// Position the [`Icon`] on the left side of a [`TextInput`].
+pub enum Side {
+ /// The left side of a [`TextInput`].
Left,
- /// Position the [`Icon`] on the right side of a [`TextInput`].
+ /// The right side of a [`TextInput`].
Right,
}
@@ -448,8 +448,8 @@ where
let mut icon_node =
layout::Node::new(Size::new(icon_width, text_bounds.height));
- match icon.position {
- IconPosition::Left => {
+ match icon.side {
+ Side::Left => {
text_node.move_to(Point::new(
padding.left + icon_width + icon.spacing,
padding.top,
@@ -457,7 +457,7 @@ where
icon_node.move_to(Point::new(padding.left, padding.top));
}
- IconPosition::Right => {
+ Side::Right => {
text_node.move_to(Point::new(padding.left, padding.top));
icon_node.move_to(Point::new(