summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-03 11:25:56 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-03 11:25:56 +0100
commit0869004d5d23c2e6dc2e023387dedb959fd3cfc7 (patch)
treefa5b762167d70b316e57fed40119474cad93c054 /plugins/gtkui
parent66c30b0e58d25a071f2c6ef3af0576cb06ec0adc (diff)
gtkui: fixed tabstrip widget refresh
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/widgets.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index 427c992c..46d96f7a 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -92,6 +92,7 @@ typedef struct {
typedef struct {
ddb_gtkui_widget_t base;
+ GtkWidget *tabstrip;
} w_tabstrip_t;
typedef struct {
@@ -1519,6 +1520,21 @@ w_box_create (void) {
}
//// tabstrip widget
+static gboolean
+tabstrip_refresh_cb (void *ctx) {
+ w_tabstrip_t *w = ctx;
+ ddb_tabstrip_refresh (DDB_TABSTRIP (w->tabstrip));
+ return FALSE;
+}
+static int
+w_tabstrip_message (ddb_gtkui_widget_t *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
+ switch (id) {
+ case DB_EV_PLAYLISTSWITCHED:
+ g_idle_add (tabstrip_refresh_cb, w);
+ break;
+ }
+ return 0;
+}
ddb_gtkui_widget_t *
w_tabstrip_create (void) {
@@ -1526,9 +1542,11 @@ w_tabstrip_create (void) {
memset (w, 0, sizeof (w_tabstrip_t));
w->base.flags = DDB_GTKUI_WIDGET_FLAG_NON_EXPANDABLE;
w->base.widget = gtk_event_box_new ();
+ w->base.message = w_tabstrip_message;
GtkWidget *ts = ddb_tabstrip_new ();
gtk_widget_show (ts);
gtk_container_add (GTK_CONTAINER (w->base.widget), ts);
+ w->tabstrip = ts;
w_override_signals (w->base.widget, w);
return (ddb_gtkui_widget_t*)w;
}