Button text alignment
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
Button has no text alignment option. For wide buttons, the text aligns left and cannot be centered without additional coding complexity. e.g.
```
let btn = ui.add(
Button::new(
RichText::new("Some text)
.color(Color32::WHITE),
)
.fill(Color32::DARK_GREEN)
.min_size(vec2(250.0, 20.0)),
);
```
Wrapping this in ```ui.horizontal``` does appear to center the text.
Contributor guide
Research direction
Start by locating the Button widget implementation and its existing layout or widget tests. Trace how a wide button positions its label, then add a text-alignment option that supports centering and verify that the provided wide-button example renders centered text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100