mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-30 00:55:56 +01:00
DRYer
This commit is contained in:
parent
5f2f110f9f
commit
85e8d8c82f
2 changed files with 10 additions and 10 deletions
|
|
@ -89,16 +89,10 @@ def find(self, text, backwards):
|
|||
self.view.find(text, backwards)
|
||||
|
||||
def find_next(self):
|
||||
if ui_operations.find_next:
|
||||
ui_operations.find_next(False)
|
||||
else:
|
||||
self.find(self.search_text, False)
|
||||
self.find(self.search_text, False)
|
||||
|
||||
def find_previous(self):
|
||||
if ui_operations.find_next:
|
||||
ui_operations.find_next(True)
|
||||
else:
|
||||
self.find(self.search_text, True)
|
||||
self.find(self.search_text, True)
|
||||
|
||||
|
||||
def find_in_serialized_html(data, text):
|
||||
|
|
|
|||
|
|
@ -518,9 +518,15 @@ def on_handle_shortcut(self, data):
|
|||
elif data.name is 'start_search':
|
||||
self.show_search()
|
||||
elif data.name is 'next_match':
|
||||
self.search_overlay.find_next()
|
||||
if ui_operations.find_next:
|
||||
ui_operations.find_next()
|
||||
else:
|
||||
self.search_overlay.find_next()
|
||||
elif data.name is 'previous_match':
|
||||
self.search_overlay.find_previous()
|
||||
if ui_operations.find_next:
|
||||
ui_operations.find_next(True)
|
||||
else:
|
||||
self.search_overlay.find_previous()
|
||||
elif data.name is 'increase_font_size':
|
||||
self.bump_font_size({'increase': True})
|
||||
elif data.name is 'decrease_font_size':
|
||||
|
|
|
|||
Loading…
Reference in a new issue