diff options
author | Christian Boxdörfer <christian.boxdoerfer@posteo.de> | 2013-11-07 22:11:25 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-09 11:42:37 +0100 |
commit | 64a203025e8d90c6c34fb6326126ea2d87987fda (patch) | |
tree | 538f5832b785797dda1e6d3ec503dd59dcc14caf | |
parent | bb4057a3cc7cb28829eb44cf05e3c325939ae3fe (diff) |
gtkui: double click on statusbar jumps to current track
-rw-r--r-- | plugins/gtkui/callbacks.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index e1f943ee..d341a425 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -571,9 +571,11 @@ on_mainwin_button_press_event (GtkWidget *widget, } GtkWidget *volumebar = lookup_widget (mainwin, "volumebar"); GtkWidget *seekbar = lookup_widget (mainwin, "seekbar"); - GtkAllocation a, b; + GtkWidget *statusbar = lookup_widget (mainwin, "statusbar"); + GtkAllocation a, b, c; gtk_widget_get_allocation (volumebar, &a); gtk_widget_get_allocation (seekbar, &b); + gtk_widget_get_allocation (statusbar, &c); if (event->x >= a.x && event->x < a.x + a.width && event->y >= a.y && event->y < a.y + a.height) { capture = volumebar; @@ -584,6 +586,12 @@ on_mainwin_button_press_event (GtkWidget *widget, capture = seekbar; return gtk_widget_event (seekbar, (GdkEvent *)event); } + else if (event->x >= c.x && event->x < c.x + c.width + && event->y >= c.y && event->y < c.y + c.height) { + if (event->type == GDK_2BUTTON_PRESS) { + deadbeef->sendmessage (DB_EV_TRACKFOCUSCURRENT, 0, 0, 0); + } + } return FALSE; } |