[gtk+/wip/baedert/box] sizegroup: Remove ignore-hidden



commit 64643218b1493455aaf6543f05dfa8bb88716ae4
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 13 15:44:55 2016 +0200

    sizegroup: Remove ignore-hidden

 docs/reference/gtk/gtk3-sections.txt |    2 -
 gtk/gtkshortcutssection.c            |   12 ----
 gtk/gtksizegroup.c                   |  101 +---------------------------------
 gtk/gtksizegroup.h                   |    5 --
 gtk/gtkwidget.c                      |    4 +-
 5 files changed, 2 insertions(+), 122 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 3cb5d2a..94b44ff 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -3071,8 +3071,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..309199c 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
 };
 
 static void gtk_size_group_set_property (GObject      *object,
@@ -173,7 +170,7 @@ add_widget_to_closure (GHashTable *widgets,
       if (g_hash_table_lookup (groups, tmp_group))
         continue;
 
-      if (tmp_priv->ignore_hidden && hidden)
+      if (hidden)
         continue;
 
       if (orientation >= 0 && !(tmp_priv->mode & (1 << orientation)))
@@ -231,30 +228,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 +240,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 +262,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 +282,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 +358,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 d3b481a..221d13a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5220,10 +5220,8 @@ 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))
+    if (!gtk_widget_is_visible (widget))
       continue;
-G_GNUC_END_IGNORE_DEPRECATIONS
 
     for (widgets = gtk_size_group_get_widgets (l->data); widgets; widgets = widgets->next)
       {


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