Repository navigation
ui: truncate long workbook titles in the title bar - #1560
Merged
Merged
Conversation
|
Verified against
Correct, well-tested, and the bundled unrelated clippy fix is a reasonable rider rather than scope creep. Good to merge. |
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.
Fixes #1558
What
Long workbook titles ran under the title-bar controls. The title is now drawn after the
controls on both sides and limited to the space between them, so it stays centred on the
window and is cut with "…" when it doesn't fit. The unsaved-changes dot (•) stays visible
however short the title gets.
Tests
New tests in
ribbon::title_bar_tests:title_fits_between_the_controlslong_title_is_truncated_with_an_ellipsisshort_title_is_left_wholeunsaved_dot_survives_truncationno_room_draws_nothing_but_does_not_crashAlso
A one-line test fix in
crates/xlsx/src/tests/passthrough_tests.rs: clippy on newer Rustflags
nonminimal_boolthere. Same meaning, rewritten withis_none_or.Screenshots
Before / after
To get an "after" screenshot without opening a window, run:
cargo run -p gridcraft-ui-egui --example snapshot -- --sample sales after.png
The sample workbook has a short name, so the image won't show the truncation by itself. The best
"after" is a screenshot of the running app with your long file open:
cargo run --release -p gridcraft -- path/to/long-name.xlsx