summaryrefslogtreecommitdiff
path: root/gtk/gtkstack.c
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-11-11 13:51:02 +0100
committerMatthias Clasen <mclasen@redhat.com>2015-11-19 14:50:09 -0500
commit9f3839066ec3bb1be49e127da1320f9b5d5bf02c (patch)
treef233029932641a03cf39ec3e6973779631dc116c /gtk/gtkstack.c
parent0434649cc14f1e860dca6ff14a2d3ce3aec68ac4 (diff)
downloadgtk+-9f3839066ec3bb1be49e127da1320f9b5d5bf02c.tar.gz
gtkstack: allow templates to override all properties
Currently GtkStack has some G_PARAM_CONSTRUCT properties. That means, the properties are set with its default value after the initializacion of the object. When using GtkBuilder to build objects, GtkBuilder creates them and after that sets the properties found on the xml definition. However, this is not true for templates because the template is initialized in the init() function of the actual object, and after that, the construct properties will be set. This is a problem when someone wants to use templates with GtkStack and set those properties, since they will be set on the tempalt initialization and set again to its default values afterwards. To fix this, make those properties not G_PARAM_CONSTRUCT. https://bugzilla.gnome.org/show_bug.cgi?id=758086
Diffstat (limited to 'gtk/gtkstack.c')
-rw-r--r--gtk/gtkstack.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index c30f650c17..a817b0bb03 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -214,6 +214,12 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkStack, gtk_stack, GTK_TYPE_CONTAINER)
static void
gtk_stack_init (GtkStack *stack)
{
+ GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
+
+ priv->vhomogeneous = TRUE;
+ priv->hhomogeneous = TRUE;
+ priv->transition_duration = 200;
+ priv->transition_type = GTK_STACK_TRANSITION_TYPE_NONE;
}
static void
@@ -438,7 +444,7 @@ gtk_stack_class_init (GtkStackClass *klass)
stack_props[PROP_HHOMOGENEOUS] =
g_param_spec_boolean ("hhomogeneous", P_("Horizontally homogeneous"), P_("Horizontally homogeneous sizing"),
TRUE,
- GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY);
+ GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkStack:vhomogeneous:
@@ -450,7 +456,7 @@ gtk_stack_class_init (GtkStackClass *klass)
stack_props[PROP_VHOMOGENEOUS] =
g_param_spec_boolean ("vhomogeneous", P_("Vertically homogeneous"), P_("Vertically homogeneous sizing"),
TRUE,
- GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY);
+ GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
stack_props[PROP_VISIBLE_CHILD] =
g_param_spec_object ("visible-child", P_("Visible child"), P_("The widget currently visible in the stack"),
GTK_TYPE_WIDGET,
@@ -462,11 +468,11 @@ gtk_stack_class_init (GtkStackClass *klass)
stack_props[PROP_TRANSITION_DURATION] =
g_param_spec_uint ("transition-duration", P_("Transition duration"), P_("The animation duration, in milliseconds"),
0, G_MAXUINT, 200,
- GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY);
+ GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
stack_props[PROP_TRANSITION_TYPE] =
g_param_spec_enum ("transition-type", P_("Transition type"), P_("The type of animation used to transition"),
GTK_TYPE_STACK_TRANSITION_TYPE, GTK_STACK_TRANSITION_TYPE_NONE,
- GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY);
+ GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
stack_props[PROP_TRANSITION_RUNNING] =
g_param_spec_boolean ("transition-running", P_("Transition running"), P_("Whether or not the transition is currently running"),
FALSE,