mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
widgets: Prevent CRITICAL when toolbox has no child areas
To balance the child areas in the toolbox horizontally, we dynamically set the maximum number of children in the GtkFlowBox depending on the number of visible ones. It is possible to hide all of them, giving us a max count of 0. However, gtk_flow_box_set_max_children_per_line () requires the max count to be at least 1 - this causes a CRITICAL. This patch adds a check to make sure the count is at least 1 before calling that function.
This commit is contained in:
parent
96d09108d5
commit
bc887fbbb2
1 changed files with 3 additions and 3 deletions
|
@ -868,7 +868,7 @@ toolbox_area_config_notify (GimpGuiConfig *config,
|
|||
visible_areas += (gint) config->toolbox_foo_area;
|
||||
visible_areas += (gint) config->toolbox_image_area;
|
||||
|
||||
gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (area_box),
|
||||
visible_areas);
|
||||
if (visible_areas > 0)
|
||||
gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (area_box),
|
||||
visible_areas);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue