mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix some issues with movable dict window (#3722)
Some Hold and move (hold on title and move away from it) would not work. Pan (=swipe with hold at end) while selecting text would move the window (it now does nothing: proper text selection still needs Hold on word at start). Also increase hold duration from 2s to 3s (for switching lookup between dict/wikipedia) to be consistent with the 3s duration in readerhighlight.
This commit is contained in:
@@ -148,10 +148,21 @@ function HtmlBoxWidget:getPosFromAbsPos(abs_pos)
|
||||
return pos
|
||||
end
|
||||
|
||||
function HtmlBoxWidget:onHoldStartText(_, ges)
|
||||
function HtmlBoxWidget:onHoldStartText(callback, ges)
|
||||
self.hold_start_pos = self:getPosFromAbsPos(ges.pos)
|
||||
|
||||
if not self.hold_start_pos then
|
||||
if callback then
|
||||
callback(false) -- let know we are not selecting
|
||||
end
|
||||
return false -- let event be processed by other widgets
|
||||
end
|
||||
|
||||
self.hold_start_tv = TimeVal.now()
|
||||
|
||||
if callback then
|
||||
callback(true) -- let know we are selecting
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user