Tabs: Add support for adding buttons before the left arrow in the tab bar. - #131
Open
SpruceCloud wants to merge 3 commits into
Open
Tabs: Add support for adding buttons before the left arrow in the tab bar.#131SpruceCloud wants to merge 3 commits into
SpruceCloud wants to merge 3 commits into
Conversation
SpruceCloud
force-pushed
the
tab-bar-custom-slots
branch
from
June 26, 2026 17:19
3eeac1d to
08daa8a
Compare
Two new `Behavior` trait methods with no-op defaults let consumers inject custom UI into the tab bar pinned to the outer edges: - `tab_bar_leading_ui` — left of the left scroll-arrow - `tab_bar_trailing_ui` — right of `top_bar_right_ui` and the right scroll-arrow Both slots sit outside the scrollable tab strip, so they don't move when tabs are scrolled. Their consumed width is automatically subtracted from the area available to the tab strip (via `ui.available_width()` shrinking before `ScrollState::update` reads it), so tabs shrink rather than overlap. `scroll_area_width` is additionally clamped against the inner LTR ui's remaining width so the leading slot is handled the same way. `top_bar_right_ui` is unchanged — the new trailing slot lives further outside it. The `advanced` example gains a hamburger (☰) leading and a gear (⚙) trailing widget to demonstrate the pinning behavior.
Bare `let _ = ui.small_button(...)` tripped `clippy::let_underscore_must_use` and `clippy::let_underscore_untyped`. Renaming to `let _response` silences both while keeping the discard intent.
…undant tab_bar_trailing_ui
SpruceCloud
force-pushed
the
tab-bar-custom-slots
branch
from
June 26, 2026 17:23
08daa8a to
edbb3d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding support for custom buttons before the left arrow into the tab bar. The additional buttons can be used e.g. for a button to add new custom tab or an action search among tabs.
tab_bar_left_ui— left of the left scroll-arrow