render_layout() should be able to propagate style classes to pango layouts
@federico
Submitted by Federico Mena Quintero Assigned to Carlos Garnacho @carlosg
Link to original bug (#657194)
Description
Gnome-documents implements a custom text cell renderer that, among other things, has this snippet in its ::render() implementation:
gtk_style_context_save (context);
gtk_style_context_add_class (context, "dim-label");
gtk_render_layout (context, cr, ..., layout);
gtk_style_context_restore (context);
The "dim-label" style class comes from the theme.
This is quite pedestrian. It would be a lot easier to say,
layout = pango_make_layout_with_markup ("<div class=\"dim-label\">Look, a dim label`</div>`");
gtk_render_layout (context, cr, layout);
That is, pango layouts should be able to have chunks with explicit style classes, which get resolved to the final styles by gtk_render_layout().
I'm filing this bug against GtkStyleContext because I'm not sure how all the pieces should interact --- whether Pango needs pluggable markup elements, or something.
Version: 3.3.x
Edited by Daniel Boles