use placeholder_text_color for welcome secondary text

Bug #1322922 reported by Danielle Foré
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Granite
Fix Released
Low
Unassigned
elementary Stylesheet
Fix Released
Undecided
Danielle Foré

Bug Description

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

Related branches

Revision history for this message
Danielle Foré (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
Revision history for this message
Danielle Foré (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.

Revision history for this message
Danielle Foré (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)
Changed in granite:
status: Confirmed → Fix Committed
milestone: none → freya-beta2
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.