mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Switch a few widgets to ui refresh modes
More closely matches native behavior on REAGL devices. Closing those widgets should still trigger a partial refresh though, because we usually get back to the reader, and text, so we want REAGL ;).
This commit is contained in:
@@ -66,7 +66,7 @@ end
|
||||
|
||||
function OPDSCatalog:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ function ReaderBookmark:onToggleBookmark()
|
||||
end
|
||||
self:toggleBookmark(pn_or_xp)
|
||||
self.view.dogear_visible = not self.view.dogear_visible
|
||||
UIManager:setDirty(self.view.dialog, "partial")
|
||||
UIManager:setDirty(self.view.dialog, "ui")
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ end
|
||||
|
||||
function PageCropDialog:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1].dimen:combine(self[2].dimen)
|
||||
return "ui", self[1].dimen:combine(self[2].dimen)
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -346,7 +346,7 @@ function ReaderFooter:onTapFooter(arg, ges)
|
||||
else
|
||||
self:updateFooterPos()
|
||||
end
|
||||
UIManager:setDirty(self.view.dialog, "partial", self[1][1][1].dimen)
|
||||
UIManager:setDirty(self.view.dialog, "ui", self[1][1][1].dimen)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -168,14 +168,14 @@ function Button:onTapSelectButton()
|
||||
UIManager:scheduleIn(0.0, function()
|
||||
self[1].invert = true
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
end)
|
||||
UIManager:scheduleIn(0.1, function()
|
||||
self.callback()
|
||||
self[1].invert = false
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
end)
|
||||
elseif self.tap_input then
|
||||
|
||||
@@ -52,7 +52,7 @@ end
|
||||
|
||||
function ButtonDialog:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1][1].dimen
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ function OptionTextItem:onTapSelect()
|
||||
self.event, self.args,
|
||||
self.events, self.current_item)
|
||||
UIManager:setDirty(self.config, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
@@ -127,7 +127,7 @@ function OptionIconItem:onTapSelect()
|
||||
self.event, self.args,
|
||||
self.events, self.current_item)
|
||||
UIManager:setDirty(self.config, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
@@ -532,7 +532,7 @@ function ConfigDialog:onShowConfigPanel(index)
|
||||
local refresh_dimen =
|
||||
old_dimen and old_dimen:combine(self.dialog_frame.dimen)
|
||||
or self.dialog_frame.dimen
|
||||
return "partial", refresh_dimen
|
||||
return "ui", refresh_dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -91,7 +91,7 @@ end
|
||||
|
||||
function ConfirmBox:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1][1].dimen
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ end
|
||||
|
||||
function DictQuickLookup:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self.dict_frame.dimen
|
||||
return "ui", self.dict_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ function IconButton:onTapClickButton()
|
||||
UIManager:scheduleIn(0.0, function()
|
||||
self.image.invert = true
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
end)
|
||||
-- make sure button reacts before doing callback
|
||||
@@ -52,7 +52,7 @@ function IconButton:onTapClickButton()
|
||||
self.callback()
|
||||
self.image.invert = false
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
end)
|
||||
return true
|
||||
|
||||
@@ -88,7 +88,7 @@ end
|
||||
function InfoMessage:onShow()
|
||||
-- triggered by the UIManager after we got successfully shown (not yet painted)
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1][1].dimen
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
if self.timeout then
|
||||
UIManager:scheduleIn(self.timeout, function() UIManager:close(self) end)
|
||||
|
||||
@@ -120,7 +120,7 @@ end
|
||||
|
||||
function InputDialog:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self.dialog_frame.dimen
|
||||
return "ui", self.dialog_frame.dimen
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ function InputText:initTextBox(text)
|
||||
self.dimen = self[1]:getSize()
|
||||
|
||||
UIManager:setDirty(self.parent, function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ end
|
||||
|
||||
function LinkBox:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self.box
|
||||
return "ui", self.box
|
||||
end)
|
||||
if self.timeout then
|
||||
UIManager:scheduleIn(self.timeout, function()
|
||||
|
||||
@@ -284,7 +284,7 @@ function MenuItem:onTapSelect(arg, ges)
|
||||
local pos = self:getGesPosition(ges)
|
||||
self[1].invert = true
|
||||
local refreshfunc = function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end
|
||||
UIManager:setDirty(self.show_parent, refreshfunc)
|
||||
UIManager:scheduleIn(0.1, function()
|
||||
@@ -299,7 +299,7 @@ function MenuItem:onHoldSelect(arg, ges)
|
||||
local pos = self:getGesPosition(ges)
|
||||
self[1].invert = true
|
||||
local refreshfunc = function()
|
||||
return "partial", self[1].dimen
|
||||
return "ui", self[1].dimen
|
||||
end
|
||||
UIManager:setDirty(self.show_parent, refreshfunc)
|
||||
UIManager:scheduleIn(0.1, function()
|
||||
|
||||
@@ -65,7 +65,7 @@ end
|
||||
function Notification:onShow()
|
||||
-- triggered by the UIManager after we got successfully shown (not yet painted)
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1][1].dimen
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
if self.timeout then
|
||||
UIManager:scheduleIn(self.timeout, function() UIManager:close(self) end)
|
||||
|
||||
@@ -148,7 +148,7 @@ function ToggleSwitch:onTapSelect(arg, gev)
|
||||
self.config:onConfigChoose(self.values, self.name,
|
||||
self.event, self.args, self.events, self.position)
|
||||
UIManager:setDirty(self.config, function()
|
||||
return "partial", self.dimen
|
||||
return "ui", self.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -98,7 +98,7 @@ function TouchMenuItem:onTapSelect(arg, ges)
|
||||
UIManager:scheduleIn(0.0, function()
|
||||
self.item_frame.invert = true
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self.dimen
|
||||
return "ui", self.dimen
|
||||
end)
|
||||
end)
|
||||
UIManager:scheduleIn(0.1, function()
|
||||
@@ -107,7 +107,7 @@ function TouchMenuItem:onTapSelect(arg, ges)
|
||||
UIManager:scheduleIn(0.5, function()
|
||||
self.item_frame.invert = false
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self.dimen
|
||||
return "ui", self.dimen
|
||||
end)
|
||||
end)
|
||||
return true
|
||||
@@ -123,7 +123,7 @@ function TouchMenuItem:onHoldSelect(arg, ges)
|
||||
UIManager:scheduleIn(0.0, function()
|
||||
self.item_frame.invert = true
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self.dimen
|
||||
return "ui", self.dimen
|
||||
end)
|
||||
end)
|
||||
UIManager:scheduleIn(0.1, function()
|
||||
@@ -132,7 +132,7 @@ function TouchMenuItem:onHoldSelect(arg, ges)
|
||||
UIManager:scheduleIn(0.5, function()
|
||||
self.item_frame.invert = false
|
||||
UIManager:setDirty(self.show_parent, function()
|
||||
return "partial", self.dimen
|
||||
return "ui", self.dimen
|
||||
end)
|
||||
end)
|
||||
return true
|
||||
|
||||
@@ -216,6 +216,7 @@ function VirtualKeyboard:init()
|
||||
end
|
||||
|
||||
function VirtualKeyboard:_refresh()
|
||||
-- TODO: Ideally, ui onShow & partial onClose
|
||||
UIManager:setDirty(self, function()
|
||||
return "partial", self[1][1].dimen
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user