Add Read aloud entry to viewer controls

This commit is contained in:
Kovid Goyal 2020-12-04 06:22:51 +05:30
parent 1966b790d2
commit 65445427fd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 1 deletions

View File

@ -334,6 +334,13 @@ class MainOverlay: # {{{
if full_screen_actions.length:
actions_div.appendChild(E.ul(*full_screen_actions))
actions_div.appendChild(E.ul(
ac(_('Read aloud'), _('Read the book aloud'), def():
self.overlay.hide()
self.overlay.view.start_read_aloud()
, 'bullhorn')
))
no_selection_bar = not sd.get('show_selection_bar')
if runtime.is_standalone_viewer:
if no_selection_bar:

View File

@ -674,9 +674,11 @@ class View:
else:
self.iframe.contentWindow.focus()
def start_read_aloud(self):
def start_read_aloud(self, dont_start_talking):
self.selection_bar.hide()
self.read_aloud.show()
if not dont_start_talking:
self.read_aloud.play()
def show_chrome(self, data):
elements = {}