[gnome-builder] util: always set foreground in cell renderer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] util: always set foreground in cell renderer
- Date: Wed, 19 Jul 2017 11:03:55 +0000 (UTC)
commit 07c64fd26421a87c2fba5686af9c532d751a3be0
Author: Christian Hergert <chergert redhat com>
Date: Fri Jun 30 20:29:37 2017 -0700
util: always set foreground in cell renderer
The default is unset, so we must set this always, even when we
do not have selection state.
libide/util/ide-cell-renderer-fancy.c | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/libide/util/ide-cell-renderer-fancy.c b/libide/util/ide-cell-renderer-fancy.c
index 260b375..0561af8 100644
--- a/libide/util/ide-cell-renderer-fancy.c
+++ b/libide/util/ide-cell-renderer-fancy.c
@@ -50,6 +50,9 @@ get_layout (IdeCellRendererFancy *self,
{
PangoLayout *l;
PangoAttrList *attrs;
+ GtkStyleContext *style = gtk_widget_get_style_context (widget);
+ GtkStateFlags state = gtk_style_context_get_state (style);
+ GdkRGBA rgba;
l = gtk_widget_create_pango_layout (widget, text);
@@ -58,18 +61,11 @@ get_layout (IdeCellRendererFancy *self,
attrs = pango_attr_list_new ();
- if ((flags & GTK_CELL_RENDERER_SELECTED) != 0)
- {
- GtkStyleContext *style = gtk_widget_get_style_context (widget);
- GtkStateFlags state = gtk_style_context_get_state (style);
- GdkRGBA rgba;
-
- gtk_style_context_get_color (style, state, &rgba);
- pango_attr_list_insert (attrs,
- pango_attr_foreground_new (rgba.red * 65535,
- rgba.green * 65535,
- rgba.blue * 65535));
- }
+ gtk_style_context_get_color (style, state, &rgba);
+ pango_attr_list_insert (attrs,
+ pango_attr_foreground_new (rgba.red * 65535,
+ rgba.green * 65535,
+ rgba.blue * 65535));
if (is_title)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]