use placeholder_text_color for welcome secondary text

Bug #1322922 reported by Daniel Fore on 2014-05-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Granite
Fix Released
Low
Unassigned
elementary Stylesheet
Fix Released
Undecided
Daniel Fore

Bug Description

Instead of using insensitive text, it makes more sense to use the same color as placeholder text

Related branches

Daniel Fore (danrabbit) wrote :

This is the code used by Gtk.CellRendererText. I can't quite wrap my head around what is going on here:

      PangoColor color;
      GtkStyleContext *context;
      GdkRGBA fg = { 0.5, 0.5, 0.5 };

      context = gtk_widget_get_style_context (widget);
      gtk_style_context_lookup_color (context, "placeholder_text_color", &fg);

      color.red = CLAMP (fg.red * 65535. + 0.5, 0, 65535);
      color.green = CLAMP (fg.green * 65535. + 0.5, 0, 65535);
      color.blue = CLAMP (fg.blue * 65535. + 0.5, 0, 65535);

      add_attr (attr_list,
                pango_attr_foreground_new (color.red, color.green, color.blue));

summary: - use @define-color placeholder_text_color for welcome secondary text
+ use placeholder_text_color for welcome secondary text
Daniel Fore (danrabbit) wrote :

Okay, this is way above my head, but here's what I've discovered:

The end goal is to use subtitle_label.set_attributes (attr_list); where attr_list is a Pango.AttributeList that contains the RGB values for our Pango foreground color.

The problem is that Gtk.StyleContext.lookup_color returns double values and Pango wants uint16 values.

So there's this whole song and dance about getting the RGB values from style context and storing them in a Gdk.RGBA and converting those values to something pango can read and then creating the attr_list.

So yeah.

Daniel Fore (danrabbit) wrote :

So instead of being crazy, I just fixed it in egtk by styling GraniteWidgetsWelcome's children. I've proposed a branch that removes the insensitive garbage and that should fix it.

Changed in egtk:
status: New → Fix Committed
milestone: none → freya-beta2
assignee: nobody → Daniel Fore (danrabbit)
Daniel Fore (danrabbit) on 2014-07-03
Changed in granite:
status: Confirmed → Fix Committed
milestone: none → freya-beta2
Daniel Fore (danrabbit) on 2015-02-10
Changed in granite:
status: Fix Committed → Fix Released
Changed in egtk:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers