Commit abdfd5f8 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

leaflet: Add the folded property

This is a boolean equivalent of the fold property, it is a needed
convenience as is can be used in GtkBuilder declarations while the fold
property is more convenient to use from C as it enables stronger typing.
parent 2a2fc18a
......@@ -56,6 +56,7 @@
enum {
PROP_0,
PROP_FOLD,
PROP_FOLDED,
PROP_HHOMOGENEOUS_FOLDED,
PROP_VHOMOGENEOUS_FOLDED,
PROP_HHOMOGENEOUS_UNFOLDED,
......@@ -731,6 +732,8 @@ hdy_leaflet_set_fold (HdyLeaflet *self,
g_object_notify_by_pspec (G_OBJECT (self),
props[PROP_FOLD]);
g_object_notify_by_pspec (G_OBJECT (self),
props[PROP_FOLDED]);
}
/**
......@@ -2362,6 +2365,9 @@ hdy_leaflet_get_property (GObject *object,
case PROP_FOLD:
g_value_set_enum (value, hdy_leaflet_get_fold (self));
break;
case PROP_FOLDED:
g_value_set_boolean (value, hdy_leaflet_get_fold (self) == HDY_FOLD_FOLDED);
break;
case PROP_HHOMOGENEOUS_FOLDED:
g_value_set_boolean (value, hdy_leaflet_get_homogeneous (self, TRUE, GTK_ORIENTATION_HORIZONTAL));
break;
......@@ -2701,6 +2707,13 @@ hdy_leaflet_class_init (HdyLeafletClass *klass)
HDY_TYPE_FOLD, HDY_FOLD_UNFOLDED,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
props[PROP_FOLDED] =
g_param_spec_boolean ("folded",
_("Folded"),
_("Whether the widget is folded"),
FALSE,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
/**
* HdyLeaflet:hhomogeneous_folded:
*
......
Supports Markdown
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