From a86b0ab2e026a870ac92ec7764796ba217d1a07d Mon Sep 17 00:00:00 2001 From: Serophots <47299955+Serophots@users.noreply.github.com> Date: Sat, 20 Dec 2025 00:29:26 +0000 Subject: [PATCH] gpui: Improve the tab stop example by demonstrating tab_group (#44647) I've just enriched the existing tab_stop.rs example for GPUI with a demonstration of tab_group. I don't think tab groups existed when the original example was written. (I didn't understand the behaviour for tab_group from the doccomments and the example was missing, so I think this is a productive PR) Release Notes: - N/A --- crates/gpui/examples/tab_stop.rs | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/crates/gpui/examples/tab_stop.rs b/crates/gpui/examples/tab_stop.rs index 4d99da1a07a123e9a18b3c64a90834c31bd76909..efad97236cfc778870db1ee723c92691578860dd 100644 --- a/crates/gpui/examples/tab_stop.rs +++ b/crates/gpui/examples/tab_stop.rs @@ -130,6 +130,50 @@ impl Render for Example { })), ), ) + .child( + div() + .id("group-1") + .tab_index(6) + .tab_group() + .tab_stop(false) + .child( + button("group-1-button-1") + .tab_index(1) + .child("Tab index [6, 1]"), + ) + .child( + button("group-1-button-2") + .tab_index(2) + .child("Tab index [6, 2]"), + ) + .child( + button("group-1-button-3") + .tab_index(3) + .child("Tab index [6, 3]"), + ), + ) + .child( + div() + .id("group-2") + .tab_index(7) + .tab_group() + .tab_stop(false) + .child( + button("group-2-button-1") + .tab_index(1) + .child("Tab index [7, 1]"), + ) + .child( + button("group-2-button-2") + .tab_index(2) + .child("Tab index [7, 2]"), + ) + .child( + button("group-2-button-3") + .tab_index(3) + .child("Tab index [7, 3]"), + ), + ) } }