File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ def __init__(self, parent):
8787 makeWidgetShortcut (self , self .onReturnShortcut , "Return" , "Enter" )
8888 makeWidgetShortcut (self , self .onDeleteShortcut , "Delete" )
8989 makeWidgetShortcut (self , self .onRenameShortcut , "F2" )
90+ makeWidgetShortcut (self , self .searchBar .hideOrBeep , "Escape" )
9091
9192 def filterIndexToNode (self , index : QModelIndex ) -> SidebarNode :
9293 assert index .isValid ()
Original file line number Diff line number Diff line change @@ -583,6 +583,11 @@ def testSidebarFilter(tempDir, mainWindow):
583583 # "no-parent" doesn't contain "fix", so it must be hidden
584584 assert not sb .indexForRef ("refs/heads/no-parent" ).isValid ()
585585
586+ # Hide with keyboard shortcut
587+ sb .setFocus ()
588+ QTest .keyClick (sb , Qt .Key .Key_Escape )
589+ assert not searchBar .isVisible ()
590+
586591
587592def testSidebarFilterWithFolders (tempDir , mainWindow ):
588593 wd = unpackRepo (tempDir )
You can’t perform that action at this time.
0 commit comments