mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
Add method to remove all constraints from a layout
This commit is contained in:
parent
06c825df90
commit
3204347bb0
@ -1222,6 +1222,32 @@ gtk_constraint_layout_remove_constraint (GtkConstraintLayout *manager,
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (manager));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_constraint_layout_remove_all_constraints:
|
||||
* @manager: a #GtkConstraintLayout
|
||||
*
|
||||
* Removes all constraints from the layout manager.
|
||||
*/
|
||||
void
|
||||
gtk_constraint_layout_remove_all_constraints (GtkConstraintLayout *manager)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key;
|
||||
|
||||
g_return_if_fail (GTK_IS_CONSTRAINT_LAYOUT (manager));
|
||||
|
||||
g_hash_table_iter_init (&iter, manager->constraints);
|
||||
while (g_hash_table_iter_next (&iter, &key, NULL))
|
||||
{
|
||||
GtkConstraint *constraint = key;
|
||||
|
||||
gtk_constraint_detach (constraint);
|
||||
g_hash_table_iter_remove (&iter);
|
||||
}
|
||||
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (manager));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_constraint_guide_constraint_target_iface_init (GtkConstraintTargetInterface *iface)
|
||||
{
|
||||
|
@ -75,6 +75,8 @@ void gtk_constraint_layout_add_guide (GtkConstraintLa
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_constraint_layout_remove_guide (GtkConstraintLayout *manager,
|
||||
GtkConstraintGuide *guide);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_constraint_layout_remove_all_constraints (GtkConstraintLayout *manager);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gtk_constraint_layout_add_constraints_from_description (GtkConstraintLayout *manager,
|
||||
|
Loading…
Reference in New Issue
Block a user