diff --git a/config.c b/config.c index 8eaf8c7..2a3ca9c 100644 --- a/config.c +++ b/config.c @@ -52,6 +52,10 @@ cb_color_change(girara_session_t* session, const char* name, gdk_color_parse(string_value, &(zathura->ui.colors.recolor_dark_color)); } else if (g_strcmp0(name, "recolor-lightcolor") == 0) { gdk_color_parse(string_value, &(zathura->ui.colors.recolor_light_color)); + } else if (g_strcmp0(name, "render-loading-bg") == 0) { + gdk_color_parse(string_value, &(zathura->ui.colors.render_loading_bg)); + } else if (g_strcmp0(name, "render-loading-fg") == 0) { + gdk_color_parse(string_value, &(zathura->ui.colors.render_loading_fg)); } render_all(zathura); @@ -165,6 +169,10 @@ config_load_default(zathura_t* zathura) girara_setting_set(gsession, "highlight-color", "#9FBC00"); girara_setting_add(gsession, "highlight-active-color", NULL, STRING, false, _("Color for highlighting (active)"), cb_color_change, NULL); girara_setting_set(gsession, "highlight-active-color", "#00BC00"); + girara_setting_add(gsession, "render-loading-bg", NULL, STRING, false, _("'Loading ...' background color"), cb_color_change, NULL); + girara_setting_set(gsession, "render-loading-bg", "#FFFFFF"); + girara_setting_add(gsession, "render-loading-fg", NULL, STRING, false, _("'Loading ...' foreground color"), cb_color_change, NULL); + girara_setting_set(gsession, "render-loading-fg", "#000000"); bool_value = false; girara_setting_add(gsession, "recolor", &bool_value, BOOLEAN, false, _("Recolor pages"), cb_setting_recolor_change, NULL); diff --git a/page-widget.c b/page-widget.c index 529f3f0..58ccd71 100644 --- a/page-widget.c +++ b/page-widget.c @@ -436,7 +436,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) GdkColor color = priv->zathura->ui.colors.recolor_light_color; cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); } else { - cairo_set_source_rgb(cairo, 1, 1, 1); + GdkColor color = priv->zathura->ui.colors.render_loading_bg; + cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); } cairo_rectangle(cairo, 0, 0, page_width, page_height); cairo_fill(cairo); @@ -450,7 +451,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) GdkColor color = priv->zathura->ui.colors.recolor_dark_color; cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); } else { - cairo_set_source_rgb(cairo, 0, 0, 0); + GdkColor color = priv->zathura->ui.colors.render_loading_fg; + cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); } const char* text = _("Loading..."); diff --git a/zathura.h b/zathura.h index 6970063..26753f7 100644 --- a/zathura.h +++ b/zathura.h @@ -57,6 +57,8 @@ struct zathura_s GdkColor recolor_light_color; /**< Light color for recoloring */ GdkColor highlight_color; /**< Color for highlighting */ GdkColor highlight_color_active; /** Color for highlighting */ + GdkColor render_loading_bg; /**< Background color for render "Loading..." */ + GdkColor render_loading_fg; /**< Foreground color for render "Loading..." */ } colors; GtkWidget *page_widget_alignment; diff --git a/zathurarc.5.rst b/zathurarc.5.rst index ae58bc7..6630331 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -594,6 +594,20 @@ Defines if the "Loading..." text should be displayed if a page is rendered. * Value type: Boolean * Default value: true +render-loading-bg +^^^^^^^^^^^^^^^^^ +Defines the background color that is used for the "Loading..." text. + +* Value type: String +* Default value: #FFFFFF + +render-loading-fg +^^^^^^^^^^^^^^^^^ +Defines the foreground color that is used for the "Loading..." text. + +* Value type: String +* Default value: #000000 + scroll-hstep ^^^^^^^^^^^^ Defines the horizontal step size of scrolling by calling the scroll command once