Commit b6e4e4cb authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Add an ignore-hidden property with getter and setter. (#171612, Christian

2005-06-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtk.symbols:
	* gtk/gtksizegroup.[hc]: Add an ignore-hidden property
	with getter and setter.  (#171612, Christian Neumair)
parent e109b31b
2005-06-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtksizegroup.[hc]: Add an ignore-hidden property
with getter and setter. (#171612, Christian Neumair)
2005-06-18 Matthias Clasen <mclasen@redhat.com> 2005-06-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this * gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this
......
2005-06-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtksizegroup.[hc]: Add an ignore-hidden property
with getter and setter. (#171612, Christian Neumair)
2005-06-18 Matthias Clasen <mclasen@redhat.com> 2005-06-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this * gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this
......
2005-06-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtksizegroup.[hc]: Add an ignore-hidden property
with getter and setter. (#171612, Christian Neumair)
2005-06-18 Matthias Clasen <mclasen@redhat.com> 2005-06-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this * gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this
......
2005-06-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk-sections.txt: Updates.
2005-06-18 Matthias Clasen <mclasen@redhat.com> 2005-06-18 Matthias Clasen <mclasen@redhat.com>
* gtk/tmpl/gtkuimanager.sgml: Document that * gtk/tmpl/gtkuimanager.sgml: Document that
......
...@@ -2821,6 +2821,8 @@ GtkSizeGroupMode ...@@ -2821,6 +2821,8 @@ GtkSizeGroupMode
gtk_size_group_new gtk_size_group_new
gtk_size_group_set_mode gtk_size_group_set_mode
gtk_size_group_get_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_add_widget
gtk_size_group_remove_widget gtk_size_group_remove_widget
<SUBSECTION Standard> <SUBSECTION Standard>
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
enum { enum {
PROP_0, PROP_0,
PROP_MODE PROP_MODE,
PROP_IGNORE_HIDDEN
}; };
static void gtk_size_group_set_property (GObject *object, static void gtk_size_group_set_property (GObject *object,
...@@ -246,6 +247,23 @@ gtk_size_group_class_init (GtkSizeGroupClass *klass) ...@@ -246,6 +247,23 @@ gtk_size_group_class_init (GtkSizeGroupClass *klass)
GTK_TYPE_SIZE_GROUP_MODE, GTK_TYPE_SIZE_GROUP_MODE,
GTK_SIZE_GROUP_HORIZONTAL, GTK_SIZE_GROUP_HORIZONTAL,
GTK_PARAM_READWRITE)); GTK_PARAM_READWRITE));
/**
* GtkSizeGroup:ignore-hidden:
*
* If %TRUE, hidden widgets are ignored when determining
* the size of the group.
*
* Since: 2.8
*/
g_object_class_install_property (gobject_class,
PROP_IGNORE_HIDDEN,
g_param_spec_boolean ("ignore-hidden",
P_("Ignore hidden"),
P_("If TRUE, hidden widgets are ignored "
"when determining the size of the group"),
FALSE,
GTK_PARAM_READWRITE));
} }
static void static void
...@@ -255,6 +273,7 @@ gtk_size_group_init (GtkSizeGroup *size_group) ...@@ -255,6 +273,7 @@ gtk_size_group_init (GtkSizeGroup *size_group)
size_group->mode = GTK_SIZE_GROUP_HORIZONTAL; size_group->mode = GTK_SIZE_GROUP_HORIZONTAL;
size_group->have_width = 0; size_group->have_width = 0;
size_group->have_height = 0; size_group->have_height = 0;
size_group->ignore_hidden = 0;
} }
GType GType
...@@ -297,6 +316,9 @@ gtk_size_group_set_property (GObject *object, ...@@ -297,6 +316,9 @@ gtk_size_group_set_property (GObject *object,
case PROP_MODE: case PROP_MODE:
gtk_size_group_set_mode (size_group, g_value_get_enum (value)); gtk_size_group_set_mode (size_group, g_value_get_enum (value));
break; break;
case PROP_IGNORE_HIDDEN:
gtk_size_group_set_ignore_hidden (size_group, g_value_get_boolean (value));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
...@@ -316,6 +338,9 @@ gtk_size_group_get_property (GObject *object, ...@@ -316,6 +338,9 @@ gtk_size_group_get_property (GObject *object,
case PROP_MODE: case PROP_MODE:
g_value_set_enum (value, size_group->mode); g_value_set_enum (value, size_group->mode);
break; break;
case PROP_IGNORE_HIDDEN:
g_value_set_boolean (value, size_group->ignore_hidden);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
...@@ -386,6 +411,51 @@ gtk_size_group_get_mode (GtkSizeGroup *size_group) ...@@ -386,6 +411,51 @@ gtk_size_group_get_mode (GtkSizeGroup *size_group)
return size_group->mode; return size_group->mode;
} }
/**
* gtk_size_group_set_ignore_hidden:
* @size_group: a #GtkSizeGroup
* @ignore_hidden: whether hidden widgets should be ignored
* when calculating the size
*
* Sets whether invisible widgets should be ignored when
* calculating the size.
*
* Since: 2.8
*/
void
gtk_size_group_set_ignore_hidden (GtkSizeGroup *size_group,
gboolean ignore_hidden)
{
g_return_if_fail (GTK_IS_SIZE_GROUP (size_group));
ignore_hidden = ignore_hidden != FALSE;
if (size_group->ignore_hidden != ignore_hidden)
{
size_group->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
*/
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->ignore_hidden;
}
static void static void
gtk_size_group_widget_destroyed (GtkWidget *widget, gtk_size_group_widget_destroyed (GtkWidget *widget,
GtkSizeGroup *size_group) GtkSizeGroup *size_group)
...@@ -542,9 +612,12 @@ compute_dimension (GtkWidget *widget, ...@@ -542,9 +612,12 @@ compute_dimension (GtkWidget *widget,
gint dimension = compute_base_dimension (tmp_widget, mode); gint dimension = compute_base_dimension (tmp_widget, mode);
if (dimension > result) if (GTK_WIDGET_VISIBLE (tmp_widget) || !group->ignore_hidden)
result = dimension; {
if (dimension > result)
result = dimension;
}
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
......
...@@ -46,6 +46,7 @@ struct _GtkSizeGroup ...@@ -46,6 +46,7 @@ struct _GtkSizeGroup
guint have_width : 1; guint have_width : 1;
guint have_height : 1; guint have_height : 1;
guint ignore_hidden : 1;
GtkRequisition requisition; GtkRequisition requisition;
}; };
...@@ -84,6 +85,9 @@ GtkSizeGroup * gtk_size_group_new (GtkSizeGroupMode mode); ...@@ -84,6 +85,9 @@ GtkSizeGroup * gtk_size_group_new (GtkSizeGroupMode mode);
void gtk_size_group_set_mode (GtkSizeGroup *size_group, void gtk_size_group_set_mode (GtkSizeGroup *size_group,
GtkSizeGroupMode mode); GtkSizeGroupMode mode);
GtkSizeGroupMode gtk_size_group_get_mode (GtkSizeGroup *size_group); GtkSizeGroupMode gtk_size_group_get_mode (GtkSizeGroup *size_group);
void gtk_size_group_set_ignore_hidden (GtkSizeGroup *size_group,
gboolean ignore_hidden);
gboolean gtk_size_group_get_ignore_hidden (GtkSizeGroup *size_group);
void gtk_size_group_add_widget (GtkSizeGroup *size_group, void gtk_size_group_add_widget (GtkSizeGroup *size_group,
GtkWidget *widget); GtkWidget *widget);
void gtk_size_group_remove_widget (GtkSizeGroup *size_group, void gtk_size_group_remove_widget (GtkSizeGroup *size_group,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment