From 385a4490fb6a344873ba5154275a33acc011d080 Mon Sep 17 00:00:00 2001 From: Bingus Date: Fri, 29 Mar 2024 16:58:11 -0700 Subject: Expose line_height & text_size fields for the text_editor widget --- widget/src/text_editor.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'widget') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index a00df3c7..92cdb251 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -110,6 +110,21 @@ where self } + /// Sets the text size of the [`TextEditor`]. + pub fn size(mut self, size: impl Into) -> Self { + self.text_size = Some(size.into()); + self + } + + /// Sets the [`text::LineHeight`] of the [`TextEditor`]. + pub fn line_height( + mut self, + line_height: impl Into, + ) -> Self { + self.line_height = line_height.into(); + self + } + /// Sets the [`Padding`] of the [`TextEditor`]. pub fn padding(mut self, padding: impl Into) -> Self { self.padding = padding.into(); -- cgit From 31d1d5fecbef50fa319cabd5d4194f1e4aaefa21 Mon Sep 17 00:00:00 2001 From: Aaron McGuire <89317236+Aaron-McGuire@users.noreply.github.com> Date: Tue, 2 Apr 2024 03:46:35 -0500 Subject: Check is_secure before a copy/cut from TextInput (#2366) * Check is_secure before copy/cut on text_input * run cargo fmt --- widget/src/text_input.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'widget') diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 8cfb0408..a814df78 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -712,7 +712,8 @@ where match key.as_ref() { keyboard::Key::Character("c") - if state.keyboard_modifiers.command() => + if state.keyboard_modifiers.command() + && !self.is_secure => { if let Some((start, end)) = state.cursor.selection(&self.value) @@ -726,7 +727,8 @@ where return event::Status::Captured; } keyboard::Key::Character("x") - if state.keyboard_modifiers.command() => + if state.keyboard_modifiers.command() + && !self.is_secure => { if let Some((start, end)) = state.cursor.selection(&self.value) -- cgit From 5cd98f069dea8720bca7748d6c12fa410cbe79b5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 7 Apr 2024 12:42:12 +0200 Subject: Use built-in `[lints]` table in `Cargo.toml` --- widget/Cargo.toml | 3 +++ widget/src/lib.rs | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'widget') diff --git a/widget/Cargo.toml b/widget/Cargo.toml index 84525935..3c9f6a54 100644 --- a/widget/Cargo.toml +++ b/widget/Cargo.toml @@ -10,6 +10,9 @@ homepage.workspace = true categories.workspace = true keywords.workspace = true +[lints] +workspace = true + [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] all-features = true diff --git a/widget/src/lib.rs b/widget/src/lib.rs index 209dfad9..1eeacbae 100644 --- a/widget/src/lib.rs +++ b/widget/src/lib.rs @@ -2,13 +2,6 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] -#![forbid(unsafe_code, rust_2018_idioms)] -#![deny( - missing_debug_implementations, - missing_docs, - unused_results, - rustdoc::broken_intra_doc_links -)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use iced_renderer as renderer; pub use iced_renderer::graphics; -- cgit