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

Show vertical marker at original position when back from link #3669

Merged
merged 4 commits into from Feb 9, 2018

Conversation

Projects
None yet
2 participants
@poire-z
Contributor

poire-z commented Feb 9, 2018

Followup to #3202 so we see that marker too when back from link, so we know where we were before jumping to link. Only works with credocuments.

ReaderLink: make all links be a table (they were a table for PDF, but a string for CRE) for clearer code. Also have location_stack store them as tables, with additional properties.
Get original position of link source (and verify it is valid) thanks to koreader/koreader-base#598 and koreader/crengine#96 so we can show a marker there (but not if it was invalid, this can sometimes happen due to some bug in crengine).

Also (see #3645 (comment)):
Hold on "Go back to previous location" to clear location stack.
Resists "Swipe to go back" when previous locations stack has just become empty, and show a notification.

Fix wrong links with Swipe to follow nearest link on PDF documents.

poire-z added some commits Feb 9, 2018

Show vertical marker at orig position when back from link
ReaderLink: make all links be a table (they were a table for PDF,
but a string for CRE) for clearer code. Also have location_stack
store them as tables, with additional properties.
Get original position of link source (and verify it is valid)
so we can show a marker there.

Also:
Hold on "Go back to previous location" to clear location stack.
Resists "Swipe to go back" when previous locations stack has just
become empty, and show a notification.
Fix wrong links with Swipe to follow nearest link on PDF documents.
@@ -139,9 +141,36 @@ function ReaderLink:addToMainMenu(menu_items)
text = _("Go back to previous location"),
enabled_func = function() return #self.location_stack > 0 end,
callback = function() self:onGoBackLink() end,
hold_callback = function() UIManager:show(ConfirmBox:new{
text = _("Clear previous locations stack?"),

This comment has been minimized.

@Frenzie

Frenzie Feb 9, 2018

Member

I'd simply say Clear location history? or possibly Clear previous locations? Stack is a computer science/programming term.

@@ -139,9 +141,36 @@ function ReaderLink:addToMainMenu(menu_items)
text = _("Go back to previous location"),
enabled_func = function() return #self.location_stack > 0 end,
callback = function() self:onGoBackLink() end,
hold_callback = function() UIManager:show(ConfirmBox:new{
text = _("Clear location history?"),

This comment has been minimized.

@Frenzie

Frenzie Feb 9, 2018

Member

Forgot to say, but don't forget the ok_text = _("Clear"),

@Frenzie Frenzie merged commit 59496c1 into koreader:master Feb 9, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
@Frenzie

This comment has been minimized.

Member

Frenzie commented Feb 9, 2018

Thanks! I really like the little markers. :-)

@poire-z poire-z deleted the poire-z:back_marker branch Feb 9, 2018

-- Make that gesture don't do anything, and show a Notification
-- so the user knows why
UIManager:show(Notification:new{
text = _("Previous locations stack is empty"),

This comment has been minimized.

@Frenzie

Frenzie Feb 10, 2018

Member

Whoops, should be Location history (is) empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment