Skip to content
  • Christian Hergert's avatar
    textview: add support for underline and strikethrough colors · 28063ee2
    Christian Hergert authored and Matthias Clasen's avatar Matthias Clasen committed
    
    
    This commit adds the GtkTextTag:underline-rgba and :strikethrough-rgba
    properties and the necessary plumbing to apply these colors in GtkTextLayout.
    With this change, you can alter the color of underlines including those
    of type PANGO_UNDERLINE_ERROR.
    
    You might want to alter the underline color to differentiate between
    spelling and grammer mistakes. In code editors, it is convenient to
    differentiate between errors and warnings.
    
    Note that the GtkTextAppearance struct is public ABI and has no spare
    room for new fields, so we are resorting to some tricky packing to store
    the colors in the unused pixel field of the fg_color and bg_color structs.
    This packing is accomplished by the macros in gtktextattributesprivate.h.
    
    Signed-off-by: default avatarChristian Hergert <christian@hergert.me>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=402168
    28063ee2