[PR #340] Detect light/dark OS theme #486

Open
opened 2026-02-28 14:33:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jpochyla/psst/pull/340
Author: @nickolasclarke
Created: 10/3/2022
Status: 🔄 Open

Base: mainHead: master


📝 Commits (8)

📊 Changes

5 files changed (+455 additions, -174 deletions)

View changed files

📝 Cargo.lock (+431 -161)
📝 psst-gui/Cargo.toml (+1 -0)
📝 psst-gui/src/data/config.rs (+1 -0)
📝 psst-gui/src/ui/preferences.rs (+6 -2)
📝 psst-gui/src/ui/theme.rs (+16 -11)

📄 Description

This adds an option to use the System preferences to set the theme at launch. It uses the dark-light crate to do so.

This is my very first time touching Rust, Druid, and frankly any sort of native GUI framework. While it should be relatively simple to have a long-running process to call setup_system_theme or similar continuously, it is not clear to me where that is best done within Druid. Unfortunately, dark-light does not have a method check and yield state change asynchronously. If you can point me in the right direction for where to put an infinite loop like that, I'll gladly update this PR.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jpochyla/psst/pull/340 **Author:** [@nickolasclarke](https://github.com/nickolasclarke) **Created:** 10/3/2022 **Status:** 🔄 Open **Base:** `main` ← **Head:** `master` --- ### 📝 Commits (8) - [`16bc21e`](https://github.com/jpochyla/psst/commit/16bc21eddecc8f04a32738e4f1a9c0b93f6026ce) add basic system theme option - [`a039bb2`](https://github.com/jpochyla/psst/commit/a039bb2c8842391d5fa0587f095cb2034a318a4c) bump reqs - [`544cdaa`](https://github.com/jpochyla/psst/commit/544cdaa1b82623c1550332f4b484bfe12a141ef9) Remove dbus by using zbus variant - [`497ead7`](https://github.com/jpochyla/psst/commit/497ead7f83bedded64f0a12aa93d0aa0a1cac435) bump dark-light - [`0886a17`](https://github.com/jpochyla/psst/commit/0886a170cfe574df8b754e7c84dd7b1489da5e39) Merge remote-tracking branch 'upstream/master' - [`4590842`](https://github.com/jpochyla/psst/commit/45908424a59fb0751f7f6c15607776df44e19a95) reset Cargo lock - [`e6695f2`](https://github.com/jpochyla/psst/commit/e6695f2b0c91acfa53e8780e8685dd1a000cfec8) Lint - [`dd46b02`](https://github.com/jpochyla/psst/commit/dd46b02c8517309da5493757ff85e474e89dc72b) Add lock ### 📊 Changes **5 files changed** (+455 additions, -174 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+431 -161) 📝 `psst-gui/Cargo.toml` (+1 -0) 📝 `psst-gui/src/data/config.rs` (+1 -0) 📝 `psst-gui/src/ui/preferences.rs` (+6 -2) 📝 `psst-gui/src/ui/theme.rs` (+16 -11) </details> ### 📄 Description This adds an option to use the System preferences to set the theme at launch. It uses the [dark-light](https://crates.io/crates/dark-light) crate to do so. This is my very first time touching Rust, Druid, and frankly any sort of native GUI framework. While it should be relatively simple to have a long-running process to call `setup_system_theme` or similar continuously, it is not clear to me where that is best done within Druid. Unfortunately, `dark-light` does not have a method check and yield state change asynchronously. If you can point me in the right direction for where to put an infinite loop like that, I'll gladly update this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#486
No description provided.