Match window border color to app theme rather than OS theme (#958)
* MacOS: match window chrome to app light/dark mode when app setting is different from OS * match window border to app theme on Windows
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
//go:build darwin
|
||||
|
||||
package controller
|
||||
|
||||
/*
|
||||
void setWindowDarkMode(void* windowPtr, int useDarkMode);
|
||||
*/
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
||||
// setWindowDarkTheme takes an unsafe.Pointer referencing the macOS NSWindow
|
||||
// and explicitly applies or clears the dark mode appearance.
|
||||
// Mode arg: 0 = auto, 1 = dark, 2 = light
|
||||
func setWindowDarkTheme(nsWindowPtr uintptr, mode int) {
|
||||
C.setWindowDarkMode(unsafe.Pointer(nsWindowPtr), C.int(mode))
|
||||
}
|
||||
Reference in New Issue
Block a user