summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-06 23:58:15 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-06 23:58:15 +0200
commitdfeb3db003d724a1c980329dab9cbfae55b7f589 (patch)
treeb23c83af87ffa59770971eafbc2843e1053f1adc /native/src/widget
parent946bbd26835fef21b770c1ae56921fb4d8512287 (diff)
downloadiced-dfeb3db003d724a1c980329dab9cbfae55b7f589.tar.gz
iced-dfeb3db003d724a1c980329dab9cbfae55b7f589.tar.bz2
iced-dfeb3db003d724a1c980329dab9cbfae55b7f589.zip
Use `default_font_size` for `TextInput` widget
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/text_input.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index 24085606..3f415101 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -17,8 +17,8 @@ use editor::Editor;
use crate::{
keyboard, layout,
mouse::{self, click},
- Clipboard, Element, Event, Hasher, Layout, Length, Point, Rectangle, Size,
- Widget,
+ text, Clipboard, Element, Event, Hasher, Layout, Length, Point, Rectangle,
+ Size, Widget,
};
use std::u32;
@@ -486,7 +486,8 @@ where
let text_bounds = layout.children().next().unwrap().bounds();
if self.is_secure {
- renderer.draw(
+ self::Renderer::draw(
+ renderer,
bounds,
text_bounds,
cursor_position,
@@ -498,7 +499,8 @@ where
&self.style,
)
} else {
- renderer.draw(
+ self::Renderer::draw(
+ renderer,
bounds,
text_bounds,
cursor_position,
@@ -531,20 +533,10 @@ where
///
/// [`TextInput`]: struct.TextInput.html
/// [renderer]: ../../renderer/index.html
-pub trait Renderer: crate::Renderer + Sized {
- /// The font type used for [`TextInput`].
- ///
- /// [`TextInput`]: struct.TextInput.html
- type Font: Default + Copy;
-
+pub trait Renderer: text::Renderer + Sized {
/// The style supported by this renderer.
type Style: Default;
- /// Returns the default size of the text of the [`TextInput`].
- ///
- /// [`TextInput`]: struct.TextInput.html
- fn default_size(&self) -> u16;
-
/// Returns the width of the value of the [`TextInput`].
///
/// [`TextInput`]: struct.TextInput.html