[meld/ui-next] vcview: Set the cursor on load so that shortcuts work



commit d5d33a64663cdeccdc596e44217bbf4ed5d10dd0
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Apr 13 08:50:11 2019 +1000

    vcview: Set the cursor on load so that shortcuts work
    
    Manually setting the cursor to the first row in the tree ensures that
    the sensitivity setting for e.g., the next diff action gets run. Without
    this, cursor-dependent shortcuts such as Alt+Down won't work without
    the user focusing the treeview manually or otherwise causing a
    sensitivity recalculation.

 meld/vcview.py | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/meld/vcview.py b/meld/vcview.py
index 69ae2e0c..554ef5a0 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -494,6 +494,7 @@ class VcView(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
                     self.treeview.expand_to_path(treepath)
 
         self.treeview.expand_row(Gtk.TreePath.new_first(), False)
+        self.treeview.set_cursor(Gtk.TreePath.new_first())
 
     # TODO: This doesn't fire when the user selects a shortcut folder
     @Template.Callback()


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