Add preliminary set_busy fuinction to activity bar

This commit is contained in:
Mario Hüttel 2019-08-21 19:29:22 +02:00
parent 08722cd6f9
commit dc4b377b13
2 changed files with 14 additions and 0 deletions

View File

@ -53,6 +53,14 @@ ActivityBar *activity_bar_new();
*/
void activity_bar_set_ready(ActivityBar *bar);
/**
* @brief Enable spinner and set \p text. If text is NULL, 'Working...' is displayed
* @param bar Activity bar object
* @param text Text to display, may be NULL
*/
void activity_bar_set_busy(ActivityBar *bar, const char *text);
G_END_DECLS
#endif /* __LAYER_ELEMENT_H__ */

View File

@ -105,5 +105,11 @@ void activity_bar_set_ready(ActivityBar *bar)
gtk_spinner_stop(GTK_SPINNER(bar->spinner));
}
void activity_bar_set_busy(ActivityBar *bar, const char *text)
{
gtk_label_set_text(GTK_LABEL(bar->label), (text ? text : "Working..."));
gtk_spinner_start(GTK_SPINNER(bar->spinner));
}
/** @} */