status_bar: add StatusBar component#2449
Merged
Merged
Conversation
A horizontal bar with left/center/right regions for the bottom of a window or pane, following native status bars (Windows StatusStrip, WPF StatusBar, macOS NSStatusBar). - left/right pin items to each end; child/children fill the center, whose alignment follows the pinned ends (centered with both, end-aligned with only left, start-aligned otherwise). The center is always a flex spacer so left/right reach both ends even without center content. - Regions take any impl IntoElement; StatusBar::button is a ghost xsmall button preset and StatusBar::separator a vertical divider. - Wire into the editor and dock examples (dock adds left/bottom/right dock toggles) and the gallery bottom bar, with a StatusBarStory showcasing real-world bars and layout cases. - Docs in English and Chinese. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Adds a reusable
StatusBar, extracted from the editor example's bottom bar.StatusBar— a horizontal bar withleft/center/rightregionslaid out with
justify_between, following native status bars (WindowsStatusStrip, WPFStatusBar, macOSNSStatusBar). Setsflex_shrink_0so it keeps its height at the bottom of a flex column.
StatusBarItem— renders as a ghostxsmallButton(icon + label +tooltip + on_click), so items match buttons placed in the same bar.
Changes
crates/ui/src/status_bar.rs, exported asgpui_component::status_bareditorexample and the gallery bottom barStatusBarStoryto the galleryNote
This component was AI-generated and refactored to match the project style.
🤖 Generated with Claude Code