Skip to content

Added property to evaulate platform theme mode (iOS, web, Windows)#4408

Merged
freakboy3742 merged 6 commits into
beeware:mainfrom
YuDavidCao:feat/platform-dark-mode-support
May 26, 2026
Merged

Added property to evaulate platform theme mode (iOS, web, Windows)#4408
freakboy3742 merged 6 commits into
beeware:mainfrom
YuDavidCao:feat/platform-dark-mode-support

Conversation

@YuDavidCao
Copy link
Copy Markdown
Contributor

@YuDavidCao YuDavidCao commented May 18, 2026

Added property to evaulate platform theme mode

  • iOS (tested)
  • web (tested)
  • Windows (yet to be tested)

Fixes #2841

Credit to @Rjvs

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by: Cursor - for understanding the code structure

Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

The Winforms backend won't be accurate, because .NET 4 support for dark mode doesn't exist. However, AFAICT this will expose the user's preference for dark mode, which should be accurate, and could be manually reflected by the user, so it's better than the current 🤷 API response.

The only issue I'm seeing with this PR is a coverage gap - this is the source of the two Windows failures. The implication is that the key isn't set on the two test machines (which seems plausible - there's no reason for a dark mode preference to be set on a CI machine). We might need to mark that entire branch "no-cover" since we can't reliably test the outcome (if only because we don't know how the end-user's machine is configured.)

Comment thread changes/4408.feature.md Outdated
Comment thread winforms/src/toga_winforms/app.py Outdated
@freakboy3742
Copy link
Copy Markdown
Member

Merging with the 2 CI failures; those are known issues (#4415 and #4427) that I'm currently working on.

@freakboy3742 freakboy3742 merged commit db35ff3 into beeware:main May 26, 2026
61 of 63 checks passed
audreydng pushed a commit to audreydng/toga that referenced this pull request May 27, 2026
…eeware#4408)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add property to evaluate if app is in dark mode

2 participants