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
This commit is contained in:
Serophots
2025-12-20 00:29:26 +00:00
committed by GitHub
parent 5fb220a19a
commit a86b0ab2e0

View File

@@ -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]"),
),
)
}
}