[UX] Normalize SpinWidget and DoubleSpinWidget

- Use same names for options;
- Have them both movable
- Add option to keep widget shown on Apply (and use that
  when appropriate: when the value may have an immediate
  visual effect, so one can tweak it without having to
  go thru menus to re-open it again).
This commit is contained in:
poire-z
2020-05-09 13:16:09 +02:00
parent d69a992e1d
commit e5206922c6
10 changed files with 101 additions and 42 deletions

View File

@@ -388,6 +388,7 @@ function ReaderPageMap:addToMainMenu(menu_items)
text_func = function()
return T(_("Page labels font size (%1)"), self.label_font_size)
end,
enabled_func = function() return self.show_page_labels end,
callback = function(touchmenu_instance)
local SpinWidget = require("ui/widget/spinwidget")
local spin_w = SpinWidget:new{
@@ -396,8 +397,8 @@ function ReaderPageMap:addToMainMenu(menu_items)
value_min = 8,
value_max = 20,
default_value = self.label_default_font_size,
ok_text = _("Set size"),
title_text = _("Page labels font size"),
keep_shown_on_apply = true,
callback = function(spin)
self.label_font_size = spin.value
G_reader_settings:saveSetting("pagemap_label_font_size", self.label_font_size)