40#include <glib/gi18n.h>
50G_DEFINE_TYPE(ActivityBar, activity_bar, GTK_TYPE_BOX)
56 bar = ACTIVITY_BAR(obj);
59 g_clear_object(&bar->label);
60 g_clear_object(&bar->spinner);
63 G_OBJECT_CLASS(activity_bar_parent_class)->dispose(obj);
68 GObjectClass *oclass = G_OBJECT_CLASS(klass);
75 GtkContainer *box = GTK_CONTAINER(self);
78 self->label = gtk_label_new(
"");
79 self->spinner = gtk_spinner_new();
82 gtk_container_add(box, self->spinner);
83 gtk_container_add(box, self->label);
84 gtk_widget_show(self->label);
85 gtk_widget_show(self->spinner);
87 g_object_ref(self->spinner);
88 g_object_ref(self->label);
95 bar = ACTIVITY_BAR(g_object_new(
TYPE_ACTIVITY_BAR,
"orientation", GTK_ORIENTATION_HORIZONTAL, NULL));
104 gtk_label_set_text(GTK_LABEL(bar->label), _(
"Ready"));
105 gtk_spinner_stop(GTK_SPINNER(bar->spinner));
110 gtk_label_set_text(GTK_LABEL(bar->label), (text ? text : _(
"Working...")));
111 gtk_spinner_start(GTK_SPINNER(bar->spinner));
Header file for activity bar widget.
static void activity_bar_init(ActivityBar *self)
void activity_bar_set_ready(ActivityBar *bar)
Deletes all applied tasks and sets bar to "Ready".
static void activity_bar_class_init(ActivityBarClass *klass)
static void activity_bar_dispose(GObject *obj)
#define TYPE_ACTIVITY_BAR
ActivityBar * activity_bar_new()
Create new Object ActivityBar.
void activity_bar_set_busy(ActivityBar *bar, const char *text)
Enable spinner and set text. If text is NULL, 'Working...' is displayed.
Opaque ActivityBar object. Not viewable outside this source file.