Commit 44499adc authored by Adrien Plazas's avatar Adrien Plazas Committed by Alexander Mikhaylenko
Browse files

flap: Check enum values in their setters

This warns of misuses of the API instead of either crashing or having
unexpected results.
parent a06a5426
......@@ -2153,6 +2153,7 @@ hdy_flap_set_flap_position (HdyFlap *self,
GtkPackType position)
{
g_return_if_fail (HDY_IS_FLAP (self));
g_return_if_fail (position <= GTK_PACK_END);
if (self->flap_position == position)
return;
......@@ -2296,6 +2297,7 @@ hdy_flap_set_fold_policy (HdyFlap *self,
HdyFlapFoldPolicy policy)
{
g_return_if_fail (HDY_IS_FLAP (self));
g_return_if_fail (policy <= HDY_FLAP_FOLD_POLICY_AUTO);
if (self->fold_policy == policy)
return;
......@@ -2469,6 +2471,7 @@ hdy_flap_set_transition_type (HdyFlap *self,
HdyFlapTransitionType transition_type)
{
g_return_if_fail (HDY_IS_FLAP (self));
g_return_if_fail (transition_type <= HDY_FLAP_TRANSITION_TYPE_SLIDE);
if (self->transition_type == transition_type)
return;
......
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