diff --git a/iced/advanced/widget/operation/focusable/trait.Focusable.html b/iced/advanced/widget/operation/focusable/trait.Focusable.html index 856e1ffbb7b..e669854116d 100644 --- a/iced/advanced/widget/operation/focusable/trait.Focusable.html +++ b/iced/advanced/widget/operation/focusable/trait.Focusable.html @@ -8,5 +8,5 @@

Required Methods§

source

fn is_focused(&self) -> bool

Returns whether the widget is focused or not.

source

fn focus(&mut self)

Focuses the widget.

source

fn unfocus(&mut self)

Unfocuses the widget.

-

Implementors§

source§

impl<P> Focusable for State<P>
where +

Implementors§

source§

impl<P> Focusable for State<P>
where P: Paragraph,

\ No newline at end of file diff --git a/iced/advanced/widget/operation/text_input/trait.TextInput.html b/iced/advanced/widget/operation/text_input/trait.TextInput.html index 5b33470b9ea..a3b320a1e61 100644 --- a/iced/advanced/widget/operation/text_input/trait.TextInput.html +++ b/iced/advanced/widget/operation/text_input/trait.TextInput.html @@ -10,5 +10,5 @@
source

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.

source

fn move_cursor_to(&mut self, position: usize)

Moves the cursor of the text input to an arbitrary location.

source

fn select_all(&mut self)

Selects all the content of the text input.

-

Implementors§

source§

impl<P> TextInput for State<P>
where +

Implementors§

source§

impl<P> TextInput for State<P>
where P: Paragraph,

\ No newline at end of file diff --git a/iced/advanced/widget/operation/trait.Focusable.html b/iced/advanced/widget/operation/trait.Focusable.html index 68f2e64c986..cb093d52a75 100644 --- a/iced/advanced/widget/operation/trait.Focusable.html +++ b/iced/advanced/widget/operation/trait.Focusable.html @@ -8,5 +8,5 @@

Required Methods§

source

fn is_focused(&self) -> bool

Returns whether the widget is focused or not.

source

fn focus(&mut self)

Focuses the widget.

source

fn unfocus(&mut self)

Unfocuses the widget.

-

Implementors§

source§

impl<P> Focusable for State<P>
where +

Implementors§

source§

impl<P> Focusable for State<P>
where P: Paragraph,

\ No newline at end of file diff --git a/iced/advanced/widget/operation/trait.TextInput.html b/iced/advanced/widget/operation/trait.TextInput.html index 3e376660568..e533453ade0 100644 --- a/iced/advanced/widget/operation/trait.TextInput.html +++ b/iced/advanced/widget/operation/trait.TextInput.html @@ -10,5 +10,5 @@
source

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.

source

fn move_cursor_to(&mut self, position: usize)

Moves the cursor of the text input to an arbitrary location.

source

fn select_all(&mut self)

Selects all the content of the text input.

-

Implementors§

source§

impl<P> TextInput for State<P>
where +

Implementors§

source§

impl<P> TextInput for State<P>
where P: Paragraph,

\ No newline at end of file diff --git a/iced/widget/text_input/fn.mouse_interaction.html b/iced/widget/text_input/fn.mouse_interaction.html index 6a16669be77..d256178cb12 100644 --- a/iced/widget/text_input/fn.mouse_interaction.html +++ b/iced/widget/text_input/fn.mouse_interaction.html @@ -1,5 +1,5 @@ mouse_interaction in iced::widget::text_input - Rust -
pub fn mouse_interaction(
+    
pub fn mouse_interaction(
     layout: Layout<'_>,
     cursor: Cursor,
     is_disabled: bool
diff --git a/iced/widget/text_input/struct.State.html b/iced/widget/text_input/struct.State.html
index 1743b8acb61..0c1e37fd320 100644
--- a/iced/widget/text_input/struct.State.html
+++ b/iced/widget/text_input/struct.State.html
@@ -1,23 +1,23 @@
 State in iced::widget::text_input - Rust
-    

Struct iced::widget::text_input::State

source ·
pub struct State<P>
where +

Struct iced::widget::text_input::State

source ·
pub struct State<P>
where P: Paragraph,
{ /* private fields */ }
Expand description

The state of a TextInput.

-

Implementations§

source§

impl<P> State<P>
where - P: Paragraph,

source

pub fn new() -> State<P>

Creates a new State, representing an unfocused TextInput.

-
source

pub fn focused() -> State<P>

Creates a new State, representing a focused TextInput.

-
source

pub fn is_focused(&self) -> bool

Returns whether the TextInput is currently focused or not.

-
source

pub fn cursor(&self) -> Cursor

Returns the Cursor of the TextInput.

-
source

pub fn focus(&mut self)

Focuses the TextInput.

-
source

pub fn unfocus(&mut self)

Unfocuses the TextInput.

-
source

pub fn move_cursor_to_front(&mut self)

Moves the Cursor of the TextInput to the front of the input text.

-
source

pub fn move_cursor_to_end(&mut self)

Moves the Cursor of the TextInput to the end of the input text.

-
source

pub fn move_cursor_to(&mut self, position: usize)

Moves the Cursor of the TextInput to an arbitrary location.

-
source

pub fn select_all(&mut self)

Selects all the content of the TextInput.

-

Trait Implementations§

source§

impl<P> Clone for State<P>
where - P: Clone + Paragraph,

source§

fn clone(&self) -> State<P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P> Debug for State<P>
where - P: Debug + Paragraph,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<P> Default for State<P>
where - P: Default + Paragraph,

source§

fn default() -> State<P>

Returns the “default value” for a type. Read more
source§

impl<P> Focusable for State<P>
where - P: Paragraph,

source§

fn is_focused(&self) -> bool

Returns whether the widget is focused or not.
source§

fn focus(&mut self)

Focuses the widget.
source§

fn unfocus(&mut self)

Unfocuses the widget.
source§

impl<P> TextInput for State<P>
where - P: Paragraph,

source§

fn move_cursor_to_front(&mut self)

Moves the cursor of the text input to the front of the input text.
source§

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.
source§

fn move_cursor_to(&mut self, position: usize)

Moves the cursor of the text input to an arbitrary location.
source§

fn select_all(&mut self)

Selects all the content of the text input.

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for State<P>
where +

Implementations§

source§

impl<P> State<P>
where + P: Paragraph,

source

pub fn new() -> State<P>

Creates a new State, representing an unfocused TextInput.

+
source

pub fn focused() -> State<P>

Creates a new State, representing a focused TextInput.

+
source

pub fn is_focused(&self) -> bool

Returns whether the TextInput is currently focused or not.

+
source

pub fn cursor(&self) -> Cursor

Returns the Cursor of the TextInput.

+
source

pub fn focus(&mut self)

Focuses the TextInput.

+
source

pub fn unfocus(&mut self)

Unfocuses the TextInput.

+
source

pub fn move_cursor_to_front(&mut self)

Moves the Cursor of the TextInput to the front of the input text.

+
source

pub fn move_cursor_to_end(&mut self)

Moves the Cursor of the TextInput to the end of the input text.

+
source

pub fn move_cursor_to(&mut self, position: usize)

Moves the Cursor of the TextInput to an arbitrary location.

+
source

pub fn select_all(&mut self)

Selects all the content of the TextInput.

+

Trait Implementations§

source§

impl<P> Clone for State<P>
where + P: Clone + Paragraph,

source§

fn clone(&self) -> State<P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P> Debug for State<P>
where + P: Debug + Paragraph,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<P> Default for State<P>
where + P: Default + Paragraph,

source§

fn default() -> State<P>

Returns the “default value” for a type. Read more
source§

impl<P> Focusable for State<P>
where + P: Paragraph,

source§

fn is_focused(&self) -> bool

Returns whether the widget is focused or not.
source§

fn focus(&mut self)

Focuses the widget.
source§

fn unfocus(&mut self)

Unfocuses the widget.
source§

impl<P> TextInput for State<P>
where + P: Paragraph,

source§

fn move_cursor_to_front(&mut self)

Moves the cursor of the text input to the front of the input text.
source§

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.
source§

fn move_cursor_to(&mut self, position: usize)

Moves the cursor of the text input to an arbitrary location.
source§

fn select_all(&mut self)

Selects all the content of the text input.

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for State<P>
where P: RefUnwindSafe,

§

impl<P> Send for State<P>
where P: Send,

§

impl<P> Sync for State<P>
where P: Sync,

§

impl<P> Unpin for State<P>
where diff --git a/iced_renderer/compositor/enum.Compositor.html b/iced_renderer/compositor/enum.Compositor.html index 574a97deff5..068dc56f4fe 100644 --- a/iced_renderer/compositor/enum.Compositor.html +++ b/iced_renderer/compositor/enum.Compositor.html @@ -1,8 +1,8 @@ Compositor in iced_renderer::compositor - Rust
pub enum Compositor<Theme> {
-    TinySkia(Compositor<Theme>),
+    TinySkia(Compositor<Theme>),
     Wgpu(Compositor<Theme>),
-}

Variants§

§

TinySkia(Compositor<Theme>)

§

Wgpu(Compositor<Theme>)

Available on crate feature wgpu only.

Trait Implementations§

source§

impl<Theme> Compositor for Compositor<Theme>

§

type Settings = Settings

The settings of the backend.
§

type Renderer = Renderer<Theme>

The iced renderer of the backend.
§

type Surface = Surface

The surface of the backend.
source§

fn new<W: HasRawWindowHandle + HasRawDisplayHandle>( +}

Variants§

§

TinySkia(Compositor<Theme>)

§

Wgpu(Compositor<Theme>)

Available on crate feature wgpu only.

Trait Implementations§

source§

impl<Theme> Compositor for Compositor<Theme>

§

type Settings = Settings

The settings of the backend.
§

type Renderer = Renderer<Theme>

The iced renderer of the backend.
§

type Surface = Surface

The surface of the backend.
source§

fn new<W: HasRawWindowHandle + HasRawDisplayHandle>( settings: Self::Settings, compatible_window: Option<&W> ) -> Result<Self, Error>

Creates a new [Compositor].
source§

fn create_renderer(&self) -> Self::Renderer

Creates a [Self::Renderer] for the [Compositor].
source§

fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>( diff --git a/iced_renderer/compositor/enum.Surface.html b/iced_renderer/compositor/enum.Surface.html index 2e91e42e123..30395b05f0b 100644 --- a/iced_renderer/compositor/enum.Surface.html +++ b/iced_renderer/compositor/enum.Surface.html @@ -1,8 +1,8 @@ Surface in iced_renderer::compositor - Rust
pub enum Surface {
-    TinySkia(Surface),
+    TinySkia(Surface),
     Wgpu(Surface),
-}

Variants§

§

TinySkia(Surface)

§

Wgpu(Surface)

Available on crate feature wgpu only.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Surface

§

impl !Send for Surface

§

impl !Sync for Surface

§

impl Unpin for Surface

§

impl !UnwindSafe for Surface

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +}

Variants§

§

TinySkia(Surface)

§

Wgpu(Surface)

Available on crate feature wgpu only.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Surface

§

impl !Send for Surface

§

impl !Sync for Surface

§

impl Unpin for Surface

§

impl !UnwindSafe for Surface

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/iced_renderer/enum.Renderer.html b/iced_renderer/enum.Renderer.html index 3efd40aff8c..015be17a1f6 100644 --- a/iced_renderer/enum.Renderer.html +++ b/iced_renderer/enum.Renderer.html @@ -1,9 +1,9 @@ Renderer in iced_renderer - Rust
pub enum Renderer<Theme> {
-    TinySkia(Renderer<Theme>),
+    TinySkia(Renderer<Theme>),
     Wgpu(Renderer<Theme>),
 }
Expand description

The default graphics renderer for iced.

-

Variants§

§

TinySkia(Renderer<Theme>)

§

Wgpu(Renderer<Theme>)

Available on crate feature wgpu only.

Implementations§

source§

impl<T> Renderer<T>

source

pub fn draw_mesh(&mut self, mesh: Mesh)

Trait Implementations§

source§

impl<T> Renderer for Renderer<T>

Available on crate feature svg only.
source§

fn dimensions(&self, handle: &Handle) -> Size<u32>

Returns the default dimensions of an SVG for the given [Handle].
source§

fn draw(&mut self, handle: Handle, color: Option<Color>, bounds: Rectangle)

Draws an SVG with the given [Handle], an optional [Color] filter, and inside the provided bounds.
source§

impl<T> Renderer for Renderer<T>

§

type Font = Font

The font type used.
§

type Paragraph = Paragraph

The [Paragraph] of this [Renderer].
§

type Editor = Editor

The [Editor] of this [Renderer].
source§

const ICON_FONT: Font = iced_tiny_skia::Renderer<T>::ICON_FONT

The icon font of the backend.
source§

const CHECKMARK_ICON: char = '\u{f00c}'

The char representing a ✔ icon in the ICON_FONT.
source§

const ARROW_DOWN_ICON: char = '\u{e800}'

The char representing a ▼ icon in the built-in ICON_FONT.
source§

fn default_font(&self) -> Self::Font

Returns the default [Self::Font].
source§

fn default_size(&self) -> Pixels

Returns the default size of [Text].
source§

fn load_font(&mut self, bytes: Cow<'static, [u8]>)

Loads a [Self::Font] from its bytes.
source§

fn fill_paragraph( +

Variants§

§

TinySkia(Renderer<Theme>)

§

Wgpu(Renderer<Theme>)

Available on crate feature wgpu only.

Implementations§

source§

impl<T> Renderer<T>

source

pub fn draw_mesh(&mut self, mesh: Mesh)

Trait Implementations§

source§

impl<T> Renderer for Renderer<T>

Available on crate feature svg only.
source§

fn dimensions(&self, handle: &Handle) -> Size<u32>

Returns the default dimensions of an SVG for the given [Handle].
source§

fn draw(&mut self, handle: Handle, color: Option<Color>, bounds: Rectangle)

Draws an SVG with the given [Handle], an optional [Color] filter, and inside the provided bounds.
source§

impl<T> Renderer for Renderer<T>

§

type Font = Font

The font type used.
§

type Paragraph = Paragraph

The [Paragraph] of this [Renderer].
§

type Editor = Editor

The [Editor] of this [Renderer].
source§

const ICON_FONT: Font = iced_tiny_skia::Renderer<T>::ICON_FONT

The icon font of the backend.
source§

const CHECKMARK_ICON: char = '\u{f00c}'

The char representing a ✔ icon in the ICON_FONT.
source§

const ARROW_DOWN_ICON: char = '\u{e800}'

The char representing a ▼ icon in the built-in ICON_FONT.
source§

fn default_font(&self) -> Self::Font

Returns the default [Self::Font].
source§

fn default_size(&self) -> Pixels

Returns the default size of [Text].
source§

fn load_font(&mut self, bytes: Cow<'static, [u8]>)

Loads a [Self::Font] from its bytes.
source§

fn fill_paragraph( &mut self, paragraph: &Self::Paragraph, position: Point, diff --git a/iced_renderer/geometry/enum.Frame.html b/iced_renderer/geometry/enum.Frame.html index 6a6cc83a850..c76e110b5c4 100644 --- a/iced_renderer/geometry/enum.Frame.html +++ b/iced_renderer/geometry/enum.Frame.html @@ -1,8 +1,8 @@ Frame in iced_renderer::geometry - Rust
pub enum Frame {
-    TinySkia(Frame),
+    TinySkia(Frame),
     Wgpu(Frame),
-}
Available on crate feature geometry only.

Variants§

§

TinySkia(Frame)

§

Wgpu(Frame)

Available on crate feature wgpu only.

Implementations§

source§

impl Frame

source

pub fn new<Theme>(renderer: &Renderer<Theme>, size: Size) -> Self

source

pub fn width(&self) -> f32

Returns the width of the Frame.

+}

Available on crate feature geometry only.

Variants§

§

TinySkia(Frame)

§

Wgpu(Frame)

Available on crate feature wgpu only.

Implementations§

source§

impl Frame

source

pub fn new<Theme>(renderer: &Renderer<Theme>, size: Size) -> Self

source

pub fn width(&self) -> f32

Returns the width of the Frame.

source

pub fn height(&self) -> f32

Returns the height of the Frame.

source

pub fn size(&self) -> Size

Returns the dimensions of the Frame.

source

pub fn center(&self) -> Point

Returns the coordinate of the center of the Frame.

diff --git a/iced_renderer/geometry/enum.Geometry.html b/iced_renderer/geometry/enum.Geometry.html index 6c80de6956b..bfb6df25fc3 100644 --- a/iced_renderer/geometry/enum.Geometry.html +++ b/iced_renderer/geometry/enum.Geometry.html @@ -1,8 +1,8 @@ Geometry in iced_renderer::geometry - Rust
pub enum Geometry {
-    TinySkia(Primitive),
+    TinySkia(Primitive),
     Wgpu(Primitive),
-}
Available on crate feature geometry only.

Variants§

§

TinySkia(Primitive)

§

Wgpu(Primitive)

Available on crate feature wgpu only.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +}
Available on crate feature geometry only.

Variants§

§

TinySkia(Primitive)

§

Wgpu(Primitive)

Available on crate feature wgpu only.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/iced_widget/canvas/enum.Frame.html b/iced_widget/canvas/enum.Frame.html index 2d801a20bb9..8948fd9bd6d 100644 --- a/iced_widget/canvas/enum.Frame.html +++ b/iced_widget/canvas/enum.Frame.html @@ -1,8 +1,8 @@ Frame in iced_widget::canvas - Rust
pub enum Frame {
-    TinySkia(Frame),
+    TinySkia(Frame),
     Wgpu(Frame),
-}
Available on crate feature canvas only.

Variants§

§

TinySkia(Frame)

§

Wgpu(Frame)

Available on crate feature wgpu only.

Implementations§

source§

impl Frame

source

pub fn new<Theme>(renderer: &Renderer<Theme>, size: Size) -> Frame

source

pub fn width(&self) -> f32

Returns the width of the Frame.

+}
Available on crate feature canvas only.

Variants§

§

TinySkia(Frame)

§

Wgpu(Frame)

Available on crate feature wgpu only.

Implementations§

source§

impl Frame

source

pub fn new<Theme>(renderer: &Renderer<Theme>, size: Size) -> Frame

source

pub fn width(&self) -> f32

Returns the width of the Frame.

source

pub fn height(&self) -> f32

Returns the height of the Frame.

source

pub fn size(&self) -> Size

Returns the dimensions of the Frame.

source

pub fn center(&self) -> Point

Returns the coordinate of the center of the Frame.

diff --git a/iced_widget/text_input/fn.draw.html b/iced_widget/text_input/fn.draw.html index 927bd9793ed..63605346940 100644 --- a/iced_widget/text_input/fn.draw.html +++ b/iced_widget/text_input/fn.draw.html @@ -1,5 +1,5 @@ draw in iced_widget::text_input - Rust -

Function iced_widget::text_input::draw

source ·
pub fn draw<Renderer>(
+    

Function iced_widget::text_input::draw

source ·
pub fn draw<Renderer>(
     renderer: &mut Renderer,
     theme: &Renderer::Theme,
     layout: Layout<'_>,
diff --git a/iced_widget/text_input/fn.mouse_interaction.html b/iced_widget/text_input/fn.mouse_interaction.html
index 996d0366d5d..c3c4155fd9d 100644
--- a/iced_widget/text_input/fn.mouse_interaction.html
+++ b/iced_widget/text_input/fn.mouse_interaction.html
@@ -1,5 +1,5 @@
 mouse_interaction in iced_widget::text_input - Rust
-    
pub fn mouse_interaction(
+    
pub fn mouse_interaction(
     layout: Layout<'_>,
     cursor: Cursor,
     is_disabled: bool
diff --git a/iced_widget/text_input/index.html b/iced_widget/text_input/index.html
index d063feb731f..f968cd50754 100644
--- a/iced_widget/text_input/index.html
+++ b/iced_widget/text_input/index.html
@@ -1,5 +1,5 @@
 iced_widget::text_input - Rust
-    

Module iced_widget::text_input

source ·
Expand description

Display fields that can be filled with text.

+

Module iced_widget::text_input

source ·
Expand description

Display fields that can be filled with text.

A TextInput has some local State.

Re-exports

Modules

  • Track the cursor of a text input.

Structs

Enums

Constants

Traits

  • A set of rules that dictate the style of a text input.

Functions

//! Display fields that can be filled with text.
 //!
 //! A [`TextInput`] has some local [`State`].
@@ -2666,31 +2674,39 @@ 

Files

(None, 0.0) }; - if let Some((cursor, color)) = cursor { - renderer.with_translation(Vector::new(-offset, 0.0), |renderer| { - renderer.fill_quad(cursor, color); - }); + let draw = |renderer: &mut Renderer, viewport| { + if let Some((cursor, color)) = cursor { + renderer.with_translation(Vector::new(-offset, 0.0), |renderer| { + renderer.fill_quad(cursor, color); + }); + } else { + renderer.with_translation(Vector::ZERO, |_| {}); + } + + renderer.fill_paragraph( + if text.is_empty() { + &state.placeholder + } else { + &state.value + }, + Point::new(text_bounds.x, text_bounds.center_y()) + - Vector::new(offset, 0.0), + if text.is_empty() { + theme.placeholder_color(style) + } else if is_disabled { + theme.disabled_color(style) + } else { + theme.value_color(style) + }, + viewport, + ); + }; + + if cursor.is_some() { + renderer.with_layer(text_bounds, |renderer| draw(renderer, *viewport)); } else { - renderer.with_translation(Vector::ZERO, |_| {}); + draw(renderer, text_bounds); } - - renderer.fill_paragraph( - if text.is_empty() { - &state.placeholder - } else { - &state.value - }, - Point::new(text_bounds.x, text_bounds.center_y()) - - Vector::new(offset, 0.0), - if text.is_empty() { - theme.placeholder_color(style) - } else if is_disabled { - theme.disabled_color(style) - } else { - theme.value_color(style) - }, - text_bounds, - ); } /// Computes the current [`mouse::Interaction`] of the [`TextInput`].