[gtk+] API: sizegroup: Remove gtk_size_group_set_ignore_hidden()



commit cda617df4d3d62a9904dddded30be54b888993eb
Author: Benjamin Otte <otte redhat com>
Date:   Sun Oct 9 15:53:22 2016 +0200

    API: sizegroup: Remove gtk_size_group_set_ignore_hidden()

 docs/reference/gtk/gtk4-sections.txt               |    2 -
 gtk/gtkshortcutssection.c                          |   12 --
 gtk/gtksizegroup.c                                 |  106 +-------------------
 gtk/gtksizegroup.h                                 |    5 -
 gtk/gtkwidget.c                                    |    6 -
 gtk/inspector/size-groups.c                        |   20 +----
 testsuite/reftests/sizegroups-basics.ui            |    1 -
 .../reftests/sizegroups-evolution-identity-page.ui |    1 -
 8 files changed, 2 insertions(+), 151 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 52bb2d9..2db3dbc 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -3086,8 +3086,6 @@ GtkSizeGroupMode
 gtk_size_group_new
 gtk_size_group_set_mode
 gtk_size_group_get_mode
-gtk_size_group_set_ignore_hidden
-gtk_size_group_get_ignore_hidden
 gtk_size_group_add_widget
 gtk_size_group_remove_widget
 gtk_size_group_get_widgets
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index 4fe6041..46e4efc 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -650,15 +650,9 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self)
           gtk_widget_show (column);
 
           group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-          gtk_size_group_set_ignore_hidden (group, TRUE);
-G_GNUC_END_IGNORE_DEPRECATIONS
           g_object_set_data_full (G_OBJECT (column), "accel-size-group", group, g_object_unref);
 
           group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-          gtk_size_group_set_ignore_hidden (group, TRUE);
-G_GNUC_END_IGNORE_DEPRECATIONS
           g_object_set_data_full (G_OBJECT (column), "title-size-group", group, g_object_unref);
 
           if (n_columns % 2 == 0)
@@ -703,14 +697,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       gtk_widget_show (column);
 
       group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-      gtk_size_group_set_ignore_hidden (group, TRUE);
-G_GNUC_END_IGNORE_DEPRECATIONS
       g_object_set_data_full (G_OBJECT (column), "accel-size-group", group, g_object_unref);
       group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-      gtk_size_group_set_ignore_hidden (group, TRUE);
-G_GNUC_END_IGNORE_DEPRECATIONS
       g_object_set_data_full (G_OBJECT (column), "title-size-group", group, g_object_unref);
 
       gtk_container_add (GTK_CONTAINER (current_page), column);
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index a939a05..2e3e33f 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -108,14 +108,11 @@ struct _GtkSizeGroupPrivate
   GSList         *widgets;
 
   guint8          mode;
-
-  guint           ignore_hidden : 1;
 };
 
 enum {
   PROP_0,
-  PROP_MODE,
-  PROP_IGNORE_HIDDEN
+  PROP_MODE
 };
 
 static void gtk_size_group_set_property (GObject      *object,
@@ -157,13 +154,11 @@ add_widget_to_closure (GHashTable *widgets,
                       gint        orientation)
 {
   GSList *tmp_groups, *tmp_widgets;
-  gboolean hidden;
 
   if (g_hash_table_lookup (widgets, widget))
     return;
 
   g_hash_table_add (widgets, widget);
-  hidden = !gtk_widget_is_visible (widget);
 
   for (tmp_groups = _gtk_widget_get_sizegroups (widget); tmp_groups; tmp_groups = tmp_groups->next)
     {
@@ -173,9 +168,6 @@ add_widget_to_closure (GHashTable *widgets,
       if (g_hash_table_lookup (groups, tmp_group))
         continue;
 
-      if (tmp_priv->ignore_hidden && hidden)
-        continue;
-
       if (orientation >= 0 && !(tmp_priv->mode & (1 << orientation)))
         continue;
 
@@ -231,30 +223,6 @@ gtk_size_group_class_init (GtkSizeGroupClass *klass)
                                                       GTK_TYPE_SIZE_GROUP_MODE,
                                                       GTK_SIZE_GROUP_HORIZONTAL,
                                                       GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
-  /**
-   * GtkSizeGroup:ignore-hidden:
-   *
-   * If %TRUE, unmapped widgets are ignored when determining
-   * the size of the group.
-   *
-   * Since: 2.8
-   *
-   * Deprecated: 3.22: Measuring the size of hidden widgets has not worked
-   *     reliably for a long time. In most cases, they will report a size
-   *     of 0 nowadays, and thus, their size will not affect the other
-   *     size group members. In effect, size groups will always operate
-   *     as if this property was %TRUE. Use a #GtkStack instead to hide
-   *     widgets while still having their size taken into account.
-   */
-  g_object_class_install_property (gobject_class,
-                                   PROP_IGNORE_HIDDEN,
-                                   g_param_spec_boolean ("ignore-hidden",
-                                                         P_("Ignore hidden"),
-                                                         P_("If TRUE, unmapped widgets are ignored "
-                                                            "when determining the size of the group"),
-                                                         FALSE,
-                                                         
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED));
 }
 
 static void
@@ -267,7 +235,6 @@ gtk_size_group_init (GtkSizeGroup *size_group)
 
   priv->widgets = NULL;
   priv->mode = GTK_SIZE_GROUP_HORIZONTAL;
-  priv->ignore_hidden = FALSE;
 }
 
 static void
@@ -290,11 +257,6 @@ gtk_size_group_set_property (GObject      *object,
     case PROP_MODE:
       gtk_size_group_set_mode (size_group, g_value_get_enum (value));
       break;
-    case PROP_IGNORE_HIDDEN:
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-      gtk_size_group_set_ignore_hidden (size_group, g_value_get_boolean (value));
-G_GNUC_END_IGNORE_DEPRECATIONS
-      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -315,9 +277,6 @@ gtk_size_group_get_property (GObject      *object,
     case PROP_MODE:
       g_value_set_enum (value, priv->mode);
       break;
-    case PROP_IGNORE_HIDDEN:
-      g_value_set_boolean (value, priv->ignore_hidden);
-      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -394,69 +353,6 @@ gtk_size_group_get_mode (GtkSizeGroup *size_group)
 }
 
 /**
- * gtk_size_group_set_ignore_hidden:
- * @size_group: a #GtkSizeGroup
- * @ignore_hidden: whether unmapped widgets should be ignored
- *   when calculating the size
- *
- * Sets whether unmapped widgets should be ignored when
- * calculating the size.
- *
- * Since: 2.8
- *
- * Deprecated: 3.22: Measuring the size of hidden widgets has not worked
- *     reliably for a long time. In most cases, they will report a size
- *     of 0 nowadays, and thus, their size will not affect the other
- *     size group members. In effect, size groups will always operate
- *     as if this property was %TRUE. Use a #GtkStack instead to hide
- *     widgets while still having their size taken into account.
- */
-void
-gtk_size_group_set_ignore_hidden (GtkSizeGroup *size_group,
-                                 gboolean      ignore_hidden)
-{
-  GtkSizeGroupPrivate *priv;
-
-  g_return_if_fail (GTK_IS_SIZE_GROUP (size_group));
-
-  priv = size_group->priv;
-
-  ignore_hidden = ignore_hidden != FALSE;
-
-  if (priv->ignore_hidden != ignore_hidden)
-    {
-      priv->ignore_hidden = ignore_hidden;
-
-      g_object_notify (G_OBJECT (size_group), "ignore-hidden");
-    }
-}
-
-/**
- * gtk_size_group_get_ignore_hidden:
- * @size_group: a #GtkSizeGroup
- *
- * Returns if invisible widgets are ignored when calculating the size.
- *
- * Returns: %TRUE if invisible widgets are ignored.
- *
- * Since: 2.8
- *
- * Deprecated: 3.22: Measuring the size of hidden widgets has not worked
- *     reliably for a long time. In most cases, they will report a size
- *     of 0 nowadays, and thus, their size will not affect the other
- *     size group members. In effect, size groups will always operate
- *     as if this property was %TRUE. Use a #GtkStack instead to hide
- *     widgets while still having their size taken into account.
- */
-gboolean
-gtk_size_group_get_ignore_hidden (GtkSizeGroup *size_group)
-{
-  g_return_val_if_fail (GTK_IS_SIZE_GROUP (size_group), FALSE);
-
-  return size_group->priv->ignore_hidden;
-}
-
-/**
  * gtk_size_group_add_widget:
  * @size_group: a #GtkSizeGroup
  * @widget: the #GtkWidget to add
diff --git a/gtk/gtksizegroup.h b/gtk/gtksizegroup.h
index 0f09df5..6067f2c 100644
--- a/gtk/gtksizegroup.h
+++ b/gtk/gtksizegroup.h
@@ -68,11 +68,6 @@ void             gtk_size_group_set_mode      (GtkSizeGroup     *size_group,
                                               GtkSizeGroupMode  mode);
 GDK_AVAILABLE_IN_ALL
 GtkSizeGroupMode gtk_size_group_get_mode      (GtkSizeGroup     *size_group);
-GDK_DEPRECATED_IN_3_22
-void             gtk_size_group_set_ignore_hidden (GtkSizeGroup *size_group,
-                                                  gboolean      ignore_hidden);
-GDK_DEPRECATED_IN_3_22
-gboolean         gtk_size_group_get_ignore_hidden (GtkSizeGroup *size_group);
 GDK_AVAILABLE_IN_ALL
 void             gtk_size_group_add_widget    (GtkSizeGroup     *size_group,
                                               GtkWidget        *widget);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 32985f4..fe6511d 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5260,12 +5260,6 @@ gtk_widget_queue_resize_internal (GtkWidget *widget)
 
   for (l = groups; l; l = l->next)
   {
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-    if (gtk_size_group_get_ignore_hidden (l->data) && !gtk_widget_is_visible (widget))
-      continue;
-G_GNUC_END_IGNORE_DEPRECATIONS
-
     for (widgets = gtk_size_group_get_widgets (l->data); widgets; widgets = widgets->next)
       {
         gtk_widget_queue_resize_internal (widgets->data);
diff --git a/gtk/inspector/size-groups.c b/gtk/inspector/size-groups.c
index 2fa94e1..8db1d35 100644
--- a/gtk/inspector/size-groups.c
+++ b/gtk/inspector/size-groups.c
@@ -208,7 +208,7 @@ add_size_group (GtkInspectorSizeGroups *sl,
                 GtkSizeGroup           *group)
 {
   GtkWidget *frame, *box, *box2;
-  GtkWidget *label, *sw, *combo;
+  GtkWidget *label, *combo;
   GSList *widgets, *l;
   GtkWidget *listbox;
 
@@ -221,24 +221,6 @@ add_size_group (GtkInspectorSizeGroups *sl,
   box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   gtk_container_add (GTK_CONTAINER (box), box2);
 
-  label = gtk_label_new (_("Ignore hidden"));
-  g_object_set (label, "margin", 10, NULL);
-  gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
-  gtk_box_pack_start (GTK_BOX (box2), label, TRUE, TRUE);
-
-  sw = gtk_switch_new ();
-  g_object_set (sw, "margin", 10, NULL);
-  gtk_widget_set_halign (sw, GTK_ALIGN_END);
-  gtk_widget_set_valign (sw, GTK_ALIGN_BASELINE);
-  g_object_bind_property (group, "ignore-hidden",
-                          sw, "active",
-                          G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
-  gtk_box_pack_start (GTK_BOX (box2), sw, FALSE, FALSE);
-
-  box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
-  gtk_container_add (GTK_CONTAINER (box), box2);
-
   label = gtk_label_new (_("Mode"));
   g_object_set (label, "margin", 10, NULL);
   gtk_widget_set_halign (label, GTK_ALIGN_START);
diff --git a/testsuite/reftests/sizegroups-basics.ui b/testsuite/reftests/sizegroups-basics.ui
index 6b1e2de..696802c 100644
--- a/testsuite/reftests/sizegroups-basics.ui
+++ b/testsuite/reftests/sizegroups-basics.ui
@@ -51,7 +51,6 @@
   </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <property name="mode">both</property>
-    <property name="ignore-hidden">True</property>
     <widgets>
       <widget name="label1" />
       <widget name="label2" />
diff --git a/testsuite/reftests/sizegroups-evolution-identity-page.ui 
b/testsuite/reftests/sizegroups-evolution-identity-page.ui
index 42724d3..8ac5990 100644
--- a/testsuite/reftests/sizegroups-evolution-identity-page.ui
+++ b/testsuite/reftests/sizegroups-evolution-identity-page.ui
@@ -281,7 +281,6 @@ For example, "Work" or "Personal".</property>
   </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <property name="mode">horizontal</property>
-    <property name="ignore-hidden">True</property>
     <widgets>
       <widget name="label4" />
       <widget name="label6" />


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