summaryrefslogtreecommitdiffstats
path: root/native/src/widget/text_input.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:22:29 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:24:11 +0700
commit023aded2772f0cd6abd716fe5c8624d5d22e21fa (patch)
tree1bdb1a4584d7acc688b081a299bb4431cd35c349 /native/src/widget/text_input.rs
parent343f9b7e2e594bd1fef1ed511d71e81f9c44e3d9 (diff)
downloadiced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.tar.gz
iced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.tar.bz2
iced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.zip
Rename `fill_rectangle` to `fill_quad` in `Renderer`
Diffstat (limited to 'native/src/widget/text_input.rs')
-rw-r--r--native/src/widget/text_input.rs76
1 files changed, 39 insertions, 37 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index db60b553..40c6c573 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -20,8 +20,8 @@ use crate::renderer;
use crate::text::{self, Text};
use crate::touch;
use crate::{
- Background, Clipboard, Color, Element, Hasher, Layout, Length, Padding,
- Point, Rectangle, Size, Vector, Widget,
+ Clipboard, Color, Element, Hasher, Layout, Length, Padding, Point,
+ Rectangle, Size, Vector, Widget,
};
use std::u32;
@@ -196,13 +196,15 @@ where
self.style_sheet.active()
};
- renderer.fill_rectangle(renderer::Quad {
- bounds,
- background: style.background,
- border_radius: style.border_radius,
- border_width: style.border_width,
- border_color: style.border_color,
- });
+ renderer.fill_quad(
+ renderer::Quad {
+ bounds,
+ border_radius: style.border_radius,
+ border_width: style.border_width,
+ border_color: style.border_color,
+ },
+ style.background,
+ );
let text = value.to_string();
let size = self.size.unwrap_or(renderer.default_size());
@@ -221,20 +223,20 @@ where
);
(
- Some(renderer::Quad {
- bounds: Rectangle {
- x: text_bounds.x + text_value_width,
- y: text_bounds.y,
- width: 1.0,
- height: text_bounds.height,
+ Some((
+ renderer::Quad {
+ bounds: Rectangle {
+ x: text_bounds.x + text_value_width,
+ y: text_bounds.y,
+ width: 1.0,
+ height: text_bounds.height,
+ },
+ border_radius: 0.0,
+ border_width: 0.0,
+ border_color: Color::TRANSPARENT,
},
- background: Background::Color(
- self.style_sheet.value_color(),
- ),
- border_radius: 0.0,
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
- }),
+ self.style_sheet.value_color(),
+ )),
offset,
)
}
@@ -265,20 +267,20 @@ where
let width = right_position - left_position;
(
- Some(renderer::Quad {
- bounds: Rectangle {
- x: text_bounds.x + left_position,
- y: text_bounds.y,
- width,
- height: text_bounds.height,
+ Some((
+ renderer::Quad {
+ bounds: Rectangle {
+ x: text_bounds.x + left_position,
+ y: text_bounds.y,
+ width,
+ height: text_bounds.height,
+ },
+ border_radius: 0.0,
+ border_width: 0.0,
+ border_color: Color::TRANSPARENT,
},
- background: Background::Color(
- self.style_sheet.selection_color(),
- ),
- border_radius: 0.0,
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
- }),
+ self.style_sheet.selection_color(),
+ )),
if end == right {
right_offset
} else {
@@ -302,8 +304,8 @@ where
);
let render = |renderer: &mut Renderer| {
- if let Some(cursor) = cursor {
- renderer.fill_rectangle(cursor);
+ if let Some((cursor, color)) = cursor {
+ renderer.fill_quad(cursor, color);
}
renderer.fill_text(Text {