changeset 2356:4b2c7d9523e7 trunk

[svn] right-clicking on playlist entry automatically selects the entry if it was unselected before, closes #728
author mf0102
date Wed, 17 Jan 2007 12:11:16 -0800
parents f03beaca8e81
children 139d2358f617
files ChangeLog src/audacious/ui_playlist.c src/audacious/widgets/playlist_list.c
diffstat 3 files changed, 28 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 17 08:13:07 2007 -0800
+++ b/ChangeLog	Wed Jan 17 12:11:16 2007 -0800
@@ -1,3 +1,12 @@
+2007-01-17 16:13:07 +0000  Giacomo Lozito <james@develia.org>
+  revision [3720]
+  - ui_fileinfopopup.c uses gtk code, no more glade in it
+  trunk/src/audacious/glade/Makefile             |    1 
+  trunk/src/audacious/glade/fileinfo_popup.glade |  465 -------------------------
+  trunk/src/audacious/ui_fileinfopopup.c         |  176 +++++++--
+  3 files changed, 142 insertions(+), 500 deletions(-)
+
+
 2007-01-17 12:09:20 +0000  Giacomo Lozito <james@develia.org>
   revision [3718]
   - removed other obsolete (and annoying) gdk_window_set_hints calls
--- a/src/audacious/ui_playlist.c	Wed Jan 17 08:13:07 2007 -0800
+++ b/src/audacious/ui_playlist.c	Wed Jan 17 12:11:16 2007 -0800
@@ -1165,6 +1165,7 @@
     }
     else if (event->button == 3 &&
              widget_contains(WIDGET(playlistwin_list), event->x, event->y)) {
+        handle_press_cb(playlistwin_wlist, widget, event);
         ui_manager_popup_menu_show(GTK_MENU(playlistwin_popup_menu),
                                event->x_root, event->y_root + 5,
                                event->button, event->time);
--- a/src/audacious/widgets/playlist_list.c	Wed Jan 17 08:13:07 2007 -0800
+++ b/src/audacious/widgets/playlist_list.c	Wed Jan 17 12:11:16 2007 -0800
@@ -316,18 +316,24 @@
                               GdkEventButton * event,
                               PlayList_List * pl)
 {
-    gint nr, y;
+    gint nr;
     Playlist *playlist = playlist_get_active();
 
-    if (event->button == 1 && pl->pl_fheight &&
-        widget_contains(&pl->pl_widget, event->x, event->y)) {
+	nr = playlist_list_get_playlist_position(pl, event->x, event->y);
+	if (nr == -1)
+		return;
 
-        y = event->y - pl->pl_widget.y;
-        nr = (y / pl->pl_fheight) + pl->pl_first;
-
-        if (nr >= playlist_get_length(playlist))
-            nr = playlist_get_length(playlist) - 1;
-
+	if (event->button == 3)
+	{
+		GList* selection = playlist_get_selected(playlist);
+		if (g_list_find(selection, GINT_TO_POINTER(nr)) == NULL)
+		{
+			playlist_select_all(playlist, FALSE);
+			playlist_select_range(playlist, nr, nr, TRUE);
+		}
+	}
+	else if (event->button == 1)
+	{
         if (!(event->state & GDK_CONTROL_MASK))
             playlist_select_all(playlist, FALSE);
 
@@ -369,8 +375,9 @@
         }
 
         pl->pl_dragging = TRUE;
-        playlistwin_update_list(playlist);
     }
+
+	playlistwin_update_list(playlist);
 }
 
 gint
@@ -391,7 +398,7 @@
 
     ret = (iy / pl->pl_fheight) + pl->pl_first;
 
-    if(ret > length-1)
+    if (ret > length - 1)
 	    ret = -1;
 
     return ret;