# HG changeset patch
# Node ID 0554e5dfa799
# Parent  0c5868af6230
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -3575,7 +3575,7 @@
 		}
 	}
 
-	dim_grey = pidgin_style_context_is_dark() ? "light slate grey" : "dim grey";
+	dim_grey = "dim grey";
 
 	/* choose the colors of the text */
 	name_color = NULL;
@@ -5064,15 +5064,7 @@
 			ihrs = (t - idle_secs) / 3600;
 			imin = ((t - idle_secs) / 60) % 60;
 
-			if(selected) {
-				idle = g_strdup_printf("%d:%02d", ihrs, imin);
-			} else {
-				idle = g_strdup_printf("<span color='%s'>%d:%02d</span>",
-				                       pidgin_style_context_is_dark()
-				                               ? "light slate grey"
-				                               : "dim grey",
-				                       ihrs, imin);
-			}
+			idle = g_strdup_printf("%d:%02d", ihrs, imin);
 		}
 	}
 
diff --git a/pidgin/meson.build b/pidgin/meson.build
--- a/pidgin/meson.build
+++ b/pidgin/meson.build
@@ -51,7 +51,6 @@
 	'pidginprotocolchooser.c',
 	'pidginprotocolstore.c',
 	'pidginscrollbook.c',
-	'pidginstylecontext.c',
 	'pidgintalkatu.c',
 	'prefs/pidginprefs.c',
 	'prefs/pidgincredentialproviderrow.c',
@@ -110,7 +109,6 @@
 	'pidginprotocolchooser.h',
 	'pidginprotocolstore.h',
 	'pidginscrollbook.h',
-	'pidginstylecontext.h',
 	'pidgintalkatu.h',
 ]
 
diff --git a/pidgin/pidgincolor.c b/pidgin/pidgincolor.c
--- a/pidgin/pidgincolor.c
+++ b/pidgin/pidgincolor.c
@@ -37,7 +37,8 @@
 
     g_return_if_fail(color != NULL);
 
-    pidgin_style_context_get_background_color(&background);
+#warning figure out how to get the background color
+    gdk_rgba_parse(&background, "#FFFFFFFF");
 
     /* hash the string and get the first 2 bytes of the digest */
     checksum = g_checksum_new(G_CHECKSUM_SHA1);
diff --git a/pidgin/pidginstylecontext.h b/pidgin/pidginstylecontext.h
deleted file mode 100644
--- a/pidgin/pidginstylecontext.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Pidgin - Internet Messenger
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- *
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this library; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
-# error "only <pidgin.h> may be included directly"
-#endif
-
-#ifndef PIDGIN_STYLE_CONTEXT_H
-#define PIDGIN_STYLE_CONTEXT_H
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-/**
- * pidgin_style_context_get_background_color:
- * @color: (out): A return address of a #GdkRGBA for the background color.
- *
- * Gets the background color for #GtkWindow in the currently selected theme
- * and sets @color to that value.
- *
- * Since: 3.0.0
- */
-void pidgin_style_context_get_background_color(GdkRGBA *color);
-
-/**
- * pidgin_style_context_is_dark:
- *
- * Gets whether or not dark mode is enabled.
- *
- * Returns: %TRUE if dark mode is enabled and foreground colours should be
- *          inverted.
- *
- * Since: 3.0.0
- */
-gboolean pidgin_style_context_is_dark(void);
-
-G_END_DECLS
-
-#endif /* PIDGIN_STYLE_CONTEXT_H */
-
diff --git a/pidgin/pidginstylecontext.c b/pidgin/pidginstylecontext.c
deleted file mode 100644
--- a/pidgin/pidginstylecontext.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Pidgin - Internet Messenger
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- *
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this library; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#include "pidgin/pidginstylecontext.h"
-
-/* Assume light mode */
-static gboolean dark_mode_have_cache = FALSE;
-static gboolean dark_mode_cached_value = FALSE;
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-void
-pidgin_style_context_get_background_color(GdkRGBA *color) {
-	/* This value will leak, we could put a shutdown function in but right now
-	 * that seems like a bit much for a few bytes.
-	 */
-	static GdkRGBA *background = NULL;
-
-	if(g_once_init_enter(&background)) {
-		GdkRGBA *bg = NULL;
-		GtkStyleContext *context = NULL;
-		GtkWidget *window = NULL;
-
-		/* We create a window to get its background color from its style
-		 * context.  This _is_ doable without creating a window, but you still
-		 * need the window class and about four times as much code, so that's
-		 * why we do it this way.
-		 */
-		window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-		context = gtk_widget_get_style_context(window);
-
-		gtk_style_context_get(context, GTK_STATE_FLAG_NORMAL,
-		                      GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &bg,
-		                      NULL);
-		gtk_widget_destroy(window);
-
-		g_once_init_leave(&background, bg);
-	}
-
-	*color = *background;
-}
-
-gboolean
-pidgin_style_context_is_dark(void) {
-	GdkRGBA bg;
-	gdouble luminance = 0.0;
-
-	if(dark_mode_have_cache) {
-		return dark_mode_cached_value;
-	}
-
-	pidgin_style_context_get_background_color(&bg);
-
-	/* 709 coefficients from https://en.wikipedia.org/wiki/Luma_(video) */
-	luminance = (0.2126 * bg.red) + (0.7152 * bg.green) + (0.0722 * bg.blue);
-
-	dark_mode_cached_value = (luminance < 0.5);
-	dark_mode_have_cache = TRUE;
-
-	return dark_mode_cached_value;
-}
