mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: When unmarking marked text, automatically ensure the current search scope is not to search in marked text
This commit is contained in:
parent
b0f808f2a0
commit
e44ca5f067
@ -796,6 +796,8 @@ class Boss(QObject):
|
||||
ed.mark_selected_text()
|
||||
if ed.has_marked_text:
|
||||
self.gui.central.search_panel.set_where('selected-text')
|
||||
else:
|
||||
self.gui.central.search_panel.unset_marked()
|
||||
|
||||
def editor_action(self, action):
|
||||
ed = self.gui.central.current_editor
|
||||
|
@ -485,6 +485,10 @@ class SearchPanel(QWidget): # {{{
|
||||
def set_where(self, val):
|
||||
self.widget.where = val
|
||||
|
||||
def unset_marked(self):
|
||||
if self.widget.where == 'selected-text':
|
||||
self.widget.where = self.widget.DEFAULT_STATE['where']
|
||||
|
||||
def keyPressEvent(self, ev):
|
||||
if ev.key() == Qt.Key_Escape:
|
||||
self.hide_panel()
|
||||
|
Loading…
x
Reference in New Issue
Block a user