mirror of https://github.com/GNOME/gimp.git
app: improve layer-mode menu separator logic
This commit is contained in:
parent
e30d235ede
commit
8aa3d5ed6f
|
@ -374,7 +374,8 @@ gimp_enum_store_new_from_array (GType enum_type,
|
||||||
{
|
{
|
||||||
GtkListStore *store;
|
GtkListStore *store;
|
||||||
GEnumValue *value;
|
GEnumValue *value;
|
||||||
gboolean added_values_since_last_separator = FALSE;
|
gboolean first_item = TRUE;
|
||||||
|
gboolean prepend_separator = FALSE;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
||||||
|
@ -396,20 +397,23 @@ gimp_enum_store_new_from_array (GType enum_type,
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
|
if (prepend_separator)
|
||||||
|
{
|
||||||
|
gimp_enum_store_add_separator (store);
|
||||||
|
|
||||||
|
prepend_separator = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
gimp_enum_store_add_value (store, value);
|
gimp_enum_store_add_value (store, value);
|
||||||
|
|
||||||
added_values_since_last_separator = TRUE;
|
first_item = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (added_values_since_last_separator)
|
if (! first_item)
|
||||||
{
|
prepend_separator = TRUE;
|
||||||
gimp_enum_store_add_separator (store);
|
|
||||||
|
|
||||||
added_values_since_last_separator = FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue