Commit 43c3ba86 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Replace some more GdkColors with GdkRGBA

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent cff05ac1
......@@ -52,9 +52,9 @@ cb_color_change(girara_session_t* session, const char* name,
char* string_value = (char*) value;
if (g_strcmp0(name, "highlight-color") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color));
gdk_rgba_parse(&(zathura->ui.colors.highlight_color), string_value);
} else if (g_strcmp0(name, "highlight-active-color") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color_active));
gdk_rgba_parse(&(zathura->ui.colors.highlight_color_active), string_value);
} else if (g_strcmp0(name, "recolor-darkcolor") == 0) {
if (zathura->sync.render_thread != NULL) {
zathura_renderer_set_recolor_colors_str(zathura->sync.render_thread, NULL, string_value);
......@@ -64,9 +64,9 @@ cb_color_change(girara_session_t* session, const char* name,
zathura_renderer_set_recolor_colors_str(zathura->sync.render_thread, string_value, NULL);
}
} else if (g_strcmp0(name, "render-loading-bg") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.render_loading_bg));
gdk_rgba_parse(&(zathura->ui.colors.render_loading_bg), string_value);
} else if (g_strcmp0(name, "render-loading-fg") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.render_loading_fg));
gdk_rgba_parse(&(zathura->ui.colors.render_loading_fg), string_value);
}
render_all(zathura);
......
......@@ -416,8 +416,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, zathura_link_get_position(link));
/* draw position */
GdkColor color = priv->zathura->ui.colors.highlight_color;
cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency);
const GdkRGBA color = priv->zathura->ui.colors.highlight_color;
cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency);
cairo_rectangle(cairo, rectangle.x1, rectangle.y1,
(rectangle.x2 - rectangle.x1), (rectangle.y2 - rectangle.y1));
cairo_fill(cairo);
......@@ -441,11 +441,11 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
/* draw position */
if (idx == priv->search.current) {
GdkColor color = priv->zathura->ui.colors.highlight_color_active;
cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency);
const GdkRGBA color = priv->zathura->ui.colors.highlight_color_active;
cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency);
} else {
GdkColor color = priv->zathura->ui.colors.highlight_color;
cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency);
const GdkRGBA color = priv->zathura->ui.colors.highlight_color;
cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency);
}
cairo_rectangle(cairo, rectangle.x1, rectangle.y1,
(rectangle.x2 - rectangle.x1), (rectangle.y2 - rectangle.y1));
......@@ -455,8 +455,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
}
/* draw selection */
if (priv->mouse.selection.y2 != -1 && priv->mouse.selection.x2 != -1) {
GdkColor color = priv->zathura->ui.colors.highlight_color;
cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency);
const GdkRGBA color = priv->zathura->ui.colors.highlight_color;
cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency);
cairo_rectangle(cairo, priv->mouse.selection.x1, priv->mouse.selection.y1,
(priv->mouse.selection.x2 - priv->mouse.selection.x1), (priv->mouse.selection.y2 - priv->mouse.selection.y1));
cairo_fill(cairo);
......@@ -468,8 +468,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
zathura_renderer_get_recolor_colors(priv->zathura->sync.render_thread, &color, NULL);
cairo_set_source_rgb(cairo, color.red, color.green, color.blue);
} else {
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);
const GdkRGBA color = priv->zathura->ui.colors.render_loading_bg;
cairo_set_source_rgb(cairo, color.red, color.green, color.blue);
}
cairo_rectangle(cairo, 0, 0, page_width, page_height);
cairo_fill(cairo);
......@@ -484,7 +484,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
zathura_renderer_get_recolor_colors(priv->zathura->sync.render_thread, NULL, &color);
cairo_set_source_rgb(cairo, color.red, color.green, color.blue);
} else {
GdkColor color = priv->zathura->ui.colors.render_loading_fg;
const GdkRGBA 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);
}
......
......@@ -57,10 +57,10 @@ struct zathura_s
struct
{
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..." */
GdkRGBA highlight_color; /**< Color for highlighting */
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..." */
} colors;
GtkWidget *page_widget_alignment;
......
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