Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2dcffb8
UI: themes as files, an interface scale, and Settings > Theme
Wolren Oct 28, 2026
7c2b090
docs(ui): the theme reference is the shipped Light file, comments kep…
Wolren Oct 29, 2026
465e129
fix(ui): one control for brightness, in Settings > Theme
Wolren Oct 29, 2026
4282f55
fix(ui): a platform that reports no theme cannot be followed
Wolren Oct 29, 2026
41658cc
fix(ui): the zoom keys and the menu share one interface scale
Wolren Oct 29, 2026
3c6842f
docs(ui): the Settings preference list names the theme
Wolren Oct 29, 2026
4f210f8
fix(ui): theme state survives a reload, and the menu owns the scale
Wolren Oct 29, 2026
33c2d94
fix(ui): themes keep their brightness, their sizes and the scale they…
Wolren Oct 29, 2026
81b4613
test(ui): a file that sets its own brightness draws in that mode
Wolren Oct 29, 2026
a516e1e
fix(ui): the theme folder is read the way the rest of the app reads f…
Wolren Oct 29, 2026
67d364b
fix(ui): a theme file is opened only when it is a file, and the butto…
Wolren Oct 29, 2026
a0599c6
fix(ui): the chosen theme keeps its name until its file loads again
Wolren Nov 3, 2026
27e174d
fix(ui): say what the theme reader changed, and name the theme drawn
Wolren Nov 3, 2026
85c3801
fix(ui): the review notes, and one notice for a failed action
Wolren Nov 3, 2026
d09a55c
fix(ui): a symlinked theme file reloads when its target changes
Wolren Nov 3, 2026
6fd28e0
fix(ui): one file per theme name, and the picker says what it changed
Wolren Nov 3, 2026
9dd2f64
Update crates/ui-egui/src/theme.rs
Wolren Nov 3, 2026
8c97e7c
fix(ui): a theme file with no name takes its file name
Wolren Nov 3, 2026
7f355f3
fix(themes): preserve source files and safe theme loading
Mavrick-F Nov 4, 2026
78e7f9f
fix(themes): preserve saved appearance and roll back failed imports
Mavrick-F Nov 4, 2026
e06e7f0
fix(themes): hide desktop commands on web and invalidate reloaded looks
Mavrick-F Nov 4, 2026
ff5911b
fix(themes): preserve filename ownership and integrate main
Mavrick-F Nov 4, 2026
53806ec
fix(themes): preserve interrupted saves and reject malformed brightness
Mavrick-F Nov 4, 2026
a19e5aa
fix(themes): permit save retries and retain system brightness fallback
Mavrick-F Nov 4, 2026
17dd550
docs(themes): explain discovery of a newly created folder
Mavrick-F Nov 4, 2026
71a9d88
fix(themes): reject malformed selectors and reserve Windows device stems
Mavrick-F Nov 4, 2026
0eaf09d
fix(themes): report numeric adjustments and incomplete save state
Mavrick-F Nov 4, 2026
bf31a1a
fix(themes): integrate main and preserve incomplete-save retry errors
Mavrick-F Nov 4, 2026
e4bb92e
fix(themes): reject repeated colour keys and integrate upstream cleanup
Mavrick-F Nov 4, 2026
39201a2
fix(themes): report each explicit load and integrate upstream export …
Mavrick-F Nov 4, 2026
fef91d0
fix(themes): select the saved language before startup theme reads
Mavrick-F Nov 4, 2026
0d60168
fix(ui-shot): load custom themes before split-showcase commands
Mavrick-F Nov 4, 2026
e723997
fix(themes): refuse the desktop theme picker in browser commands
Mavrick-F Nov 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ of use.

| File | Author / source | Licence |
|---|---|---|
| Interface themes (`crates/ui-egui/themes/light.json`, `dark.json`) | The RustGIS project | Apache-2.0 |
| Sample data (`countries`, `countries_chn`, `cities`, `rivers`, `lakes` GeoJSON), embedded at build time from [rustgis-assets](https://github.com/opengeos/rustgis-assets/tree/main/data) | Natural Earth 1:110m, attributes trimmed; `countries_chn` is Natural Earth's China point of view (1:10m, simplified) | Public domain |
| QGIS screenshot (`qgis-world-atlas.webp` in [rustgis-assets](https://github.com/opengeos/rustgis-assets/tree/main/images)), on the [RustGIS and QGIS](docs/comparison/qgis.md) page | Taken by the RustGIS project: [QGIS](https://qgis.org) 4.2 showing the Natural Earth sample data above | QGIS is GPL-2.0-or-later; the data is public domain |
| QGIS test corpus (`crates/map/testdata/qgis/generated/`: styles, projects and their sample data) | Dominik Strebel ([@pick2510](https://github.com/pick2510)) for the RustGIS project: written by [QGIS](https://qgis.org) 4.2.3 through its API, from `generate.py` there; the data is made up | Apache-2.0 |
Expand Down
2 changes: 1 addition & 1 deletion apps/rustgis-python/tests/test_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_a_reload_holds_messages_until_the_page_starts_again(widget):
from_page(widget, {"type": "host"})
widget.scripts.clear()
widget._unready() # what loadStarted calls
widget.run_in_app("ui.theme", theme="dark")
widget.run_in_app("ui.theme", dark=True)
widget.add_geojson(POINT, name="Sites")
assert widget.scripts == []
from_page(widget, {"type": "host"})
Expand Down
1 change: 1 addition & 0 deletions crates/assistant/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub const PAGES: &[Page] = pages![
"python.md",
"mcp.md",
"plugins.md",
"themes.md",
"i18n.md",
"architecture.md",
"contributing.md",
Expand Down
2 changes: 1 addition & 1 deletion crates/ui-egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rfd = { workspace = true }
# Stopping an agent on this computer with every process it started: its process group, by the
# system call (as the plugins crate does).
[target.'cfg(unix)'.dependencies]
rustix = { version = "1.1", features = ["process"] }
rustix = { version = "1.1", features = ["process", "fs"] }

[dev-dependencies]
tempfile = "3"
Expand Down
20 changes: 15 additions & 5 deletions crates/ui-egui/examples/ui_shot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct RibbonSplitShowcase {
disable_enclosing_ui: bool,
long_labels: bool,
fonts_installed: bool,
applied_dark: Option<bool>,
applied_look: Option<(String, bool, u64)>,
}

fn split_tool_menu(ui: &mut egui::Ui, app: &mut RustGisApp) {
Expand All @@ -66,10 +66,12 @@ impl RibbonSplitShowcase {
theme::install_fonts(ui.ctx(), &[], None);
self.fonts_installed = true;
}
if self.applied_dark != Some(app.ui.dark) {
let tokens = if app.ui.dark { theme::Tokens::dark() } else { theme::Tokens::light() };
theme::apply(ui.ctx(), &tokens);
self.applied_dark = Some(app.ui.dark);
// The revision is part of the key: a reload with the same name still reapplies the look.
let look = (app.ui.theme_name.clone(), app.ui.dark, app.theme_revision());
if self.applied_look.as_ref() != Some(&look) {
let chosen = app.current_theme();
theme::apply(ui.ctx(), &chosen.tokens, &chosen.metrics);
self.applied_look = Some(look);
}
i18n::set_current(app.chosen_lang());
ui.heading("Ribbon split buttons");
Expand Down Expand Up @@ -182,6 +184,10 @@ fn main() {
.build_ui_state(
move |ui, app: &mut RustGisApp| {
if ribbon_split {
// The split showcase skips `logic`, the only place the scale reaches egui.
if (ui.ctx().zoom_factor() - app.ui.interface_scale).abs() > 0.001 {
ui.ctx().set_zoom_factor(app.ui.interface_scale);
}
split_showcase.show(ui, app);
} else {
let ctx = ui.ctx().clone();
Expand All @@ -194,6 +200,10 @@ fn main() {
for _ in 0..6 {
harness.step();
}
// The split showcase skips frame logic, so load user themes before scripted selection.
if ribbon_split && let Err(error) = harness.state_mut().run("ui.themeReload", Value::Null) {
eprintln!("ui.themeReload: {error}");
}
// The button the last drag holds down.
let mut held = egui::PointerButton::Primary;
// And the modifiers held with it.
Expand Down
12 changes: 8 additions & 4 deletions crates/ui-egui/src/chrome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ pub fn shortcuts(app: &mut RustGisApp, ctx: &egui::Context) {

/// Whether a UI command is available on the current platform.
pub(crate) fn command_available(id: &str, web: bool) -> bool {
!web || !matches!(id, "ui.checkUpdate" | "ui.mcpRelay")
!web || !matches!(id, "ui.checkUpdate" | "ui.mcpRelay" | "ui.themeLoad" | "ui.themeReload")
}

/// The `ui.*` commands Command Search lists: (id, label, ribbon location).
Expand Down Expand Up @@ -697,7 +697,11 @@ pub(crate) const UI_COMMANDS: &[(&str, &str, &str)] = &[
("ui.pane.sql", "SQL Pane", "Analyze › Workflows"),
("ui.pane.directions", "Directions", "Home › Navigate"),
("ui.pane.bookmarks", "Bookmarks Pane", "Home › Navigate › Bookmarks"),
("ui.theme", "Toggle Dark Mode", "View"),
("ui.theme", "Toggle Dark Mode", "Settings › Theme"),
("ui.themeFile", "Follow the System", "Settings › Theme"),
("ui.themeLoad", "Load a Theme from File…", "Settings › Theme"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug (confidence about 80%): Command Search lists two entries that do nothing in the browser build.

command_available (chrome.rs:663-665, not in this diff) only hides ui.checkUpdate and ui.mcpRelay on the web. Command Search (chrome.rs:996) filters every UI_COMMANDS entry through it, so "Load a Theme from File…" (ui.themeLoad, this line) and "Reload Themes" (ui.themeReload, next line) are offered in the browser.

On wasm, dialogs::pick_open returns None (dialogs.rs:1832). ui.themeLoad then returns Ok(Value::Null) with no notice, so the user sees nothing happen. docs/themes.md says the browser does not offer Load a Theme from File…, and the menu already hides both items there (if folder).

Adding both ids to the web exclusion in command_available keeps Command Search in step with the menu and the docs:

    !web || !matches!(id, "ui.checkUpdate" | "ui.mcpRelay" | "ui.themeLoad" | "ui.themeReload")

A test that command_available("ui.themeLoad", true) is false, and stays true on desktop, would cover it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e06e7f0. The shared command-availability filter now excludes both theme-file loading and reloading on the web, so Command Search and shortcut lists match the menu. The existing web-row regression checks both commands remain available on desktop and are absent on web even with saved bindings. Targeted regressions, full CI, locked wasm and all hooks passed. I am integrating newer main before landing.

("ui.themeReload", "Reload Themes", "Settings › Theme"),
("ui.scale", "Reset Interface Scale", "Settings › Theme"),
("ui.map.gpu", "Toggle GPU Rendering", "View"),
("ui.importShapefile", "Import Shapefile with Projection…", "Home › Add"),
("ui.measurementUnits", "Toggle Imperial Measurements", "Home › Inspect › Measure"),
Expand Down Expand Up @@ -993,8 +997,8 @@ pub fn command_search(app: &mut RustGisApp, ctx: &egui::Context) {
}
}
for &(id, label, loc) in UI_COMMANDS {
// The web app always serves the latest release (no Check for Updates button) and is
// one process a loopback relay could not reach (`ui.mcpRelay` is desktop only).
// Match the platform availability used by the shortcut editor, including desktop
// theme files and the loopback relay.
if !command_available(id, cfg!(target_arch = "wasm32")) {
continue;
}
Expand Down
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/az.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simulyasiya et
Light İşıqlı
Dark Qaranlıq
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/bn.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ সিমুলেট করুন
Light হালকা
Dark গাঢ়
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/de.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simulieren
Light Hell
Dark Dunkel
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/es.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simular
Light Claro
Dark Oscuro
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/fa.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ شبیه‌سازی
Light روشن
Dark تاریک
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/fr.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simuler
Light Clair
Dark Sombre
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/id.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4025,3 +4025,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simulasikan
Light Terang
Dark Gelap
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/it.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simula
Light Chiaro
Dark Scuro
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/ja.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ シミュレート
Light ライト
Dark ダーク
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/ka.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ სიმულაცია
Light ღია
Dark მუქი
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/ko.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ 시뮬레이션
Light 라이트
Dark 다크
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/nl.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simuleren
Light Licht
Dark Donker
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/pl.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Symuluj
Light Jasny
Dark Ciemny
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/pt.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Simular
Light Claro
Dark Escuro
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/ru.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Смоделировать
Light Светлая
Dark Тёмная
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/tr.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Canlandır
Light Açık
Dark Koyu
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/vi.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ Mô phỏng
Light Sáng
Dark Tối
2 changes: 2 additions & 0 deletions crates/ui-egui/src/i18n/zh.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4024,3 +4024,5 @@ Zoom: the map's zoom level, as web maps count it. Bearing: the direction the top
⌘+Enter ⌘+Enter
⌘K ⌘K
▶ Simulate ▶ 模拟
Light 浅色
Dark 深色
Loading
Loading