Repository navigation
feat: add a light theme beside the dark one, or the one the system uses - #63
Merged
Merged
Conversation
Merged
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.
What this changes
The settings get a Theme row: Dark, Light or System. Light is a full theme, with colours of its own where GitCraft adds them to egui's:
error_fg_color, set per theme).The choice is egui's own theme preference, which eframe already saves with the zoom. An existing install saved Dark (the app set Dark on every start), so it keeps the look it has; a new one starts with System, which falls back to dark when the system does not say.
This finishes "Settings" on the roadmap.
How it is tested
a_light_theme_colours_diffs_and_code_for_a_light_background: opens the diff of a Rust file, picks Light in the settings, and waits until the open diff is coloured again in the light theme; then the keywordfnhas another colour than before, the changed word sits on the light word colour and nothing on the dark one. Picking System sets egui's preference to System. It fails without colouring the open diff again.code_takes_the_colours_of_its_languagealso checks that the light theme gives a keyword another colour.Tried on Linux: the demo graph in light (labels, tags, current branch, HEAD ring), a Rust diff with word marks, a picked line and side by side, a switch back to dark with the diff open (coloured again at once), the conflict view with a pick, the New branch dialog, and Light still set after closing GitCraft and starting it again. An install that had the dark look before opened dark.
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepassIt adds as little code as the change needs, and removes what it makes unnecessary
Nothing in it comes from GitKraken or another closed-source client (see CONTRIBUTING.md)