From 78bb793de06adf4953b5a62f7e47df6cda9a4553 Mon Sep 17 00:00:00 2001 From: jrmoulton Date: Sat, 8 Jun 2024 03:27:48 -0600 Subject: [PATCH] Add selectable to the default style --- src/style.rs | 1 + src/views/label.rs | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/style.rs b/src/style.rs index 20b0775b..28a1daa6 100644 --- a/src/style.rs +++ b/src/style.rs @@ -1231,6 +1231,7 @@ define_builtin_props!( FontStyle font_style nocb: Option { inherited } = None, CursorColor cursor_color nocb: Color {} = Color::BLACK.with_alpha_factor(0.3), SelectionCornerRadius selection_corer_radius nocb: f64 {} = 1., + Selectable selectable: bool {} = true, TextOverflowProp text_overflow: TextOverflow {} = TextOverflow::Wrap, LineHeight line_height nocb: Option { inherited } = None, AspectRatio aspect_ratio: Option {} = None, diff --git a/src/views/label.rs b/src/views/label.rs index 68c9b57e..db01d7f8 100644 --- a/src/views/label.rs +++ b/src/views/label.rs @@ -6,10 +6,10 @@ use crate::{ event::{Event, EventPropagation}, id::ViewId, keyboard::KeyEvent, - prop, prop_extractor, + prop_extractor, style::{ - CursorColor, FontProps, LineHeight, SelectionCornerRadius, SelectionStyle, Style, - TextColor, TextOverflow, TextOverflowProp, + CursorColor, FontProps, LineHeight, Selectable, SelectionCornerRadius, SelectionStyle, + Style, TextColor, TextOverflow, TextOverflowProp, }, style_class, unit::PxPct, @@ -25,8 +25,6 @@ use taffy::tree::NodeId; use super::{Decorators, TextCommand}; -prop!(pub Selectable: bool {} = true); - prop_extractor! { Extractor { color: TextColor,