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:
poire-z
2018-03-05 21:27:55 +01:00
committed by Frans de Jonge
parent 076bf406fd
commit e7f705bf10
4 changed files with 107 additions and 22 deletions

View File

@@ -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