Skip to content

status_bar: add StatusBar component#2449

Merged
huacnlee merged 3 commits into
mainfrom
status-bar
Jun 9, 2026
Merged

status_bar: add StatusBar component#2449
huacnlee merged 3 commits into
mainfrom
status-bar

Conversation

@huacnlee

@huacnlee huacnlee commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

Adds a reusable StatusBar, extracted from the editor example's bottom bar.

  • StatusBar — a horizontal bar with left / center / right regions
    laid out with justify_between, following native status bars (Windows
    StatusStrip, WPF StatusBar, macOS NSStatusBar). Sets flex_shrink_0
    so it keeps its height at the bottom of a flex column.
  • StatusBarItem — renders as a ghost xsmall Button (icon + label +
    tooltip + on_click), so items match buttons placed in the same bar.

Changes

  • New crates/ui/src/status_bar.rs, exported as gpui_component::status_bar
  • Use it in the editor example and the gallery bottom bar
  • Add StatusBarStory to the gallery
  • Docs in English and Chinese

Note

This component was AI-generated and refactored to match the project style.

🤖 Generated with Claude Code

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>
@huacnlee huacnlee changed the title status_bar: add StatusBar and StatusBarItem components status_bar: add StatusBar component Jun 9, 2026
@huacnlee huacnlee merged commit 36a6080 into main Jun 9, 2026
4 checks passed
@huacnlee huacnlee deleted the status-bar branch June 9, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant