Commit 5f3970fc authored by Sebastian Ramacher's avatar Sebastian Ramacher

Add text colors for links (fixes #211)

parent 7d294ef9
Pipeline #355 passed with stages
in 1 minute and 56 seconds
......@@ -43,6 +43,14 @@ General settings
:type: String
:default: #9FBC00
.. describe:: highlight-fg
Defines the color that is for text when highlighting parts of the document
(e.g.: numbers for links)
:type: String
:default: #FFFFFF
.. describe:: highlight-active-color
Defines the color that is used to show the current selected highlighted
......
......@@ -57,6 +57,8 @@ cb_color_change(girara_session_t* session, const char* name,
const char* string_value = (const char*) value;
if (g_strcmp0(name, "highlight-color") == 0) {
parse_color(&zathura->ui.colors.highlight_color, string_value);
} else if (g_strcmp0(name, "highlight-fg") == 0) {
parse_color(&zathura->ui.colors.highlight_color_fg, string_value);
} else if (g_strcmp0(name, "highlight-active-color") == 0) {
parse_color(&zathura->ui.colors.highlight_color_active, string_value);
} else if (g_strcmp0(name, "recolor-darkcolor") == 0) {
......@@ -209,15 +211,17 @@ config_load_default(zathura_t* zathura)
int_value = 2000;
girara_setting_add(gsession, "jumplist-size", &int_value, INT, false, _("Number of positions to remember in the jumplist"), cb_jumplist_change, NULL);
girara_setting_add(gsession, "recolor-darkcolor", "#FFFFFF", STRING, false, _("Recoloring (dark color)"), cb_color_change, NULL);
girara_setting_add(gsession, "recolor-lightcolor", "#000000", STRING, false, _("Recoloring (light color)"), cb_color_change, NULL);
girara_setting_add(gsession, "highlight-color", NULL, STRING, false, _("Color for highlighting"), cb_color_change, NULL);
girara_setting_add(gsession, "recolor-darkcolor", "#FFFFFF", STRING, false, _("Recoloring (dark color)"), cb_color_change, NULL);
girara_setting_add(gsession, "recolor-lightcolor", "#000000", STRING, false, _("Recoloring (light color)"), cb_color_change, NULL);
girara_setting_add(gsession, "highlight-color", NULL, STRING, false, _("Color for highlighting"), cb_color_change, NULL);
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_add(gsession, "highlight-fg", NULL, STRING, false, _("Foreground color for highlighting"), cb_color_change, NULL);
girara_setting_set(gsession, "highlight-fg", "#000000");
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_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_add(gsession, "render-loading-fg", NULL, STRING, false, _("'Loading ...' foreground color"), cb_color_change, NULL);
girara_setting_set(gsession, "render-loading-fg", "#000000");
girara_setting_add(gsession, "index-fg", "#DDDDDD", STRING, true, _("Index mode foreground color"), NULL, NULL);
......
......@@ -587,7 +587,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
cairo_fill(cairo);
/* draw text */
cairo_set_source_rgba(cairo, 0, 0, 0, 1);
const GdkRGBA color_fg = priv->zathura->ui.colors.highlight_color_fg;
cairo_set_source_rgba(cairo, color_fg.red, color_fg.green, color_fg.blue, transparency);
cairo_move_to(cairo, rectangle.x1 + 1, rectangle.y2 - 1);
char* link_number = g_strdup_printf("%i", priv->links.offset + ++link_counter);
cairo_show_text(cairo, link_number);
......
......@@ -107,6 +107,7 @@ struct zathura_s
struct
{
GdkRGBA highlight_color; /**< Color for highlighting */
GdkRGBA highlight_color_fg; /**< Color for highlighting (foreground) */
GdkRGBA highlight_color_active; /** Color for highlighting */
GdkRGBA render_loading_bg; /**< Background color for render "Loading..." */
GdkRGBA render_loading_fg; /**< Foreground color for render "Loading..." */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment