Skip to content

Conversation

andrzej-az
Copy link

This pr allows to turn the page by single touchscreen tap. The reading area is divided vertically into two zones:
40% (left side): Tapping here navigates to the previous page.
60% (right side): Tapping here navigates to the next page.

tested on epub in "single page" and "scrolled" mode.
seems does not affect on other functionality
NOTE: this change affects touchscreen only, the mouse/touchpad behavior is left "as is"

'pressed': (gesture, n_press, x, y) => {
pressedX = x;
},
'released': (gesture, n_press, x, y) => { if (pressedX == x) setTimeout(() => {this.onTap(x,y)},100)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why setTimeout is needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember, the delay is needed thanks to swipe behavior: without it 2 or more pages will be turned.

@johnfactotum
Copy link
Owner

Probably tapping will need to be handled in WebView and not on the GTK side because it needs to handle cases where there are clickable elements on the page. Although currently it doesn't support scripting and form submission, there's still <a> and <details> elements that shouldn't trigger page turns when tapped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants