Repository navigation
UI: title-bar light/dark switch, File › Display theme, system appearance on first run (#194, #239) - #318
Merged
Conversation
…nce on first run (storytold#194, storytold#239) The theme could only be chosen in the View tab's Display theme box, and the app always started light. Now: - a title-bar button switches light/dark in one click (view.darkMode); right-click offers System / Light / Dark; - File › Display theme offers the same three (Excel keeps it under File › Account › Office Theme); - the desktop app follows the system appearance until a theme is chosen and saved in ui.json (UiState's default stays light for tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Merged — thank you for the contribution! (The File dropdown became the Backstage view in #331, so I updated your theme test to choose System from Backstage › Options › Display theme; the title-bar switch is unchanged.) If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft |
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 #194, fixes #239
Root cause
Dark mode exists (View › Display theme: System / Light / Dark,
view.theme, saved inui.jsonsince 10-09), but:UiState::default()hassystem_theme: false(Dark mode seems missing? #239, "dark mode by default isn't a thing").What changed
Icon::Appearance) next to Comments. A click switches between light and dark (view.darkMode, which flips what is shown, also when System chose it). Right-click opens System / Light / Dark. It is exposed to accessibility as a "Dark Mode" checkbox with its state.view.theme {mode}). Excel keeps this under File › Account › Office Theme, but GridCraft's File menu has no Account page.apps/gridcraftload_prefs, the appearance follows the system until a theme is saved inui.json. This works like the existing interface-language default.UiState::default()stays Light, so tests and headless renders don't depend on the host. Existingui.jsonfiles keep the theme they already have.docs/ui-parity.mdrow + revision row.Overlap
Tests
title_bar_switch_and_file_menu_choose_the_theme(crates/ui-egui/tests/system_theme.rs): the title-bar switch flips light↔dark and saves a manual choice; File › Display theme › System returns to following the OS.cargo test -p gridcraft-ui-egui --test system_theme(5 passed)cargo test -p gridcraft-ui-egui --test file_menu(3 passed)cargo clippy -p gridcraft-ui-egui -p gridcraft --all-targets -- -D warningscargo fmt -p gridcraft-ui-egui -p gridcraft -- --check--example snapshot, light and--dark): the button sits left of Comments and reads in both themes.Not done
Unverified
load_prefs, not by a fresh-profile run on macOS/Windows.🤖 Generated with Claude Code