git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit73367dd7bed1d199184af07bd86a54917b34125a
parent18f64720e6
authorLucas Galante <[email protected]>
date2026-07-05 15:27
feat: add support for style.control.textbox... config styling mappings

 src/color.rs  |  9 ++++++---
 src/layout.rs | 16 ++++++++--------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/color.rs b/src/color.rs
index 79ea01c..e20c40b 100644
--- a/src/color.rs
+++ b/src/color.rs
@@ -306,15 +306,18 @@ fn parse_and_set_colors(content: &str) {
     if let Some(c) = get_color("/style/control/dropdown/color") {
         if let Ok(mut lock) = DROPDOWN_BACKGROUND_COLOR.write() { *lock = c; }
     }
-    if let Some(c) = get_color_u8("/style/textbox/placeholder_text_color")
+    if let Some(c) = get_color_u8("/style/control/textbox/placeholder_text_color")
+        .or_else(|| get_color_u8("/style/textbox/placeholder_text_color"))
         .or_else(|| get_color_u8("/style/data/textbox/placeholder_text_color")) {
         if let Ok(mut lock) = TEXTBOX_PLACEHOLDER_TEXT_COLOR.write() { *lock = c; }
     }
-    if let Some(c) = get_color("/style/textbox/background_color")
+    if let Some(c) = get_color("/style/control/textbox/background_color")
+        .or_else(|| get_color("/style/textbox/background_color"))
         .or_else(|| get_color("/style/data/textbox/background_color")) {
         if let Ok(mut lock) = TEXTBOX_BACKGROUND_COLOR.write() { *lock = c; }
     }
-    if let Some(c) = get_color("/style/textbox/background_edit_color")
+    if let Some(c) = get_color("/style/control/textbox/background_edit_color")
+        .or_else(|| get_color("/style/textbox/background_edit_color"))
         .or_else(|| get_color("/style/data/textbox/background_edit_color")) {
         if let Ok(mut lock) = TEXTBOX_BACKGROUND_EDIT_COLOR.write() { *lock = c; }
     }
diff --git a/src/layout.rs b/src/layout.rs
index baa2600..188a8fe 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -72,14 +72,14 @@ fn flatten_json_to_flat_props(val: &serde_json::Value, prefix: &str, flat_props:
                 "style.control.button.height" => "button_height",
                 "style.control.button.corner_radius" => "button_corner_radius",
                 "style.list.corner_radius" | "style.data.list.corner_radius" => "list_corner_radius",
-                "style.textbox.corner_radius" | "style.data.textbox.corner_radius" => "textbox_corner_radius",
+                "style.control.textbox.corner_radius" | "style.textbox.corner_radius" | "style.data.textbox.corner_radius" => "textbox_corner_radius",
                 "style.control.dropdown.font" => "dropdown_font",
                 "style.control.dropdown.color" => "dropdown_color",
                 "style.control.font_selector.font" => "font_selector_font",
                 "style.control.slider.font" => "slider_font",
                 "style.control.spinbox.font" => "spinbox_font",
                 "style.section.font" => "section_label_font",
-                "style.textbox.font" | "style.data.textbox.font" => "textbox_font",
+                "style.control.textbox.font" | "style.textbox.font" | "style.data.textbox.font" => "textbox_font",
                 "style.control.button_strip.font" => "button_strip_font",
                 "style.control.button_strip.spacing" => "button_strip_spacing",
                 "style.control.dropdown.height" => "dropdown_height",
@@ -95,12 +95,12 @@ fn flatten_json_to_flat_props(val: &serde_json::Value, prefix: &str, flat_props:
                 "style.control.spinbox.height" => "spinbox_height",
                 "style.control.spinbox.button_padding" => "spinbox_button_padding",
                 "style.control.spinbox.corner_radius" => "spinbox_corner_radius",
-                "style.textbox.height" | "style.data.textbox.height" => "textbox_height",
-                "style.textbox.placeholder_text_color" | "style.data.textbox.placeholder_text_color" => "textbox_placeholder_text_color",
-                "style.textbox.background_color" | "style.data.textbox.background_color" => "textbox_background_color",
-                "style.textbox.background_edit_color" | "style.data.textbox.background_edit_color" => "textbox_background_edit_color",
-                "style.textbox.multiline.line_wrap" | "style.data.textbox.multiline.line_wrap" => "textbox_line_wrap",
-                "style.textbox.multiline.border_width" | "style.data.textbox.multiline.border_width" => "textbox_multiline_border_width",
+                "style.control.textbox.height" | "style.textbox.height" | "style.data.textbox.height" => "textbox_height",
+                "style.control.textbox.placeholder_text_color" | "style.textbox.placeholder_text_color" | "style.data.textbox.placeholder_text_color" => "textbox_placeholder_text_color",
+                "style.control.textbox.background_color" | "style.textbox.background_color" | "style.data.textbox.background_color" => "textbox_background_color",
+                "style.control.textbox.background_edit_color" | "style.textbox.background_edit_color" | "style.data.textbox.background_edit_color" => "textbox_background_edit_color",
+                "style.control.textbox.multiline.line_wrap" | "style.textbox.multiline.line_wrap" | "style.data.textbox.multiline.line_wrap" => "textbox_line_wrap",
+                "style.control.textbox.multiline.border_width" | "style.textbox.multiline.border_width" | "style.data.textbox.multiline.border_width" => "textbox_multiline_border_width",
                 "style.control.toggle.font" => "toggle_font",
                 "style.control.toggle.height" => "toggle_height",
                 "style.control.toggle.border_width" => "toggle_border_width",