mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Events: Never stop propagating CloseWidget (#7744)
That seems like a rather terrible idea to beign with, and that that may actually have fatal consequences. Re #7738 Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
This commit is contained in:
@@ -467,16 +467,16 @@ function UIManager:close(widget, refreshtype, refreshregion, refreshdither)
|
||||
end
|
||||
logger.dbg("close widget:", widget.name or widget.id or tostring(widget))
|
||||
local dirty = false
|
||||
-- Ensure all the widgets can get onFlushSettings event.
|
||||
-- First notify the closed widget to save its settings...
|
||||
widget:handleEvent(Event:new("FlushSettings"))
|
||||
-- first send close event to widget
|
||||
-- ...and notify it that it ought to be gone now.
|
||||
widget:handleEvent(Event:new("CloseWidget"))
|
||||
-- make it disabled by default and check if any widget wants it disabled or enabled
|
||||
-- Make sure it's disabled by default and check if there are any widgets that want it disabled or enabled.
|
||||
Input.disable_double_tap = true
|
||||
local requested_disable_double_tap = nil
|
||||
local is_covered = false
|
||||
local start_idx = 1
|
||||
-- then remove all references to that widget on stack and refresh
|
||||
-- Then remove all references to that widget on stack and refresh.
|
||||
for i = #self._window_stack, 1, -1 do
|
||||
if self._window_stack[i].widget == widget then
|
||||
self._dirty[self._window_stack[i].widget] = nil
|
||||
|
||||
@@ -210,7 +210,6 @@ function DateWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.date_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function DateWidget:onShow()
|
||||
|
||||
@@ -909,7 +909,6 @@ function DictQuickLookup:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "flashui", nil
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function DictQuickLookup:onShow()
|
||||
|
||||
@@ -295,7 +295,6 @@ function DoubleSpinWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.widget_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function DoubleSpinWidget:onShow()
|
||||
|
||||
@@ -583,7 +583,6 @@ function FrontLightWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "flashui", self.light_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function FrontLightWidget:onShow()
|
||||
|
||||
@@ -850,7 +850,6 @@ function ImageViewer:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "flashui", self.main_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
return ImageViewer
|
||||
|
||||
@@ -206,16 +206,15 @@ function InfoMessage:onCloseWidget()
|
||||
end
|
||||
if self.invisible then
|
||||
-- Still invisible, no setDirty needed
|
||||
return true
|
||||
return
|
||||
end
|
||||
if self.no_refresh_on_close then
|
||||
return true
|
||||
return
|
||||
end
|
||||
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function InfoMessage:onShow()
|
||||
|
||||
@@ -157,7 +157,6 @@ function KeyboardLayoutDialog:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
return KeyboardLayoutDialog
|
||||
|
||||
@@ -38,7 +38,6 @@ function LinkBox:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "partial", self.box
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function LinkBox:onShow()
|
||||
|
||||
@@ -381,7 +381,6 @@ function NaturalLightWidget:onCloseWidget()
|
||||
end)
|
||||
-- Tell frontlight widget that we're closed
|
||||
self.fl_widget:naturalLightConfigClose()
|
||||
return true
|
||||
end
|
||||
|
||||
function NaturalLightWidget:onShow()
|
||||
|
||||
@@ -182,7 +182,6 @@ function Notification:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function Notification:onShow()
|
||||
|
||||
@@ -188,7 +188,6 @@ function OpenWithDialog:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.dialog_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
return OpenWithDialog
|
||||
|
||||
@@ -86,7 +86,6 @@ function QRMessage:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self[1][1].dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function QRMessage:onShow()
|
||||
|
||||
@@ -88,7 +88,6 @@ function ScreenSaverWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "full", self.main_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
return ScreenSaverWidget
|
||||
|
||||
@@ -338,7 +338,6 @@ function SkimToWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.skimto_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function SkimToWidget:onShow()
|
||||
|
||||
@@ -248,7 +248,6 @@ function SpinWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.spin_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function SpinWidget:onShow()
|
||||
|
||||
@@ -229,7 +229,6 @@ function TextViewer:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "partial", self.frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function TextViewer:onShow()
|
||||
|
||||
@@ -195,7 +195,6 @@ function TimeWidget:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.time_frame.dimen
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function TimeWidget:onShow()
|
||||
|
||||
@@ -155,7 +155,6 @@ function TrapWidget:onCloseWidget()
|
||||
return "ui", self.frame.dimen
|
||||
end)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return TrapWidget
|
||||
|
||||
@@ -771,7 +771,6 @@ end
|
||||
|
||||
function VirtualKeyboard:onCloseWidget()
|
||||
self:_refresh(false)
|
||||
return true
|
||||
end
|
||||
|
||||
function VirtualKeyboard:initLayer(layer)
|
||||
|
||||
Reference in New Issue
Block a user