From 21f5fbdf1d36d7f1dc7cb8217c3831ccf2ed83c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 26 Aug 2019 11:15:15 +0530 Subject: [PATCH] Make the controls help page nicer --- src/pyj/read_book/view.pyj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index c3297e341e..d3adc29947 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -60,7 +60,7 @@ def show_controls_help(): def focus(): if container.style.display is 'block': - container.lastChild.focus() + container.querySelector('input').focus() window.setTimeout(focus, 10) if runtime.is_standalone_viewer: @@ -69,6 +69,8 @@ def show_controls_help(): E.div(style='margin-top: 1rem'), E.div(style='margin-top: 1rem'), E.div(style='margin-top: 1rem'), + E.div(style='margin-top: 1rem'), + E.input(style='background: transparent; border-width: 0; outline: none', readonly='readonly'), )) div = container.lastChild.firstChild safe_set_inner_html(div, _('Welcome to the calibre viewer!')) @@ -76,7 +78,8 @@ def show_controls_help(): safe_set_inner_html(div, _('Use the PageUp/PageDn or Arrow keys to turn pages')) div = div.nextSibling safe_set_inner_html(div, _('Press the Esc key or right click to show the viewer controls')) - container.appendChild(E.input(style='background: transparent; border-width: 0; outline: none')) + div = div.nextSibling + safe_set_inner_html(div, _('Press any key to continue…')) focus() return