From cc906c83cdf896d94b7ccf91258466714be631f6 Mon Sep 17 00:00:00 2001 From: Nick Senger Date: Wed, 8 Nov 2023 19:12:53 -0800 Subject: feat: quad shadows --- widget/src/text_editor.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'widget/src/text_editor.rs') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 09a0cac0..3f3ccf72 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -470,6 +470,7 @@ where border_radius: appearance.border_radius, border_width: appearance.border_width, border_color: appearance.border_color, + shadow: Default::default(), }, appearance.background, ); @@ -511,6 +512,7 @@ where border_radius: 0.0.into(), border_width: 0.0, border_color: Color::TRANSPARENT, + shadow: Default::default(), }, theme.value_color(&self.style), ); @@ -526,6 +528,7 @@ where border_radius: 0.0.into(), border_width: 0.0, border_color: Color::TRANSPARENT, + shadow: Default::default(), }, theme.selection_color(&self.style), ); -- cgit From 370b2f6df799c948188d3949e34112258b2a8498 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 20 Jan 2024 12:25:07 +0100 Subject: Use `Default` implementation of `renderer::Quad` --- widget/src/text_editor.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'widget/src/text_editor.rs') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 3f3ccf72..01ab1262 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -10,8 +10,7 @@ use crate::core::text::highlighter::{self, Highlighter}; use crate::core::text::{self, LineHeight}; use crate::core::widget::{self, Widget}; use crate::core::{ - Clipboard, Color, Element, Length, Padding, Pixels, Rectangle, Shell, Size, - Vector, + Clipboard, Element, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, }; use std::cell::RefCell; @@ -470,7 +469,7 @@ where border_radius: appearance.border_radius, border_width: appearance.border_width, border_color: appearance.border_color, - shadow: Default::default(), + ..renderer::Quad::default() }, appearance.background, ); @@ -509,10 +508,7 @@ where ) .into(), }, - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, theme.value_color(&self.style), ); @@ -525,10 +521,7 @@ where renderer.fill_quad( renderer::Quad { bounds: range, - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, theme.selection_color(&self.style), ); -- cgit From 25f182f933ea6b7c112c8f9a450a98dc9b9eebdd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 20 Jan 2024 13:29:25 +0100 Subject: Introduce `Border` struct analogous to `Shadow` --- widget/src/text_editor.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'widget/src/text_editor.rs') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 01ab1262..6b716238 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -466,9 +466,7 @@ where renderer.fill_quad( renderer::Quad { bounds, - border_radius: appearance.border_radius, - border_width: appearance.border_width, - border_color: appearance.border_color, + border: appearance.border, ..renderer::Quad::default() }, appearance.background, -- cgit