mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-25 05:15:33 +00:00
Update src/applib/warning_colors.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
parent
06a0a75349
commit
e4c9afeed0
@@ -21,13 +21,8 @@ Copyright:
|
||||
/// Check if a dark GTK theme is currently active
|
||||
inline bool is_dark_theme_active()
|
||||
{
|
||||
// Only check GTK settings if GTK has been initialized
|
||||
// This avoids crashes/warnings in non-GUI executables
|
||||
if (Gtk::Main::level() == 0) {
|
||||
return false; // Default to light theme if GTK not initialized
|
||||
}
|
||||
|
||||
// Try to get the GTK settings to check for dark theme preference
|
||||
// Try to get the GTK settings to check for dark theme preference.
|
||||
// If GTK is not available or not initialized, get_default() will return null.
|
||||
Glib::RefPtr<Gtk::Settings> settings = Gtk::Settings::get_default();
|
||||
if (settings) {
|
||||
// Check if the application prefers dark theme
|
||||
|
||||
Reference in New Issue
Block a user