[Xfce4-commits] [xfce/exo] 03/03: Fix ExoCellRendererIcon rendering with GTK 3 (bug #14970)
noreply at xfce.org
noreply at xfce.org
Sat Jan 19 03:33:42 CET 2019
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/exo.
commit f8de4e34c0432c518e803fc2d16d395f095ca3b7
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Fri Jan 18 21:33:33 2019 -0500
Fix ExoCellRendererIcon rendering with GTK 3 (bug #14970)
---
exo/exo-cell-renderer-icon.c | 26 ++++++++++++++------------
exo/exo-icon-chooser-dialog.c | 1 -
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/exo/exo-cell-renderer-icon.c b/exo/exo-cell-renderer-icon.c
index 981fe38..bfecaa2 100644
--- a/exo/exo-cell-renderer-icon.c
+++ b/exo/exo-cell-renderer-icon.c
@@ -388,7 +388,7 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
{
GdkRectangle clip_area;
GdkRectangle *expose_area = &clip_area;
- GdkRGBA color_rgba;
+ GdkRGBA *color_rgba;
GdkColor color_gdk;
GtkStyleContext *style_context;
#else
@@ -543,14 +543,15 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
{
#if GTK_CHECK_VERSION (3, 0, 0)
style_context = gtk_widget_get_style_context (widget);
- gtk_style_context_get (style_context, GTK_STATE_FLAG_NORMAL,
- GTK_STYLE_PROPERTY_BACKGROUND_COLOR,
- &color_rgba, NULL);
+ gtk_style_context_get (style_context, gtk_widget_has_focus (widget) ? GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE,
+ GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &color_rgba,
+ NULL);
color_gdk.pixel = 0;
- color_gdk.red = color_rgba.red * 65535.0;
- color_gdk.blue = color_rgba.blue * 65535.0;
- color_gdk.green = color_rgba.green * 65535.0;
+ color_gdk.red = color_rgba->red * 65535;
+ color_gdk.blue = color_rgba->blue * 65535;
+ color_gdk.green = color_rgba->green * 65535;
+ gdk_rgba_free (color_rgba);
temp = exo_gdk_pixbuf_colorize (icon, &color_gdk);
#else
state = gtk_widget_has_focus (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
@@ -575,13 +576,14 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
{
style_context = gtk_widget_get_style_context (widget);
gtk_style_context_get (style_context, GTK_STATE_FLAG_INSENSITIVE,
- GTK_STYLE_PROPERTY_COLOR,
- &color_rgba, NULL);
+ GTK_STYLE_PROPERTY_COLOR, &color_rgba,
+ NULL);
color_gdk.pixel = 0;
- color_gdk.red = color_rgba.red * 65535.0;
- color_gdk.blue = color_rgba.blue * 65535.0;
- color_gdk.green = color_rgba.green * 65535.0;
+ color_gdk.red = color_rgba->red * 65535;
+ color_gdk.blue = color_rgba->blue * 65535;
+ color_gdk.green = color_rgba->green * 65535;
+ gdk_rgba_free (color_rgba);
temp = exo_gdk_pixbuf_colorize (icon, &color_gdk);
g_object_unref (G_OBJECT (icon));
diff --git a/exo/exo-icon-chooser-dialog.c b/exo/exo-icon-chooser-dialog.c
index feb54f7..93d3071 100644
--- a/exo/exo-icon-chooser-dialog.c
+++ b/exo/exo-icon-chooser-dialog.c
@@ -279,7 +279,6 @@ exo_icon_chooser_dialog_init (ExoIconChooserDialog *icon_chooser_dialog)
/* setup the text renderer */
renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
- /*"follow-state", TRUE,*/
"wrap-mode", PANGO_WRAP_WORD_CHAR,
"wrap-width", 104,
"xalign", 0.5f,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list