[libadwaita] expander-row: Drop the use-underline property



commit f1fa1d03ec26ca317d2a073bba270397a71b8ae5
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Oct 6 17:42:35 2021 +0200

    expander-row: Drop the use-underline property
    
    It conflicts with AdwPreferencesRow:use-underline.
    
    Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/48

 doc/migrating-between-development-versions.md |  5 ++
 doc/migrating-libhandy-1-4-to-libadwaita.md   |  5 ++
 src/adw-expander-row.c                        | 67 ---------------------------
 src/adw-expander-row.h                        |  6 ---
 src/adw-expander-row.ui                       |  1 +
 tests/test-expander-row.c                     | 19 --------
 6 files changed, 11 insertions(+), 92 deletions(-)
---
diff --git a/doc/migrating-between-development-versions.md b/doc/migrating-between-development-versions.md
index 1a50c6a1..a7997c97 100644
--- a/doc/migrating-between-development-versions.md
+++ b/doc/migrating-between-development-versions.md
@@ -219,3 +219,8 @@ instead.
 
 The "use-underline" property and its accessors have been removed. Use
 [property@Adw.PreferencesRow:use-underline] and its accessors instead.
+
+### Adapt to [class@Adw.ExpanderRow] API Changes
+
+The "use-underline" property and its accessors have been removed. Use
+[property@Adw.PreferencesRow:use-underline] and its accessors instead.
diff --git a/doc/migrating-libhandy-1-4-to-libadwaita.md b/doc/migrating-libhandy-1-4-to-libadwaita.md
index e5ded4de..4cf8c21c 100644
--- a/doc/migrating-libhandy-1-4-to-libadwaita.md
+++ b/doc/migrating-libhandy-1-4-to-libadwaita.md
@@ -188,6 +188,11 @@ now.
 longer be manually created. It's only intended to be used with
 [class@Adw.EnumListModel].
 
+### Adapt to [class@Adw.ExpanderRow] API Changes
+
+The "use-underline" property and its accessors have been removed. Use
+[property@Adw.PreferencesRow:use-underline] and its accessors instead.
+
 ### Stop Using `HdyValueObject`
 
 `HdyValueObject` has been removed. The typical use for storing strings in
diff --git a/src/adw-expander-row.c b/src/adw-expander-row.c
index 84927e47..db8c169a 100644
--- a/src/adw-expander-row.c
+++ b/src/adw-expander-row.c
@@ -67,7 +67,6 @@ static GtkBuildableIface *parent_buildable_iface;
 enum {
   PROP_0,
   PROP_SUBTITLE,
-  PROP_USE_UNDERLINE,
   PROP_ICON_NAME,
   PROP_EXPANDED,
   PROP_ENABLE_EXPANSION,
@@ -89,9 +88,6 @@ adw_expander_row_get_property (GObject    *object,
   case PROP_SUBTITLE:
     g_value_set_string (value, adw_expander_row_get_subtitle (self));
     break;
-  case PROP_USE_UNDERLINE:
-    g_value_set_boolean (value, adw_expander_row_get_use_underline (self));
-    break;
   case PROP_ICON_NAME:
     g_value_set_string (value, adw_expander_row_get_icon_name (self));
     break;
@@ -121,9 +117,6 @@ adw_expander_row_set_property (GObject      *object,
   case PROP_SUBTITLE:
     adw_expander_row_set_subtitle (self, g_value_get_string (value));
     break;
-  case PROP_USE_UNDERLINE:
-    adw_expander_row_set_use_underline (self, g_value_get_boolean (value));
-    break;
   case PROP_ICON_NAME:
     adw_expander_row_set_icon_name (self, g_value_get_string (value));
     break;
@@ -172,20 +165,6 @@ adw_expander_row_class_init (AdwExpanderRowClass *klass)
                          "",
                          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
 
-  /**
-   * AdwExpanderRow:use-underline: (attributes org.gtk.Property.get=adw_expander_row_get_use_underline 
org.gtk.Property.set=adw_expander_row_set_use_underline)
-   *
-   * Whether underlines in title or subtitle are interpreted as mnemonics.
-   *
-   * Since: 1.0
-   */
-  props[PROP_USE_UNDERLINE] =
-    g_param_spec_boolean ("use-underline",
-                          "Use underline",
-                          "Whether underlines in title or subtitle are interpreted as mnemonics",
-                          FALSE,
-                          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
-
   /**
    * AdwExpanderRow:icon-name: (attributes org.gtk.Property.get=adw_expander_row_get_icon_name 
org.gtk.Property.set=adw_expander_row_set_icon_name)
    *
@@ -262,7 +241,6 @@ func (gpointer this) { \
 } \
 
 NOTIFY (notify_subtitle_cb, PROP_SUBTITLE);
-NOTIFY (notify_use_underline_cb, PROP_USE_UNDERLINE);
 NOTIFY (notify_icon_name_cb, PROP_ICON_NAME);
 
 static void
@@ -278,7 +256,6 @@ adw_expander_row_init (AdwExpanderRow *self)
   adw_expander_row_set_expanded (self, FALSE);
 
   g_signal_connect_object (priv->action_row, "notify::subtitle", G_CALLBACK (notify_subtitle_cb), self, 
G_CONNECT_SWAPPED);
-  g_signal_connect_object (priv->action_row, "notify::use-underline", G_CALLBACK (notify_use_underline_cb), 
self, G_CONNECT_SWAPPED);
   g_signal_connect_object (priv->action_row, "notify::icon-name", G_CALLBACK (notify_icon_name_cb), self, 
G_CONNECT_SWAPPED);
 }
 
@@ -370,50 +347,6 @@ adw_expander_row_set_subtitle (AdwExpanderRow *self,
   adw_action_row_set_subtitle (priv->action_row, subtitle);
 }
 
-/**
- * adw_expander_row_get_use_underline: (attributes org.gtk.Method.get_property=use-underline)
- * @self: a `AdwExpanderRow`
- *
- * Gets whether underlines in title or subtitle are interpreted as mnemonics.
- *
- * Returns: `TRUE` if underlines are interpreted as mnemonics
- *
- * Since: 1.0
- */
-gboolean
-adw_expander_row_get_use_underline (AdwExpanderRow *self)
-{
-  AdwExpanderRowPrivate *priv;
-
-  g_return_val_if_fail (ADW_IS_EXPANDER_ROW (self), FALSE);
-
-  priv = adw_expander_row_get_instance_private (self);
-
-  return adw_preferences_row_get_use_underline (ADW_PREFERENCES_ROW (priv->action_row));
-}
-
-/**
- * adw_expander_row_set_use_underline: (attributes org.gtk.Method.set_property=use-underline)
- * @self: a `AdwExpanderRow`
- * @use_underline: whether underlines are interpreted as mnemonics
- *
- * Sets whether underlines in title or subtitle are interpreted as mnemonics.
- *
- * Since: 1.0
- */
-void
-adw_expander_row_set_use_underline (AdwExpanderRow *self,
-                                    gboolean        use_underline)
-{
-  AdwExpanderRowPrivate *priv;
-
-  g_return_if_fail (ADW_IS_EXPANDER_ROW (self));
-
-  priv = adw_expander_row_get_instance_private (self);
-
-  adw_preferences_row_set_use_underline (ADW_PREFERENCES_ROW (priv->action_row), use_underline);
-}
-
 /**
  * adw_expander_row_get_icon_name: (attributes org.gtk.Method.get_property=icon-name)
  * @self: a `AdwExpanderRow`
diff --git a/src/adw-expander-row.h b/src/adw-expander-row.h
index 5c433f83..df9b9673 100644
--- a/src/adw-expander-row.h
+++ b/src/adw-expander-row.h
@@ -43,12 +43,6 @@ ADW_AVAILABLE_IN_ALL
 void        adw_expander_row_set_subtitle (AdwExpanderRow *self,
                                            const char     *subtitle);
 
-ADW_AVAILABLE_IN_ALL
-gboolean adw_expander_row_get_use_underline (AdwExpanderRow *self);
-ADW_AVAILABLE_IN_ALL
-void     adw_expander_row_set_use_underline (AdwExpanderRow *self,
-                                             gboolean        use_underline);
-
 ADW_AVAILABLE_IN_ALL
 const char *adw_expander_row_get_icon_name (AdwExpanderRow *self);
 ADW_AVAILABLE_IN_ALL
diff --git a/src/adw-expander-row.ui b/src/adw-expander-row.ui
index 02fef42e..7abc759f 100644
--- a/src/adw-expander-row.ui
+++ b/src/adw-expander-row.ui
@@ -35,6 +35,7 @@
                      work as expected. -->
                 <property name="can-focus">True</property>
                 <property name="title" bind-source="AdwExpanderRow" bind-property="title" 
bind-flags="sync-create"/>
+                <property name="use-underline" bind-source="AdwExpanderRow" bind-property="use-underline" 
bind-flags="sync-create"/>
                 <style>
                   <class name="header"/>
                 </style>
diff --git a/tests/test-expander-row.c b/tests/test-expander-row.c
index 68ff0a0b..1485bff5 100644
--- a/tests/test-expander-row.c
+++ b/tests/test-expander-row.c
@@ -54,24 +54,6 @@ test_adw_expander_row_icon_name (void)
 }
 
 
-static void
-test_adw_expander_row_use_undeline (void)
-{
-  g_autoptr (AdwExpanderRow) row = NULL;
-
-  row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
-  g_assert_nonnull (row);
-
-  g_assert_false (adw_expander_row_get_use_underline (row));
-
-  adw_expander_row_set_use_underline (row, TRUE);
-  g_assert_true (adw_expander_row_get_use_underline (row));
-
-  adw_expander_row_set_use_underline (row, FALSE);
-  g_assert_false (adw_expander_row_get_use_underline (row));
-}
-
-
 static void
 test_adw_expander_row_expanded (void)
 {
@@ -145,7 +127,6 @@ main (int   argc,
   g_test_add_func("/Adwaita/ExpanderRow/add_remove", test_adw_expander_row_add_remove);
   g_test_add_func("/Adwaita/ExpanderRow/subtitle", test_adw_expander_row_subtitle);
   g_test_add_func("/Adwaita/ExpanderRow/icon_name", test_adw_expander_row_icon_name);
-  g_test_add_func("/Adwaita/ExpanderRow/use_underline", test_adw_expander_row_use_undeline);
   g_test_add_func("/Adwaita/ExpanderRow/expanded", test_adw_expander_row_expanded);
   g_test_add_func("/Adwaita/ExpanderRow/enable_expansion", test_adw_expander_row_enable_expansion);
   g_test_add_func("/Adwaita/ExpanderRow/show_enable_switch", test_adw_expander_row_show_enable_switch);


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