[easytag/wip/unstable: 36/56] Deselect when clicking a blank image treeview area



commit 1f3d536c8d5c61b8b61c1a5f7b954ff3595b6035
Author: Abhinav <abhijangda hotmail com>
Date:   Sat Apr 20 17:48:22 2013 +0530

    Deselect when clicking a blank image treeview area
    
    When clicking on a blank area in the tree view of image tags, deselect
    all rows. Fixes bug 698149.

 src/picture.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/picture.c b/src/picture.c
index a159b86..1204b8f 100644
--- a/src/picture.c
+++ b/src/picture.c
@@ -1209,6 +1209,18 @@ Picture_Save_File_Data (const Picture *pic, const gchar *filename)
  */
 gboolean Picture_Entry_View_Button_Pressed (GtkTreeView *treeview, GdkEventButton *event, gpointer data)
 {
+    if (event->type == GDK_BUTTON_PRESS && event->button == 1)
+    {
+        if (event->window == gtk_tree_view_get_bin_window (treeview))
+        {
+            if (!gtk_tree_view_get_path_at_pos (treeview, event->x, event->y,
+                                                NULL, NULL, NULL, NULL))
+            {
+                gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (treeview));
+            }
+        }
+    }
+
     if (event->type==GDK_2BUTTON_PRESS && event->button==1)
     {
         GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(PictureEntryView));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]