Implement colors for 'Loading ...'.

Thanks to oblique for the patch.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2013-02-23 17:33:03 +01:00
parent 0e3efe0504
commit 35adeacbf5
4 changed files with 28 additions and 2 deletions

View file

@ -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);

View file

@ -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...");

View file

@ -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;

View file

@ -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