Commit 8889acaa authored by Adrien Plazas's avatar Adrien Plazas
Browse files

leaflet: Add the .folded and .unfolded style classes

This will help styling the children of the leaflet depending on whether
it is folded or not.

Fixes Librem5/libhandy#182.
parent 17aaca12
Pipeline #51245 passed with stages
in 31 minutes and 27 seconds
......@@ -913,6 +913,7 @@ hdy_leaflet_set_fold (HdyLeaflet *self,
HdyFold fold)
{
HdyLeafletPrivate *priv;
GtkStyleContext *context;
g_return_if_fail (HDY_IS_LEAFLET (self));
......@@ -923,10 +924,16 @@ hdy_leaflet_set_fold (HdyLeaflet *self,
priv->fold = fold;
if (fold)
context = gtk_widget_get_style_context (GTK_WIDGET (self));
if (fold) {
hdy_leaflet_start_mode_transition (self, 0.0);
else
gtk_style_context_add_class (context, "folded");
gtk_style_context_remove_class (context, "unfolded");
} else {
hdy_leaflet_start_mode_transition (self, 1.0);
gtk_style_context_remove_class (context, "folded");
gtk_style_context_add_class (context, "unfolded");
}
g_object_freeze_notify (G_OBJECT (self));
g_object_notify_by_pspec (G_OBJECT (self),
......
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