Skip to content

Simulator: add Dark/Light Mode toggle to the Simulate menu#4871

Merged
shai-almog merged 1 commit into
masterfrom
simulator-dark-light-mode-toggle
May 6, 2026
Merged

Simulator: add Dark/Light Mode toggle to the Simulate menu#4871
shai-almog merged 1 commit into
masterfrom
simulator-dark-light-mode-toggle

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a Dark/Light Mode submenu under the simulator's Simulate menu with three options: Dark Mode, Light Mode, and Unsupported (default).
  • Selecting an option flips Display.isDarkMode() (Boolean.TRUE / Boolean.FALSE / null) and calls refreshSkin(...) so themes that branch on @darkModeBool re-render immediately.
  • The choice is persisted in Preferences under cn1.simulator.darkMode and restored on simulator startup. Default is still Unsupported, matching prior behavior.

The previous (commented-out) skeleton in JavaSEPort.installMenu is replaced by this active implementation.

Test plan

  • Launch the simulator and confirm Simulate → Dark/Light Mode shows the three radio items.
  • In an app whose theme uses @darkModeBool / dark-mode CSS media queries, toggle Dark / Light / Unsupported and verify the UI re-themes immediately without restart.
  • Restart the simulator and verify the selected mode is restored from preferences.
  • With Unsupported selected, confirm CN.isDarkMode() returns null (so theme behavior matches platforms that don't report dark mode).

🤖 Generated with Claude Code

Adds a Dark/Light Mode submenu (Dark / Light / Unsupported) under the
simulator's Simulate menu that drives Display.isDarkMode(). The choice
is persisted via Preferences (cn1.simulator.darkMode) and triggers
refreshSkin() so themes that branch on @darkModeBool re-evaluate
immediately. Default remains "Unsupported" (null), preserving the
prior behavior on platforms that don't report a dark-mode state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 6, 2026

Compared 7 screenshots: 7 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog shai-almog merged commit e6f1e4b into master May 6, 2026
12 checks passed
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.

1 participant