ButtonProgressWidget: Make hold_callback optional (#8940)

We don't need one in FrontLightWidget ;).

Fix https://github.com/koreader/koreader/issues/8913#issuecomment-1074915143
pull/8942/head
NiLuJe 2 years ago committed by GitHub
parent c04fba943d
commit 23bce343bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save