X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fimage.c;h=1326ff1f1786d99645d12ffce149920e3d941227;hp=f73762c485a7a837e17b1ac05065ef32375d2605;hb=a62c430abe5d8fecb86d5ec2a339b87207b54950;hpb=6fcf13826649f2447b75445eae5f285e2788ff9e diff --git a/src/image.c b/src/image.c index f73762c4..1326ff1f 100644 --- a/src/image.c +++ b/src/image.c @@ -1888,6 +1888,12 @@ void image_background_set_color(ImageWindow *imd, GdkColor *color) void image_background_set_color_from_options(ImageWindow *imd, gboolean fullscreen) { GdkColor *color = NULL; +#if GTK_CHECK_VERSION(3,0,0) + GdkColor theme_color; + GdkRGBA bg_color; + GtkStyleContext *style_context; + LayoutWindow *lw = NULL; +#endif if ((options->image.use_custom_border_color && !fullscreen) || (options->image.use_custom_border_color_in_fullscreen && fullscreen)) @@ -1895,6 +1901,22 @@ void image_background_set_color_from_options(ImageWindow *imd, gboolean fullscre color = &options->image.border_color; } +#if GTK_CHECK_VERSION(3,0,0) + else + { + if (!layout_valid(&lw)) return; + + style_context = gtk_widget_get_style_context(lw->window); + gtk_style_context_get_background_color(style_context, GTK_STATE_FLAG_NORMAL, &bg_color); + + theme_color.red = bg_color.red * 65535; + theme_color.green = bg_color.green * 65535; + theme_color.blue = bg_color.blue * 65535; + + color = &theme_color; + } +#endif + image_background_set_color(imd, color); }