ButtonProgressWidget: Make hold_callback optional (#8940)

We don't need one in FrontLightWidget ;).

Fix https://github.com/koreader/koreader/issues/8913#issuecomment-1074915143
This commit is contained in:
NiLuJe
2022-03-22 20:38:23 +01:00
committed by GitHub
parent c04fba943d
commit 23bce343bb

View File

@@ -98,9 +98,7 @@ function ButtonProgressWidget:update()
self.callback("-")
self:update()
end,
hold_callback = function()
self.hold_callback("-")
end,
hold_callback = self.hold_callback and function() self.hold_callback("-") end,
}
if self.thin_grey_style then
button.frame.color = Blitbuffer.COLOR_DARK_GRAY
@@ -147,9 +145,7 @@ function ButtonProgressWidget:update()
self:update()
end,
no_focus = highlighted,
hold_callback = function()
self.hold_callback(i)
end,
hold_callback = self.hold_callback and function() self.hold_callback(i) end,
}
if self.thin_grey_style then
if is_default then
@@ -204,9 +200,7 @@ function ButtonProgressWidget:update()
self.callback("+")
self:update()
end,
hold_callback = function()
self.hold_callback("+")
end,
hold_callback = self.hold_callback and function() self.hold_callback("+") end,
}
if self.thin_grey_style then
@@ -241,9 +235,7 @@ function ButtonProgressWidget:update()
self.callback("")
self:update()
end,
hold_callback = function()
self.hold_callback("")
end,
hold_callback = self.hold_callback and function() self.hold_callback("") end,
}
if self.thin_grey_style then
button.frame.color = Blitbuffer.COLOR_DARK_GRAY