summaryrefslogtreecommitdiff
path: root/plugins/gtkui/gtkplaylist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-23 21:15:35 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-23 21:15:35 +0100
commitd55be151ce3a2244b0143ab2fff986df5bfb227a (patch)
treec091b820ab6d078a41d314baf98d645aced292e5 /plugins/gtkui/gtkplaylist.c
parent301f38f04ab0a6c693f5872968059d999202c227 (diff)
added gtkpl_get_column_for_click function
Diffstat (limited to 'plugins/gtkui/gtkplaylist.c')
-rw-r--r--plugins/gtkui/gtkplaylist.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index b3984481..272246d6 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -1476,6 +1476,20 @@ on_header_motion_notify_event (GtkWidget *widget,
return FALSE;
}
+int
+gtkpl_get_column_for_click (gtkplaylist_t *pl, int click_x) {
+ int x = -pl->hscrollpos;
+ int i = 0;
+ gtkpl_column_t *c;
+ for (c = pl->columns; c; c = c->next, i++) {
+ int w = c->width;
+ if (click_x >= x && click_x < x + w) {
+ return i;
+ }
+ }
+ return -1;
+}
+
gboolean
on_header_button_press_event (GtkWidget *widget,
GdkEventButton *event,