[feat] GestureManager: Implement action to change highlight style using gesture manager (#4936)

This commit is contained in:
Galunid
2019-04-18 06:12:38 -04:00
committed by Frans de Jonge
parent c053e48526
commit 9759ffa381
2 changed files with 20 additions and 0 deletions

View File

@@ -870,6 +870,22 @@ function ReaderHighlight:onCycleHighlightAction()
timeout = 1,
})
end
return true
end
function ReaderHighlight:onCycleHighlightStyle()
local next_actions = {
lighten = "underscore",
underscore = "invert",
invert = "lighten"
}
self.view.highlight.saved_drawer = next_actions[self.view.highlight.saved_drawer]
self.ui.doc_settings:saveSetting("highlight_drawer", self.view.highlight.saved_drawer)
UIManager:show(Notification:new{
text = T(_("Default highlight style changed to '%1'."), self.view.highlight.saved_drawer),
timeout = 1,
})
return true
end
function ReaderHighlight:highlightFromHoldPos()