Some checks failed
Security Scan / security (push) Failing after 26s
Environment: - QueryFocusFollowsMouse IPC query - 9 new tests (accent colour, file manager, focus follows mouse) Context Menu: - TaskUpdate (remove-then-add semantics) - TaskDestroy (remove + release) - QueryGetAll - OnShutdown cleanup - 12 new tests All 17 packages build and test clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
902 B
Go
32 lines
902 B
Go
// pkg/environment/platform.go
|
|
package environment
|
|
|
|
// Platform abstracts environment and theme backend queries.
|
|
type Platform interface {
|
|
IsDarkMode() bool
|
|
Info() EnvironmentInfo
|
|
AccentColour() string
|
|
OpenFileManager(path string, selectFile bool) error
|
|
HasFocusFollowsMouse() bool
|
|
OnThemeChange(handler func(isDark bool)) func() // returns cancel func
|
|
}
|
|
|
|
// EnvironmentInfo contains system environment details.
|
|
type EnvironmentInfo struct {
|
|
OS string `json:"os"`
|
|
Arch string `json:"arch"`
|
|
Debug bool `json:"debug"`
|
|
Platform PlatformInfo `json:"platform"`
|
|
}
|
|
|
|
// PlatformInfo contains platform-specific details.
|
|
type PlatformInfo struct {
|
|
Name string `json:"name"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// ThemeInfo contains the current theme state.
|
|
type ThemeInfo struct {
|
|
IsDark bool `json:"isDark"`
|
|
Theme string `json:"theme"` // "dark" or "light"
|
|
}
|