91 bool is_locked()
const {
return theme_locked_ || tracker_.is_locked(); }
108 bool theme_locked_ =
false;
109 std::function<void(
const Theme&)> theme_callback_;
Tracks OS-level appearance (light/dark mode) and auto-switches themes.
Definition appearance_tracker.hpp:24
bool is_locked() const
Check if appearance is locked.
Definition appearance_tracker.hpp:47
void unlock()
Unlock and resume tracking OS appearance.
void lock(Appearance appearance)
Lock to a specific appearance, ignoring OS changes.
void on_appearance_changed(std::function< void(Appearance)> callback)
Register a callback for appearance changes.
Appearance current_appearance() const
Get current system appearance.
Appearance locked_appearance() const
Get the locked appearance (only valid when is_locked() is true).
Definition appearance_tracker.hpp:50
bool poll()
Poll for appearance changes.
void set_mode(ThemeMode m)
User-facing theme preference.
const AppearanceTracker & tracker() const
Definition appearance_tracker.hpp:95
bool poll()
Poll for changes. Returns true if the active theme changed.
AppearanceTracker & tracker()
Access the underlying tracker for direct appearance queries.
Definition appearance_tracker.hpp:94
bool is_locked() const
Check if a specific theme is locked.
Definition appearance_tracker.hpp:91
const Theme & active_theme() const
Get the active theme based on current appearance (or locked theme).
void unlock()
Unlock and resume automatic theme switching.
void on_theme_changed(std::function< void(const Theme &)> callback)
Register a callback for when the active theme changes.
void lock_theme(Theme theme)
Lock to a specific theme, ignoring appearance tracking.
void set_theme_pair(Theme light_theme, Theme dark_theme)
Set the theme pair for automatic appearance-based switching.
void lock_appearance(Appearance appearance)
Lock to an appearance (light/dark) but still use the theme pair.
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
ThemeMode
User-facing theme preference.
Definition appearance_tracker.hpp:17
@ system
Definition appearance_tracker.hpp:17
Appearance
System appearance mode.
Definition appearance_tracker.hpp:11
@ light
Definition appearance_tracker.hpp:11
@ dark
Definition appearance_tracker.hpp:11
@ m
Definition input_events.hpp:40