-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Feature]support WindowSetSystemDefaultTheme,WindowSetLightTheme,WindowSetDarkTheme for darwin(#4654) #4656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request adds macOS support for window appearance and theme functions (WindowSetSystemDefaultTheme, WindowSetLightTheme, WindowSetDarkTheme). A new SetAppearance method is implemented across Objective-C and Go layers, routing theme settings through the Darwin-specific frontend code. Documentation is updated to reflect unsupported status on Linux instead of Windows-only. Changes
Sequence DiagramsequenceDiagram
participant App as Application Layer
participant WinGo as window.go
participant C as C Bridge (Application.m)
participant WailsCtx as WailsContext
participant macOS as macOS AppKit
App->>WinGo: frontend.SetAppearance("light")
WinGo->>WinGo: Allocate C string
WinGo->>C: SetAppearance(ctx, "light")
C->>C: Dispatch to main thread
C->>WailsCtx: [ctx SetAppearance:@"light"]
WailsCtx->>WailsCtx: Resolve NSAppearance
WailsCtx->>macOS: window.appearance = resolved
macOS-->>WailsCtx: ✓ Applied
WailsCtx-->>C: ✓
C-->>WinGo: ✓
WinGo->>WinGo: Free C string
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes The changes follow a straightforward vertical implementation pattern: a new feature is added consistently across Objective-C header/implementation, then wrapped through Go bindings and documented. No existing logic is modified; additions are self-contained and repetitive in nature. All layers demonstrate the same pattern with minimal conditional logic. Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Description
Support functions: WindowSetSystemDefaultTheme,WindowSetLightTheme,WindowSetDarkTheme for darwin(basing on v2.10.2) and update documents. And it test OK in my device.
Feature #4654 (issue)
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor.If you checked Linux, please specify the distro and version.
Test Configuration
wails on feature/4654-runtime-SetAppearance-for-darwin ❯ wails doctor Wails Doctor # Wails Version | v2.10.2 # System ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ | OS | MacOS | | Version | 15.6.1 | | ID | 24G90 | | Branding | | | Go Version | go1.24.4 | | Platform | darwin | | Architecture | arm64 | | CPU 1 | Apple M1 | | CPU 2 | Apple M1 | | GPU | Chipset Model: Apple M1 Type: GPU Bus: Built-In Total Number of Cores: 8 Vendor: Apple (0x106b) Metal Support: Metal 3 | | Memory | 16GB | └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ # Dependencies ┌────────────────────────────────────────────────────────────────────────┐ | Dependency | Package Name | Status | Version | | Xcode command line tools | N/A | Installed | 2410 | | Nodejs | N/A | Installed | 24.3.0 | | npm | N/A | Installed | 11.4.2 | | *Xcode | N/A | Installed | 26.0.1 (17A400) | | *upx | N/A | Available | | | *nsis | N/A | Available | | | | └─────────────────────── * - Optional Dependency ────────────────────────┘ # Diagnosis Optional package(s) installation details: - upx : Available at https://upx.github.io/ - nsis : More info at https://wails.io/docs/guides/windows-installer/ SUCCESS Your system is ready for Wails development! ♥ If Wails is useful to you or your company, please consider sponsoring the project: https://github.com/sponsors/leaanthonyGO Unit Test:
Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit
New Features
Documentation