From 935b465c7621f8b4e0213db33e67b351caf00155 Mon Sep 17 00:00:00 2001 From: Sam Sung <51686767+samwhosung@users.noreply.github.com> Date: Mon, 12 Oct 2026 01:21:22 +0700 Subject: [PATCH] Button state textures have one shown bit; widget setters take 1.12 forms (#917) A Button state texture's visibility was kept apart from its region's shown bit, so a script `Show()` on a non-current state texture drew nothing. The bar, thumb and ColorSelect setters took a colour form and accepted arguments the reference rejects, the loader built their textures from `file=` or `` alone, and a bar texture answered nil to `GetTexCoordModifiesRect`. In the reference, a region has one shown bit that `Show`, `Hide` and the state switch all write. The setters fork on object, path, nil or usage. The loader builds each widget texture as a full Texture element, and installing a bar texture sets its texcoord flag and gives it all points. All of these now match: one shown bit, the reference's argument forms, full-element textures with their names and texcoords, and no tint without a bar. Tests pin each. Fixes #909 Fixes #908 Fixes #575 Co-Authored-By: Claude Sonnet 5.5 --- crates/benilla-ui/src/loader/mod.rs | 2 +- crates/benilla-ui/src/loader/regions.rs | 109 +++-- crates/benilla-ui/src/loader/scripts.rs | 19 + crates/benilla-ui/src/loader/widgets.rs | 130 ++---- crates/benilla-ui/src/script/button.rs | 167 ++++--- crates/benilla-ui/src/script/colorselect.rs | 199 ++++----- crates/benilla-ui/src/script/extract.rs | 4 +- crates/benilla-ui/src/script/mod.rs | 2 +- crates/benilla-ui/src/script/region.rs | 141 ++++-- crates/benilla-ui/src/script/region/paint.rs | 6 +- crates/benilla-ui/src/script/slider.rs | 188 ++++---- crates/benilla-ui/src/script/statusbar.rs | 218 +++++----- crates/benilla-ui/src/script/tests/button.rs | 13 +- crates/benilla-ui/src/script/tests/mod.rs | 2 + .../src/script/tests/numeric_shape_gate.rs | 1 + .../benilla-ui/src/script/tests/shown_bit.rs | 238 ++++++++++ .../benilla-ui/src/script/tests/statusbar.rs | 6 +- .../src/script/tests/widget_args.rs | 408 ++++++++++++++++++ crates/benilla-ui/src/script/types.rs | 7 +- crates/benilla-ui/src/widget/kinds/mod.rs | 182 +++++--- crates/benilla-ui/src/widget/mod.rs | 4 +- crates/benilla-ui/src/widget/tests.rs | 2 +- 22 files changed, 1394 insertions(+), 654 deletions(-) create mode 100644 crates/benilla-ui/src/script/tests/shown_bit.rs create mode 100644 crates/benilla-ui/src/script/tests/widget_args.rs diff --git a/crates/benilla-ui/src/loader/mod.rs b/crates/benilla-ui/src/loader/mod.rs index d26b0978..9feebc6d 100644 --- a/crates/benilla-ui/src/loader/mod.rs +++ b/crates/benilla-ui/src/loader/mod.rs @@ -708,7 +708,7 @@ impl Loader<'_> { self.apply_title_region(el, wrapper, self_name, dbg_name); // 5b · per-kind LoadXML extras (EditBox `0x779fb0`), each gated on the element's own tag, // so a Frame wearing a