mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[UX] Add fine tune in line spacing (#5375)
See https://github.com/koreader/koreader/issues/5312#issuecomment-528506421 Progress widget has a new extra button ⋮ that triggers SpinWidget.
This commit is contained in:
@@ -33,6 +33,9 @@ local SpinWidget = InputContainer:new{
|
||||
value_hold_step = 4,
|
||||
ok_text = _("OK"),
|
||||
cancel_text = _("Cancel"),
|
||||
-- extra button on bottom
|
||||
extra_text = nil,
|
||||
extra_callback = nil,
|
||||
-- set this to see extra default button
|
||||
default_value = nil,
|
||||
default_text = _("Use default"),
|
||||
@@ -141,6 +144,20 @@ function SpinWidget:update()
|
||||
},
|
||||
})
|
||||
end
|
||||
if self.extra_text then
|
||||
table.insert(buttons,{
|
||||
{
|
||||
text = self.extra_text,
|
||||
callback = function()
|
||||
if self.extra_callback then
|
||||
self.value = value_widget:getValue()
|
||||
self.extra_callback(self)
|
||||
end
|
||||
self:onClose()
|
||||
end,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
local ok_cancel_buttons = ButtonTable:new{
|
||||
width = self.width - 2*Size.padding.default,
|
||||
|
||||
Reference in New Issue
Block a user