Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possbile to disable touch ( navigate) property of the progress bar ? #9277

Closed
omer-faruq opened this issue Jul 2, 2022 · 17 comments
Closed
Labels
enhancement User patch available Request is odd, specific, or complicated to do properly - but a user patch is provided

Comments

@omer-faruq
Copy link

omer-faruq commented Jul 2, 2022

It is good to have progress bar to know where I am in, However sometimes I mistakenly touch the progress bar and navigate to a different place, and it is hard to get back to the page I read. So is there a way to disable touch (navigate) property of the progress bar?
(using the app on Kobo Forma)

@omer-faruq omer-faruq changed the title disable progress bar touch ( navigate) property Is it possbile to disable progress bar touch ( navigate) property ? Jul 2, 2022
@omer-faruq omer-faruq changed the title Is it possbile to disable progress bar touch ( navigate) property ? Is it possbile to disable touch ( navigate) property of the progress bar ? Jul 2, 2022
@poire-z
Copy link
Contributor

poire-z commented Jul 2, 2022

What progress bar are you talking about ?

The one in the footer does not jump on touch (the footer hides/shows on touch as a whole, without jumping, and this can be disabled with "Lock status bar" in the menu).
The "Skim" widget one does, but well, it is displayed only when you request to see it, so there shouldn't be any accidental jump.
So, what progress bar ? :/

@omer-faruq
Copy link
Author

The one I'm talking about is in the footer. It turns out that it does not jump always; only while reading a PDF and in Page Preview mode ( when I clicked on the top left corner). Otherwise it does not jump as you said.

@poire-z
Copy link
Contributor

poire-z commented Jul 2, 2022

I didn't even know about this "feature" :)

function ReaderFooter:onTapFooter(ges)
local ignore_lock = false
if ges == true then
ignore_lock = true
ges = nil
end
if self.view.flipping_visible and ges then
local pos = ges.pos
local dimen = self.progress_bar.dimen
-- if reader footer is not drawn before the dimen value should be nil
if dimen then
local percentage = (pos.x - dimen.x)/dimen.w
self.ui:handleEvent(Event:new("GotoPercentage", percentage))
end
self:onUpdateFooter(true)
return true
end

Is it a mode you spent a lot of time in ?!
It's supposed to indeed be a page preview to get an overall view of the original page in case of reflow/zoom to columns/rows I guess - so well, quick navigation with tap on the footer may be welcome (although it's not really precise). Not sure how tap there could be accidental :)

May be it just needs to add the current location "to stack", so you can "Go back to previous location":

--- a/frontend/apps/reader/modules/readerfooter.lua
+++ b/frontend/apps/reader/modules/readerfooter.lua
@@ -2359,6 +2359,7 @@ function ReaderFooter:onTapFooter(ges)
         -- if reader footer is not drawn before the dimen value should be nil
         if dimen then
             local percentage = (pos.x - dimen.x)/dimen.w
+            self.ui.link:addCurrentLocationToStack()
             self.ui:handleEvent(Event:new("GotoPercentage", percentage))
         end
         self:onUpdateFooter(true)

(I have "Go back to previous location" associated to a horizontal swipe - but horizontal swipe in this "page preview" does scroll pages :) so you need to get out of "page preview" to get "Go back to previous location" to work.)

I guess the above should only happen once when in page preview, not for every jump - so that if you do 10 jumps, you don't have to do 10 "go back to previous location").

@Frenzie
Copy link
Member

Frenzie commented Jul 2, 2022

It's called page flipping mode for a reason. ;-)

@omer-faruq
Copy link
Author

Thanks for your reply, and time , I'll add this modification, and try to use "Go back to previous location" function.

Or I can disable this jumping function with commenting out the line below. ( I guess)

The reason I currently use page flipping more frequent is as follows: The PDF I'm currently reading has some blank pages which only have a vertical thick line in them , and auto clip function considers this page as a long vertical one, hence scrolling takes some time. as a shortcut I'm using this page flipping mode.

@poire-z
Copy link
Contributor

poire-z commented Jul 2, 2022

I'll add this modification, and try to use "Go back to previous location" function.
Or I can disable this jumping function with commenting out the line below. ( I guess)

Yes, you could hack the code, but you'll have to do it after each update.
But we support (since a few days ago) "user patches", that you can quickly hack to override some behaviour you don't like. See #9265 (comment).

For your wish, it could be as simple as creating a directory koreader/patches/ and dropping in it 2-no-jump-in-flipping-mode.lua.txt as koreader/patches/2-no-jump-in-flipping-mode.lua (remove the .txt extension).

local ReaderFooter = require("apps/reader/modules/readerfooter")
local onTapFooter_orig = ReaderFooter.onTapFooter
ReaderFooter.onTapFooter = function(self, ges)
  if self.view.flipping_visible then return true end
  return onTapFooter_orig(self, ges)
end

@omer-faruq
Copy link
Author

Thanks again, created the folder and the file. 👍

@poire-z poire-z added the User patch available Request is odd, specific, or complicated to do properly - but a user patch is provided label Jul 2, 2022
@pazos
Copy link
Member

pazos commented Jul 2, 2022

I looooove the new flag :)

@poire-z
Copy link
Contributor

poire-z commented Jul 2, 2022

Glad you do :)
OK, closing, as the purpose of this new label is to allow closing issues.

There's still something to do about the addLocationToStack on the first "go to page/percentage" (and only the first) after entering flipping mode.

@ryanwwest
Copy link
Contributor

Following these older issues but I can't figure out how to enable or even locate 'Page Preview mode' and 'page flipping mode' in the latest KOreader versions in, e.g., the help menu search—were they renamed?

@NiLuJe
Copy link
Member

NiLuJe commented Sep 7, 2023

As far as this issue is concerned, page preview appears to have been referring in all cases to the page flip thingy, which is specific to non-reflowable documents. It's probably hidden away somewhere in the top Document tab, but is also bound by default to a corner tap (I want to say top-left?).

Nowadays, you're probably best served by @poire-z's document overview thingy (which I'm somewhat unfamiliar with, so, that isn't its name either, probably ;p).

@poire-z
Copy link
Contributor

poire-z commented Sep 7, 2023

'Page Preview mode'

We don't have anything named like that.
May be Page browser ? (which has no gesture by default, but is available in the first menu where Table of contents is).

'page flipping mode' in the latest KOreader versions

Looks like it is not in the menu, only available via gestures.
It is the default/initial action for tap_top_left_corner.

There is also Bookmark flipping, that appear in the menu - and is not associated to any gesture by default.

There is also the Skim widget (first menu too) that allows browsing pages and bookmarks.

in, e.g., the help menu search—were they renamed?

I think Dispatcher/Gestures actions are not included in Menu search because they would be twentyplicated as they appear in all the Gesture type submenus.

by @poire-z's document overview thingy (which I'm somewhat unfamiliar with

:(

@ryanwwest
Copy link
Contributor

"twentyplicated" lol, understandable.

I see, so 'Toggle bookmark flipping' enables 'Bookmark browsing mode'. I wasn't aware of the page flipping mode—maybe you can have only one of these two modes enabled at once since their icons are displayed in the same place. I'll have to experiment to see how page flipping mode differs.

by @poire-z's document overview thingy (which I'm somewhat unfamiliar with

What is this? I'd love to read it.

I think "Skim widget" corresponds to "Reader -> Skim Menu" gesture action. I asked because I'm trying to figure out if there's a way to enable the bottom status bar in 'bookmark browsing mode' that lets you 'skim' to the nearest page by tapping a certain portion of the status bar (not tap-and-hold footer to skim), but be able to do this tapping outside of 'bookmark browsing mode' (in place of show/hide the bottom status bar).

By the way, I freaking love this app and don't say it enough. Thanks for all your support.

@poire-z
Copy link
Contributor

poire-z commented Sep 7, 2023

maybe you can have only one of these two modes enabled at once since their icons are displayed in the same place. I'll have to experiment to see how page flipping mode differs.

Indeed, these 2 things are mutually exclusive: it's mostly the same bit of code, that behave differently whether the [x] Bookmark browsing mode is enabled or not.

But these 2 things are really old KOReader features, from before most of us current active developpers came in... and I think we hardly ever use them or really know how they work :/ They are there, they are not in our way when adding new stuff, so we haven't yet had to think whether we should remove them :)

by @poire-z's document overview thingy (which I'm somewhat unfamiliar with

What is this? I'd love to read it.

That's "Page browser" (that you know about, cf your thumbnail preload FR).

that lets you 'skim' to the nearest page by tapping a certain portion of the status bar

Again, an old feature we're mostly not aware of :/ I was looking for a github issue I had commented in with a user-patch to disable that, and.... it happened to be this issue here :)
Can't help much more than saying it's probably handled in ReaderFooter (cf the patch above) or in ReaderPaging or ReaderBookmark.

@ryanwwest
Copy link
Contributor

It seems at least @jonnyl2 uses and understands page flipping mode (e.g. #10720) so maybe he'd know how they differ and whether they should be kept vs. newer options.

That's "Page browser" (that you know about, cf your thumbnail preload FR).

Ah I thought he was referring to some documentation about documents, lol. Thanks, page browser is invaluable.

@jonnyl2
Copy link
Contributor

jonnyl2 commented Sep 8, 2023

The newer Page browser together with its sibling Book map are definitely far superior to the older page flipping mode, which only works for fixed-layout documents.

You can flip very quickly through a whole book. You can use left/right swipe for slow page flips, and up/down swipes to flip through the whole book. Or you can tap somewhere on the progress bar to jump to that area. A quick swipe always returns you to the page where you entered page flipping mode.

If page flipping mode went away, it wouldn't be a huge loss for me, but it's nice having an alternative way of browsing a book available. Also, I often use it to find a specific page on PDFs where the page numbers are cropped out of view in the reader, because in page flipping the full page is shown by default.

@Frenzie
Copy link
Member

Frenzie commented Sep 8, 2023

I don't think they're even close to the same thing. The one is page flipping, which of course doesn't make sense for EPUB because EPUB is always in page flipping mode. The point is you quickly see the whole page rather than part of the page for flipping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User patch available Request is odd, specific, or complicated to do properly - but a user patch is provided
Projects
None yet
Development

No branches or pull requests

7 participants