From e4c9afeed0213aef83fda7b449bf56985e38355f Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Sat, 7 Mar 2026 17:39:35 +0100 Subject: [PATCH] Update src/applib/warning_colors.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/applib/warning_colors.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/applib/warning_colors.h b/src/applib/warning_colors.h index 3f5157f..3f75cea 100644 --- a/src/applib/warning_colors.h +++ b/src/applib/warning_colors.h @@ -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 settings = Gtk::Settings::get_default(); if (settings) { // Check if the application prefers dark theme