DictQuickLookup: allow continuous reading with keys

We could scroll a definition with keys. Now, when
reaching top or bottom, switch to prev/next result.
This commit is contained in:
poire-z
2021-01-09 21:59:31 +01:00
parent 27b493afef
commit ebf997dd99
3 changed files with 48 additions and 41 deletions

View File

@@ -150,28 +150,28 @@ end
function ScrollHtmlWidget:onTapScrollText(arg, ges)
if BD.flipIfMirroredUILayout(ges.pos.x < Screen:getWidth()/2) then
if self.htmlbox_widget.page_number > 1 then
self:scrollText(-1)
return true
end
return self:onScrollUp()
else
if self.htmlbox_widget.page_number < self.htmlbox_widget.page_count then
self:scrollText(1)
return true
end
return self:onScrollDown()
end
end
function ScrollHtmlWidget:onScrollUp()
if self.htmlbox_widget.page_number > 1 then
self:scrollText(-1)
return true
end
-- if we couldn't scroll (because we're already at top or bottom),
-- let it propagate up (e.g. for quickdictlookup to go to next/prev result)
end
function ScrollHtmlWidget:onScrollDown()
self:scrollText(1)
return true
end
function ScrollHtmlWidget:onScrollUp()
self:scrollText(-1)
return true
if self.htmlbox_widget.page_number < self.htmlbox_widget.page_count then
self:scrollText(1)
return true
end
-- if we couldn't scroll (because we're already at top or bottom),
-- let it propagate up (e.g. for quickdictlookup to go to next/prev result)
end
return ScrollHtmlWidget