[Feature]: Interface themes as JSON files, with an interface scale
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 1/100
Research direction
The issue scopes the work to crates/ui-egui (theme.rs, lib.rs, ribbon.rs, and the ui_shot example), plus theme documentation and user guide updates. Start by reviewing the linked draft pull request #1151 and its tests and screenshots. Done means the proposed theme loading, settings controls, commands, platform behavior, and documentation are implemented and reviewed.
Written by the indexing model from the issue text.
Description
What problem does this solve?
The interface has two looks, light and dark, and both are code tables. A user cannot change a colour, the spacing, or the text sizes without building the app. A distribution, a fork or a plugin cannot ship a look of its own without a code change either. Whatever ships is what everyone gets.
The only appearance control is Dark Mode on the View tab, a single toggle. It also sits in the wrong tab: the ribbon guidelines say that application-wide preferences such as Dark Mode belong in Settings.
Proposed solution
A theme becomes a JSON file of 31 colours and nine metrics. A user writes one, drops it in the themes folder, and picks it in the app. Later themes arrive as files, so the shipped set grows without a code change.
- Settings › Theme lists Follow the System and every theme that loaded, and Interface Scale (80% to 200%) sits beside it. Settings is the tab for preferences that apply to every project, so the theme lives there. The Dark Mode button on View goes with it: one setting, one control, one name.
- Where files live:
crates/ui-egui/themes/{light,dark}.jsonare compiled in, and a test keeps them equal to the code tables they replace.<config>/themes/*.jsonare read at startup, when a file changes, and by Reload Themes. A user file named as a built-in replaces it. - Writing one is short:
extendsstarts from Light or Dark, so five colours make a working theme. - Commands:
ui.themeFilewithname,ui.themeLoad(a file from anywhere, kept in the themes folder),ui.scalewithfactor,ui.themeReload.ui.themekeeps its id and itsdarkparameter, so existing scripts and shortcuts still switch brightness. - Hostile input: an unknown token, a missing token, a wrong schema number, a colour that is not hex, or a file over 64 KB is refused with the reason, listed in red in the menu, and the app keeps drawing the nearest built-in. Sizes are held to what a window can draw. A byte-order mark from Notepad loads.
- Follow the System follows the platform theme where the platform reports one: Windows, macOS and the browser through
prefers-color-scheme. Linux desktops report none, so the entry is greyed out there and the button names the brightness in force instead. - What a theme cannot change: the map, which the renderer draws. A theme's colours stop at the map view.
Crates touched: crates/ui-egui only (theme.rs, lib.rs, ribbon.rs, the ui_shot example). No new dependency; serde and serde_json were already there. Docs: a new docs/themes.md page in the nav, a card on the docs home page, and the user guide rows for View and Settings.
Estimated scope
Medium
Alternatives considered
- Only the two built-in themes, as code. Simple, and it is what exists today. It leaves users and distributions without a look of their own, which is the point of the request.
- A palette file that sets egui's
Visualsdirectly. Less format to maintain, but the token names would follow egui's internals, so a user file would break when egui changes, and parts of RustGIS's own chrome are not inVisualsat all. - A file-watcher crate for the themes folder. It adds a dependency and coordination, for a folder that holds a handful of files. A once-a-second signature check (name, size, mtime) does the same job.
- Keep the Dark Mode toggle on View and put the theme list in Settings. That is two controls and two names for one setting, which the ribbon guidelines rule out.
Anything else?
Draft pull request: https://github.com/opengeos/RustGIS/pull/1151 (branch Wolren:ui/themes, 13 files, +1299 / -36). The code, the tests and the screenshots are there; the description says what each part does and what a reviewer may want to change.
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 268
- Avg merge
- 3h 37m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opengeos/RustGIS
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
opengeos/RustGIS#1144 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
[Bug]: Clip and Select by Location compare every feature with every overlay polygon: minutes where an indexed tool takes secondsPossibly taken @Mavrick-F claimed this today. Openbug
opengeos/RustGIS#1142 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
unconfirmed possible issue
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
opengeos/RustGIS#1111 · 8 comments ·
Maintainers usually reply within 1 day
All issues in opengeos/RustGIS
Similar issues
-
area:cli bug dotnet good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
delta-io/delta-kernel-rs#3757 ·
Maintainers usually reply within 3 days
-
area: library data-loss type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
alplabai/signex#1740 · 1 comment ·
Maintainers usually reply within 1 day
-
test(fslc): the unreadable mutate catalog test pins the Unix I/O error text and fails on WindowsPossibly taken @rizumita claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day