summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-07-31 21:34:50 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-07-31 21:34:50 +0200
commit79d0a9187928ccb832eefff59c609dfe03bb79fb (patch)
treec2621c6d95a43a7fa674ac8464b6bb53f45b7908
parent2f1e23a9bd61ce9294af0835b607b265b82515c0 (diff)
drag and drop WIP
-rw-r--r--callbacks.c11
-rw-r--r--gtkplaylist.c10
2 files changed, 12 insertions, 9 deletions
diff --git a/callbacks.c b/callbacks.c
index 4d301444..68851159 100644
--- a/callbacks.c
+++ b/callbacks.c
@@ -84,8 +84,8 @@ on_playlist_realize (GtkWidget *widget,
gpointer user_data)
{
GtkTargetEntry entry = {
- .target = "",
- .flags = GTK_TARGET_SAME_WIDGET | GTK_TARGET_OTHER_APP,
+ .target = "filelist",
+ .flags = GTK_TARGET_SAME_WIDGET/* | GTK_TARGET_OTHER_APP*/,
0
};
// setup drag-drop source
@@ -359,6 +359,7 @@ on_playlist_drag_drop (GtkWidget *widget,
guint time,
gpointer user_data)
{
+ printf ("drag_drop\n");
return FALSE;
}
@@ -379,6 +380,8 @@ on_playlist_drag_end (GtkWidget *widget,
GdkDragContext *drag_context,
gpointer user_data)
{
+ printf ("drag_end\n");
+
}
@@ -388,6 +391,7 @@ on_playlist_drag_failed (GtkWidget *widget,
GtkDragResult arg2,
gpointer user_data)
{
+ printf ("drag_failed\n");
return FALSE;
}
@@ -401,9 +405,6 @@ on_playlist_drag_leave (GtkWidget *widget,
gtkps_track_dragdrop (-1);
}
-
-
-
void
on_voice1_clicked (GtkButton *button,
gpointer user_data)
diff --git a/gtkplaylist.c b/gtkplaylist.c
index 86f6c758..d034b5b2 100644
--- a/gtkplaylist.c
+++ b/gtkplaylist.c
@@ -391,7 +391,7 @@ gtkps_mousemove (GdkEventMotion *event) {
dragwait = 0;
GtkWidget *widget = lookup_widget (mainwin, "playlist");
GtkTargetEntry entry = {
- .target = "",
+ .target = "filelist",
.flags = GTK_TARGET_SAME_WIDGET,
.info = 0
};
@@ -700,6 +700,11 @@ gtkps_keypress (int keyval, int state) {
}
draw_playlist (widget, 0, 0, widget->allocation.width, widget->allocation.height);
gdk_draw_drawable (widget->window, widget->style->black_gc, backbuf, 0, 0, 0, 0, widget->allocation.width, widget->allocation.height);
+ return;
+ }
+ else if (keyval == GDK_Return && playlist_row != -1) {
+ messagepump_push (M_PLAYSONGNUM, 0, playlist_row, 0);
+ return;
}
else if (keyval == GDK_Down && playlist_row < ps_getcount () - 1) {
playlist_row++;
@@ -731,9 +736,6 @@ gtkps_keypress (int keyval, int state) {
newscroll = playlist_row;
}
}
- else if (keyval == GDK_Return && playlist_row != -1) {
- messagepump_push (M_PLAYSONGNUM, 0, playlist_row, 0);
- }
else if (keyval == GDK_End && playlist_row != ps_getcount () - 1) {
playlist_row = ps_getcount () - 1;
if (playlist_row > scrollpos + widget->allocation.height / rowheight - 1) {