mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Allow setting text selection rate (#6449)
This commit is contained in:
@@ -30,7 +30,10 @@ function ReaderHighlight:setupTouchZones()
|
||||
self.onGesture = nil
|
||||
|
||||
if not Device:isTouchDevice() then return end
|
||||
|
||||
local hold_pan_rate = G_reader_settings:readSetting("hold_pan_rate")
|
||||
if not hold_pan_rate then
|
||||
hold_pan_rate = Screen.low_pan_rate and 5.0 or 30.0
|
||||
end
|
||||
self.ui:registerTouchZones({
|
||||
{
|
||||
id = "readerhighlight_tap",
|
||||
@@ -76,7 +79,7 @@ function ReaderHighlight:setupTouchZones()
|
||||
{
|
||||
id = "readerhighlight_hold_pan",
|
||||
ges = "hold_pan",
|
||||
rate = 2.0,
|
||||
rate = hold_pan_rate,
|
||||
screen_zone = {
|
||||
ratio_x = 0, ratio_y = 0, ratio_w = 1, ratio_h = 1,
|
||||
},
|
||||
@@ -1297,6 +1300,10 @@ function ReaderHighlight:onReadSettings(config)
|
||||
self.view.highlight.disabled = disable_highlight
|
||||
end
|
||||
|
||||
function ReaderHighlight:onUpdateHoldPanRate()
|
||||
self:setupTouchZones()
|
||||
end
|
||||
|
||||
function ReaderHighlight:onSaveSettings()
|
||||
self.ui.doc_settings:saveSetting("highlight_drawer", self.view.highlight.saved_drawer)
|
||||
self.ui.doc_settings:saveSetting("highlight_disabled", self.view.highlight.disabled)
|
||||
|
||||
Reference in New Issue
Block a user