diff --git a/src/calibre/gui2/viewer/config.py b/src/calibre/gui2/viewer/config.py
index dbcd36bc66..9b9644101b 100644
--- a/src/calibre/gui2/viewer/config.py
+++ b/src/calibre/gui2/viewer/config.py
@@ -51,6 +51,8 @@ def config(defaults=None):
help=_('Save the current position in the document, when quitting'))
c.add_opt('wheel_flips_pages', default=False,
help=_('Have the mouse wheel turn pages'))
+ c.add_opt('tap_flips_pages', default=True,
+ help=_('Tapping on the screen turns pages'))
c.add_opt('line_scrolling_stops_on_pagebreaks', default=False,
help=_('Prevent the up and down arrow keys from scrolling past '
'page breaks'))
@@ -280,6 +282,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
self.opt_remember_window_size.setChecked(opts.remember_window_size)
self.opt_remember_current_page.setChecked(opts.remember_current_page)
self.opt_wheel_flips_pages.setChecked(opts.wheel_flips_pages)
+ self.opt_tap_flips_pages.setChecked(opts.tap_flips_pages)
self.opt_page_flip_duration.setValue(opts.page_flip_duration)
fms = opts.font_magnification_step
if fms < 0.01 or fms > 1:
@@ -381,6 +384,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
c.set('hyphenate', self.hyphenate.isChecked())
c.set('remember_current_page', self.opt_remember_current_page.isChecked())
c.set('wheel_flips_pages', self.opt_wheel_flips_pages.isChecked())
+ c.set('tap_flips_pages', self.opt_tap_flips_pages.isChecked())
c.set('page_flip_duration', self.opt_page_flip_duration.value())
c.set('font_magnification_step',
float(self.opt_font_mag_step.value())/100.)
diff --git a/src/calibre/gui2/viewer/config.ui b/src/calibre/gui2/viewer/config.ui
index 9b325f6398..b87097eea8 100644
--- a/src/calibre/gui2/viewer/config.ui
+++ b/src/calibre/gui2/viewer/config.ui
@@ -60,15 +60,15 @@ QToolBox::tab:hover {
}
- 2
+ 0
0
0
- 371
- 236
+ 799
+ 378
@@ -370,8 +370,8 @@ QToolBox::tab:hover {
0
0
- 799
- 378
+ 381
+ 193
@@ -551,8 +551,8 @@ QToolBox::tab:hover {
0
0
- 384
- 115
+ 799
+ 378
@@ -594,27 +594,34 @@ QToolBox::tab:hover {
- -
+
-
Mouse &wheel flips pages
- -
+
-
Line &scrolling stops at page breaks
- -
+
-
&Resize images larger than the viewer window (needs restart)
+ -
+
+
+ &Tapping on the page flips pages
+
+
+
diff --git a/src/calibre/gui2/viewer/documentview.py b/src/calibre/gui2/viewer/documentview.py
index c1626ad4c2..5f081281aa 100644
--- a/src/calibre/gui2/viewer/documentview.py
+++ b/src/calibre/gui2/viewer/documentview.py
@@ -157,6 +157,7 @@ class Document(QWebPage): # {{{
self.enable_page_flip = self.page_flip_duration > 0.1
self.font_magnification_step = opts.font_magnification_step
self.wheel_flips_pages = opts.wheel_flips_pages
+ self.tap_flips_pages = opts.tap_flips_pages
self.line_scrolling_stops_on_pagebreaks = opts.line_scrolling_stops_on_pagebreaks
screen_width = QApplication.desktop().screenGeometry().width()
# Leave some space for the scrollbar and some border
diff --git a/src/calibre/gui2/viewer/gestures.py b/src/calibre/gui2/viewer/gestures.py
index 32a6ea6d1b..94e963aa1a 100644
--- a/src/calibre/gui2/viewer/gestures.py
+++ b/src/calibre/gui2/viewer/gestures.py
@@ -322,9 +322,10 @@ class GestureHandler(QObject):
mf = view.document.mainFrame()
r = mf.hitTestContent(self.current_position(tp))
if r.linkElement().isNull():
- threshold = view.width() / 3.0
- attr = 'previous' if self.current_position(tp).x() <= threshold else 'next'
- getattr(view, '%s_page'%attr)()
+ if view.document.tap_flips_pages:
+ threshold = view.width() / 3.0
+ attr = 'previous' if self.current_position(tp).x() <= threshold else 'next'
+ getattr(view, '%s_page'%attr)()
else:
for etype in (QEvent.MouseButtonPress, QEvent.MouseButtonRelease):
ev = QMouseEvent(etype, self.current_position(tp), tp.current_screen_position.toPoint(), Qt.LeftButton, Qt.LeftButton, Qt.NoModifier)