[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:
Robert
2019-09-14 16:30:25 +02:00
committed by Frans de Jonge
parent 672d29fbcc
commit 54568d4dcd
4 changed files with 147 additions and 0 deletions

View File

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