From 756c42609dfe30200aef5ef1c9f36c47206e6493 Mon Sep 17 00:00:00 2001 From: Aleksander Date: Sat, 14 Feb 2026 16:04:36 +0100 Subject: [PATCH 1/5] use SlotMap --- wayvr/src/windowing/manager.rs | 6 +++--- wgui/src/layout.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wayvr/src/windowing/manager.rs b/wayvr/src/windowing/manager.rs index 3bfb613d..c7f01d11 100644 --- a/wayvr/src/windowing/manager.rs +++ b/wayvr/src/windowing/manager.rs @@ -6,7 +6,7 @@ use std::{ use anyhow::Context; use glam::{Affine3A, Vec3, Vec3A}; -use slotmap::{HopSlotMap, Key, SecondaryMap}; +use slotmap::{Key, SecondaryMap, SlotMap}; use wgui::log::LogErr; use wlx_common::{ astr_containers::{AStrMap, AStrMapExt}, @@ -42,7 +42,7 @@ pub const MAX_OVERLAY_SETS: usize = 6; pub struct OverlayWindowManager { wrappers: EditWrapperManager, - overlays: HopSlotMap>, + overlays: SlotMap>, sets: Vec, global_set: OverlayWindowSet, /// The set that is currently visible. @@ -65,7 +65,7 @@ where pub fn new(app: &mut AppState, headless: bool) -> anyhow::Result { let mut me = Self { wrappers: EditWrapperManager::default(), - overlays: HopSlotMap::with_key(), + overlays: SlotMap::>::with_key(), current_set: Some(0), restore_set: 0, sets: vec![OverlayWindowSet::default()], diff --git a/wgui/src/layout.rs b/wgui/src/layout.rs index 18d656d1..5a19cdec 100644 --- a/wgui/src/layout.rs +++ b/wgui/src/layout.rs @@ -18,7 +18,7 @@ use crate::{ use anyhow::Context; use glam::{Vec2, vec2}; -use slotmap::{HopSlotMap, SecondaryMap, new_key_type}; +use slotmap::{SecondaryMap, SlotMap, new_key_type}; use taffy::{NodeId, TaffyTree, TraversePartialTree}; new_key_type! { @@ -57,7 +57,7 @@ impl WeakWidget { } } -pub struct WidgetMap(HopSlotMap); +pub struct WidgetMap(SlotMap); pub type WidgetNodeMap = SecondaryMap; #[derive(Clone)] @@ -68,7 +68,7 @@ pub struct WidgetPair { impl WidgetMap { fn new() -> Self { - Self(HopSlotMap::with_key()) + Self(SlotMap::::with_key()) } pub fn get_as(&self, handle: WidgetID) -> Option> { From c902f0cd44dcef9b567df79fac30a03040770bea Mon Sep 17 00:00:00 2001 From: Aleksander Date: Sat, 14 Feb 2026 11:01:08 +0100 Subject: [PATCH 2/5] wgui: widgets.md: document tabs --- wgui/doc/widgets.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/wgui/doc/widgets.md b/wgui/doc/widgets.md index 4ac2a6ac..a60f0c73 100644 --- a/wgui/doc/widgets.md +++ b/wgui/doc/widgets.md @@ -6,7 +6,7 @@ ## [Built-in components](#components) -[Button](#button-component), [Slider](#slider-component), [CheckBox](#checkbox-component) +[Button](#button-component), [Slider](#slider-component), [CheckBox](#checkbox-component), [Tabs](#tabs-component) ([Tab](#tab-component)) ## [Examples](#examples) @@ -370,6 +370,42 @@ _optional value that will be set as the RadioGroup's value_ ### A radio group. Place `` components inside this. +## Tabs component + +### `` + +### A tab bar component + +#### Parameters + +`id`: **string** + +_Unique identifier for the tab group_ + +Only `` components should be placed inside ``. + +--- + +## Tab component + +### `` + +### A single tab inside a `` component + +#### Parameters + +`name`: **string** + +_Unique identifier for the tab_ + +`translation`: **string** + +_Translated by key_ + +`sprite_src` | `sprite_src_ext` | `sprite_src_builtin` | `sprite_src_internal` + +_Image path (see [sprite](#sprite-widget)) for src descriptions_ + --- # Examples From 841241a7e64cec5bc264ad394621c505cfcf67aa Mon Sep 17 00:00:00 2001 From: Aleksander Date: Sat, 14 Feb 2026 14:19:03 +0100 Subject: [PATCH 3/5] wgui: Editbox basics, component focus, minor refactoring --- dash-frontend/src/util/wgui_simple.rs | 1 + uidev/assets/gui/various_widgets.xml | 15 +- wgui/src/components/button.rs | 19 +- wgui/src/components/checkbox.rs | 11 +- wgui/src/components/editbox.rs | 334 ++++++++++++++++++++++++++ wgui/src/components/mod.rs | 7 + wgui/src/components/slider.rs | 22 +- wgui/src/event.rs | 22 +- wgui/src/globals.rs | 2 + wgui/src/layout.rs | 88 +++++-- wgui/src/lib.rs | 3 +- wgui/src/parser/component_editbox.rs | 40 +++ wgui/src/parser/mod.rs | 3 + 13 files changed, 509 insertions(+), 58 deletions(-) create mode 100644 wgui/src/components/editbox.rs create mode 100644 wgui/src/parser/component_editbox.rs diff --git a/dash-frontend/src/util/wgui_simple.rs b/dash-frontend/src/util/wgui_simple.rs index f68a467f..b689b194 100644 --- a/dash-frontend/src/util/wgui_simple.rs +++ b/dash-frontend/src/util/wgui_simple.rs @@ -5,6 +5,7 @@ use wgui::{ widget::label::{WidgetLabel, WidgetLabelParams}, }; +#[allow(dead_code)] pub fn create_label(layout: &mut Layout, parent: WidgetID, content: Translation) -> anyhow::Result<()> { let label = WidgetLabel::create( &mut layout.state.globals.get(), diff --git a/uidev/assets/gui/various_widgets.xml b/uidev/assets/gui/various_widgets.xml index 5efb8e8b..653f66ca 100644 --- a/uidev/assets/gui/various_widgets.xml +++ b/uidev/assets/gui/various_widgets.xml @@ -59,10 +59,17 @@ - -