diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-07-05 13:50:56 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-07-05 13:52:10 +0200 |
commit | 4afabfe7a056ae6be0b8fd9912d1fdba6056f73a (patch) | |
tree | 35eefc843be5fc3bada7ce83976cd19dfe4a9082 | |
parent | ed416310bd42f78967893d6f333b6ddb0be456c7 (diff) | |
download | gterm-4afabfe7a056ae6be0b8fd9912d1fdba6056f73a.tar.gz |
dark mode detect tweak
-rw-r--r-- | gload.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -130,7 +130,7 @@ static gboolean gload_draw(GtkWidget *widget, cairo_t *cr, gpointer data) gload *gl = data; GtkStyleContext *context; GdkRGBA normal, dimmed; - guint width, height, i, idx, max; + guint width, height, i, idx, max, brightness; bool darkmode; context = gtk_widget_get_style_context(widget); @@ -138,7 +138,12 @@ static gboolean gload_draw(GtkWidget *widget, cairo_t *cr, gpointer data) height = gtk_widget_get_allocated_height(widget); gtk_style_context_get_color(context, GTK_STATE_FLAG_NORMAL, &normal); - darkmode = gload_brightness(&normal) > 50; + brightness = gload_brightness(&normal); + darkmode = brightness > 50; +#if 0 + fprintf(stderr, "%s: foreground brightness %d/100 -> darkmode %s\n", __func__, + brightness, darkmode ? "yes" : "no"); +#endif if (darkmode) gload_darken(&normal, &dimmed, 30); else |