[gtk/bump-pango: 7/7] label: Handle new pango attributes



commit dabc205f7b33d35616adf82dc2dca1f31ab3959f
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Nov 1 09:15:24 2019 -0400

    label: Handle new pango attributes
    
    overline and overline-color were introduced in Pango 1.45.

 gtk/gtklabel.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 7ff59dc505..def048a7db 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1550,12 +1550,25 @@ attribute_from_text (GtkBuilder   *builder,
       if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_SHOW_FLAGS, value, &val, error))
        attribute = pango_attr_show_new (g_value_get_flags (&val));
       break;
-#endif
-#if PANGO_VERSION_CHECK(1,44,4)
     case PANGO_ATTR_INSERT_HYPHENS:
       if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
        attribute = pango_attr_insert_hyphens_new (g_value_get_boolean (&val));
       break;
+#endif
+#if PANGO_VERSION_CHECK(1,45,0)
+    case PANGO_ATTR_OVERLINE:
+      if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_OVERLINE, value, &val, NULL))
+       attribute = pango_attr_overline_new (g_value_get_enum (&val));
+      break;
+    case PANGO_ATTR_OVERLINE_COLOR:
+      if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
+       {
+         color = g_value_get_boxed (&val);
+          attribute = pango_attr_overline_color_new (color->red * 65535,
+                                                     color->green * 65535,
+                                                     color->blue * 65535);
+       }
+      break;
 #endif
     case PANGO_ATTR_INVALID:
     default:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]