mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
swipe east/west to switch dictionary in dict quick lookup window
This commit is contained in:
@@ -239,6 +239,7 @@ function DictQuickLookup:changeToNextDict()
|
||||
end
|
||||
|
||||
function DictQuickLookup:changeDictionary(index)
|
||||
if not self.results[index] then return end
|
||||
self.dict_index = index
|
||||
self.dictionary = self.results[index].dict
|
||||
self.lookupword = self.results[index].word
|
||||
@@ -306,4 +307,13 @@ function DictQuickLookup:onClose()
|
||||
return true
|
||||
end
|
||||
|
||||
function DictQuickLookup:onSwipe(arg, ges)
|
||||
if ges.direction == "west" then
|
||||
self:changeToNextDict()
|
||||
elseif ges.direction == "east" then
|
||||
self:changeToPrevDict()
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return DictQuickLookup
|
||||
|
||||
@@ -50,10 +50,10 @@ function ScrollTextWidget:init()
|
||||
self.dimen = Geom:new(self[1]:getSize())
|
||||
if Device:isTouchDevice() then
|
||||
self.ges_events = {
|
||||
Swipe = {
|
||||
ScrollText = {
|
||||
GestureRange:new{
|
||||
ges = "swipe",
|
||||
range = self.dimen,
|
||||
range = function() return self.dimen end,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -70,7 +70,7 @@ function ScrollTextWidget:updateScrollBar(text)
|
||||
)
|
||||
end
|
||||
|
||||
function ScrollTextWidget:onSwipe(arg, ges)
|
||||
function ScrollTextWidget:onScrollText(arg, ges)
|
||||
if ges.direction == "north" then
|
||||
self.text_widget:scrollDown()
|
||||
self:updateScrollBar(self.text_widget)
|
||||
@@ -79,7 +79,6 @@ function ScrollTextWidget:onSwipe(arg, ges)
|
||||
self:updateScrollBar(self.text_widget)
|
||||
end
|
||||
UIManager:setDirty(self.dialog, "partial")
|
||||
return true
|
||||
end
|
||||
|
||||
return ScrollTextWidget
|
||||
|
||||
Reference in New Issue
Block a user