diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-03-14 19:53:02 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-03-14 19:53:02 +0100 |
commit | 4ddb4c8c784d9491a760b76e81bb9095146c0263 (patch) | |
tree | 5bb396093b1c1825e7ffb19858c9789f3e1c543d /plugins/gtkui | |
parent | 09574336eb8b749ef9ee4d3804d39a6197fb91cc (diff) |
fixed few regressions in tabstrip widget
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/ddbtabstrip.c | 13 | ||||
-rw-r--r-- | plugins/gtkui/ddbtabstrip.h | 1 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 4 |
3 files changed, 13 insertions, 5 deletions
diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c index 35a92458..8004d0af 100644 --- a/plugins/gtkui/ddbtabstrip.c +++ b/plugins/gtkui/ddbtabstrip.c @@ -315,7 +315,7 @@ tabstrip_render (DdbTabStrip *ts) { } x += tabs_left_margin; // draw selected - if (ts->dragging < 0 || tab_selected != ts->dragging) { + if (ts->dragging < 0 || ts->prepare || tab_selected != ts->dragging) { idx = tab_selected; w = widths[tab_selected]; GdkRectangle area; @@ -527,9 +527,6 @@ on_rename_playlist1_activate (GtkMenuItem *menuitem, const char *text = gtk_entry_get_text (GTK_ENTRY (e)); deadbeef->plt_set_title (tab_clicked, text); extern GtkWidget *mainwin; - DdbTabStrip *ts = DDB_TABSTRIP (lookup_widget (mainwin, "tabstrip")); - tabstrip_render (ts); - tabstrip_expose (ts, 0, 0, GTK_WIDGET (ts)->allocation.width, GTK_WIDGET (ts)->allocation.height); } gtk_widget_destroy (dlg); } @@ -569,6 +566,9 @@ on_add_new_playlist1_activate (GtkMenuItem *menuitem, } if (i == cnt) { deadbeef->plt_add (cnt, name); + DdbTabStrip *ts = DDB_TABSTRIP (lookup_widget (mainwin, "tabstrip")); + tabstrip_render (ts); + tabstrip_expose (ts, 0, 0, GTK_WIDGET (ts)->allocation.width, GTK_WIDGET (ts)->allocation.height); break; } idx++; @@ -599,3 +599,8 @@ on_save_all_playlists1_activate (GtkMenuItem *menuitem, } +void +ddb_tabstrip_refresh (DdbTabStrip *ts) { + tabstrip_render (ts); + tabstrip_expose (ts, 0, 0, GTK_WIDGET (ts)->allocation.width, GTK_WIDGET (ts)->allocation.height); +} diff --git a/plugins/gtkui/ddbtabstrip.h b/plugins/gtkui/ddbtabstrip.h index b6192e06..75a08aa3 100644 --- a/plugins/gtkui/ddbtabstrip.h +++ b/plugins/gtkui/ddbtabstrip.h @@ -53,6 +53,7 @@ struct _DdbTabStripClass { GType ddb_tabstrip_get_type(void) G_GNUC_CONST; GtkWidget * ddb_tabstrip_new(void); +void ddb_tabstrip_refresh (DdbTabStrip *ts); G_END_DECLS diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 2848aa28..a62b7661 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -42,6 +42,7 @@ #include "../artwork/artwork.h" #include "coverart.h" #include "plcommon.h" +#include "ddbtabstrip.h" //#define trace(...) { fprintf(stderr, __VA_ARGS__); } #define trace(fmt,...) @@ -441,7 +442,8 @@ playlistswitch_cb (gpointer none) { char conf[100]; snprintf (conf, sizeof (conf), "playlist.scroll.%d", curr); int scroll = deadbeef->conf_get_int (conf, 0); - gdk_window_invalidate_rect (tabstrip->window, NULL, FALSE); +// gdk_window_invalidate_rect (tabstrip->window, NULL, FALSE); + ddb_tabstrip_refresh (DDB_TABSTRIP (tabstrip)); DdbListview *listview = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); playlist_refresh (); ddb_listview_set_vscroll (listview, scroll); |