On macOS have to control-click since there is no right mouse button

This commit is contained in:
Kovid Goyal 2019-09-17 19:20:31 +05:30
parent d1badedfc7
commit 0c5c492333
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 3 deletions

View File

@ -19,7 +19,7 @@ from PyQt5.QtWebEngineWidgets import (
from calibre import as_unicode, prints
from calibre.constants import (
FAKE_HOST, FAKE_PROTOCOL, __version__, is_running_from_develop
FAKE_HOST, FAKE_PROTOCOL, __version__, is_running_from_develop, isosx, iswindows
)
from calibre.ebooks.metadata.book.base import field_metadata
from calibre.ebooks.oeb.polish.utils import guess_type
@ -172,7 +172,8 @@ def create_profile():
ans = getattr(create_profile, 'ans', None)
if ans is None:
ans = QWebEngineProfile(QApplication.instance())
ua = 'calibre-viewer ' + __version__
osname = 'windows' if iswindows else ('macos' if isosx else 'linux')
ua = 'calibre-viewer {} {}'.format(__version__, osname)
ans.setHttpUserAgent(ua)
if is_running_from_develop:
from calibre.utils.rapydscript import compile_viewer

View File

@ -78,7 +78,9 @@ def show_controls_help():
div = div.nextSibling
safe_set_inner_html(div, _('Use the <b>PageUp/PageDn</b> or <b>Arrow keys</b> to turn pages'))
div = div.nextSibling
safe_set_inner_html(div, _('Press the <b>Esc</b> key or <b>right click</b> to show the viewer controls'))
safe_set_inner_html(div, _('Press the <b>Esc</b> key or <b>{} click</b> to show the viewer controls').format(
'control' if 'macos' in window.navigator.userAgent else _('right')
))
div = div.nextSibling
safe_set_inner_html(div, _('Press any key to continue…'))
focus()