LayerSelector: Add layer_selector_contains_elements() function

This commit is contained in:
2019-11-09 02:18:53 +01:00
parent 74eb17b2dc
commit 4e38d8f452
2 changed files with 27 additions and 0 deletions

View File

@@ -883,4 +883,19 @@ void layer_selector_auto_name_layers(LayerSelector *layer_selector, gboolean ove
g_list_free(le_list);
}
gboolean layer_selector_contains_elements(LayerSelector *layer_selector)
{
GList *layer_element_list;
/* Check objects */
g_return_val_if_fail(LAYER_IS_SELECTOR(layer_selector), FALSE);
g_return_val_if_fail(GTK_IS_LIST_BOX(layer_selector->list_box), FALSE);
/* Get a list of the child elements inside the list boy associated with this selector */
layer_element_list = gtk_container_get_children(GTK_CONTAINER(layer_selector->list_box));
/* Return TRUE if there is an element in the list, else return FALSE */
return (layer_element_list ? TRUE : FALSE);
}
/** @} */