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

Gesture manager: re-order actions, add Skim option #4654

Merged
merged 1 commit into from Feb 24, 2019

Conversation

Projects
None yet
2 participants
@Frenzie
Copy link
Member

Frenzie commented Feb 24, 2019

Also move multiswipes_enabled setting reading into init(),
to avoid it taking effect only after next restart.

@poire-z I'll apply my changes on top. I hadn't gotten around to that part yet anyway. (Here, you can probably see where I'm going with this.)

diff --git a/frontend/apps/reader/modules/readergesture.lua b/frontend/apps/reader/modules/readergesture.lua
index b5b47450..8580e908 100644
--- a/frontend/apps/reader/modules/readergesture.lua
+++ b/frontend/apps/reader/modules/readergesture.lua
@@ -23,6 +23,40 @@ local default_gesture = {
     multiswipe_east_south_west_north = "full_refresh",
 }
 
+local action_strings = {
+    nothing = _("Nothing"),
+
+    page_jmp_back_10 = _("Back 10 pages"),
+    page_jmp_back_1 = _("Previous page"),
+    page_jmp_fwd_10 = _("Forward 10 pages"),
+    page_jmp_fwd_1 = _("Next page"),
+    previous_location = _("Back to previous location"),
+
+    toc = _("Table of contents"),
+    bookmarks = _("Bookmarks"),
+    reading_progress = _("Reading progress"),
+
+    history = _("History"),
+    open_previous_document = _("Open previous document"),
+
+    full_refresh = _("Full screen refresh"),
+    night_mode = _("Night mode"),
+    suspend = _("Suspend"),
+    toggle_frontlight = _("Toggle frontlight"),
+    toggle_gsensor = _("Toggle accelerometer"),
+    toggle_rotation = _("Toggle rotation"),
+
+    zoom_contentwidth = _("Zoom to fit content width"),
+    zoom_contentheight = _("Zoom to fit content height"),
+    zoom_pagewidth = _("Zoom to fit page width"),
+    zoom_pageheight = _("Zoom to fit page height"),
+    zoom_column = _("Zoom to fit column"),
+    zoom_content = _("Zoom to fit content"),
+    zoom_page = _("Zoom to fit page"),
+
+    folder_up = _("Folder up"),
+}
+
 local ReaderGesture = InputContainer:new{
     multiswipes_enabled = G_reader_settings:readSetting("multiswipes_enabled"),
 }
@@ -237,6 +271,7 @@ function ReaderGesture:buildMenu(ges, default)
 end
 
 function ReaderGesture:buildMultiswipeMenu()
+    local gesture_manager = G_reader_settings:readSetting(self.ges_mode)
     local menu = {}
     multiswipes = {}
 
@@ -256,7 +291,7 @@ function ReaderGesture:buildMultiswipeMenu()
         local safe_multiswipe_name = "multiswipe_"..self:safeMultiswipeName(multiswipe)
         local default_action = default_gesture[safe_multiswipe_name] and default_gesture[safe_multiswipe_name] or "nothing"
         table.insert(menu, {
-            text = friendly_multiswipe_name,
+            text = T(_("%1 (%2)"), friendly_multiswipe_name, gesture_manager[safe_multiswipe_name]),
             sub_item_table = self:buildMenu(safe_multiswipe_name, default_action),
             hold_callback = function(touchmenu_instance)
                 if i > #default_multiswipes then
Gesture manager: re-order actions, add Skim option
Also move multiswipes_enabled setting reading into init(),
to avoid it taking effect only after next restart.

@Frenzie Frenzie added the UX label Feb 24, 2019

@Frenzie Frenzie merged commit ab1132e into koreader:master Feb 24, 2019

1 check passed

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

This comment has been minimized.

Copy link
Member Author

Frenzie commented Feb 24, 2019

@poire-z Huh, apparently GH squash goes by PR author.

@poire-z poire-z deleted the poire-z:gestures_actions_order branch Feb 24, 2019

@poire-z

This comment has been minimized.

Copy link
Contributor

poire-z commented Feb 24, 2019

No problem :)

@Frenzie Frenzie added this to the 2019.03 milestone Feb 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.