mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Coupe of misc shortcuts
This commit is contained in:
parent
e58a50e7ed
commit
8b62a6bcbb
@ -70,6 +70,9 @@ class SearchOverlay:
|
||||
def is_visible(self):
|
||||
return self.container.style.display is not 'none'
|
||||
|
||||
def set_text(self, text):
|
||||
self.container.querySelector('input').value = text or ''
|
||||
|
||||
def hide(self):
|
||||
self.container.style.display = 'none'
|
||||
|
||||
|
@ -192,6 +192,18 @@ SHORTCUTS = {
|
||||
'ui',
|
||||
_('Toggle full screen'),
|
||||
),
|
||||
|
||||
'reload_book': desc(
|
||||
v"['F5', 'Ctrl+r']",
|
||||
'ui',
|
||||
_('Reload book'),
|
||||
),
|
||||
|
||||
'search_for_selection': desc(
|
||||
v"['Ctrl+s']",
|
||||
'ui',
|
||||
_('Search for next occurrence of selected text'),
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,6 +243,12 @@ class View:
|
||||
self.bump_font_size({'increase': False})
|
||||
elif data.name is 'toggle_full_screen':
|
||||
ui_operations.toggle_full_screen()
|
||||
elif data.name is 'reload_book':
|
||||
ui_operations.reload_book()
|
||||
elif data.name is 'search_for_selection':
|
||||
if self.currently_showing.selected_text:
|
||||
self.search_overlay.set_text(self.currently_showing.selected_text)
|
||||
self.search_overlay.find_next()
|
||||
|
||||
def on_selection_change(self, data):
|
||||
self.currently_showing.selected_text = data.text
|
||||
|
Loading…
x
Reference in New Issue
Block a user