Commits

Steve Borho committed 8106c04

manifestdialog: add search bar's toggle action to toolbar

Comments (0)

Files changed (1)

tortoisehg/hgqt/manifestdialog.py

         self._action_annotate_mode.setEnabled(self.rev is not None)
         self._toolbar.addAction(self._action_annotate_mode)
 
+        if hasattr(self, '_searchbar'):
+            self._action_find = self._searchbar.toggleViewAction()
+            self._action_find.setIcon(qtlib.geticon('edit-find'))
+            self._action_find.setShortcut(QKeySequence.Find)
+            self._toolbar.addAction(self._action_find)
+
         self._actions = {}
         for name, desc, icon, key, tip, cb in [
             ('navigate', _('File history'), None, 'Shift+Return',
         super(ManifestTaskWidget, self).__init__(repo, rev, parent)
         self.editSelected.connect(self._openInEditor)
 
-    @pyqtSlot()
-    def toggleSearchBar(self):
-        vis = self._searchbar.isVisible()
-        if vis:
-            self._searchbar.hide()
-        else:
-            self._searchbar.show()
-            self._searchbar.setFocus()
-
     @util.propertycache
     def _searchbar(self):
         searchbar = qscilib.SearchToolBar(hidable=True)