[geary: 1/2] Highlight destination folder upon conversation DND



commit eb36fd59296a576b7ccc4cc523ff851a8969b06d
Author: Chris Heywood <15127-creywood users noreply gitlab gnome org>
Date:   Thu Nov 28 11:33:28 2019 +0100

    Highlight destination folder upon conversation DND
    
    Further utilises partially enabled automatic DND. Fixes #422.

 src/client/folder-list/folder-list-tree.vala | 22 +---------------------
 ui/geary.css                                 |  9 +++++++++
 2 files changed, 10 insertions(+), 21 deletions(-)
---
diff --git a/src/client/folder-list/folder-list-tree.vala b/src/client/folder-list/folder-list-tree.vala
index eaa1d981..e9163da1 100644
--- a/src/client/folder-list/folder-list-tree.vala
+++ b/src/client/folder-list/folder-list-tree.vala
@@ -25,14 +25,10 @@ public class FolderList.Tree : Sidebar.Tree, Geary.BaseInterface {
     private Application.NotificationContext? monitor = null;
 
     public Tree() {
-        base(new Gtk.TargetEntry[0], Gdk.DragAction.ASK, drop_handler);
+        base(TARGET_ENTRY_LIST, Gdk.DragAction.ASK, drop_handler);
         base_ref();
         entry_selected.connect(on_entry_selected);
 
-        // Set self as a drag destination.
-        Gtk.drag_dest_set(this, Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,
-            TARGET_ENTRY_LIST, Gdk.DragAction.COPY | Gdk.DragAction.MOVE);
-
         // GtkTreeView binds Ctrl+N to "move cursor to next".  Not so interested in that, so we'll
         // remove it.
         unowned Gtk.BindingSet? binding_set = Gtk.BindingSet.find("GtkTreeView");
@@ -213,22 +209,6 @@ public class FolderList.Tree : Sidebar.Tree, Geary.BaseInterface {
         folder_selected(null);
     }
 
-    public override bool drag_motion(Gdk.DragContext context, int x, int y, uint time) {
-        // Run the base version first.
-        bool ret = base.drag_motion(context, x, y, time);
-
-        // Update the cursor for copy or move.
-        Gdk.ModifierType mask;
-        double[] axes = new double[2];
-        context.get_device().get_state(context.get_dest_window(), axes, out mask);
-        if ((mask & Gdk.ModifierType.CONTROL_MASK) != 0) {
-            Gdk.drag_status(context, Gdk.DragAction.COPY, time);
-        } else {
-            Gdk.drag_status(context, Gdk.DragAction.MOVE, time);
-        }
-        return ret;
-    }
-
     private void on_ordinal_changed() {
         if (account_branches.size <= 1)
             return;
diff --git a/ui/geary.css b/ui/geary.css
index 85b07146..ab8c07fb 100644
--- a/ui/geary.css
+++ b/ui/geary.css
@@ -325,3 +325,12 @@ popover.geary-editor > grid {
 popover.geary-editor > grid > button.geary-setting-remove {
   margin-top: 12px;
 }
+
+/* FolderList.Tree */
+
+treeview.sidebar:drop(active).after,
+treeview.sidebar:drop(active).before,
+treeview.sidebar:drop(active).into {
+  border-top-style: solid;
+  border-bottom-style: solid;
+}


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