[fix] Dictionary font size: avoid crash in reader mode (#5650)

reviewable/pr5651/r1
Robert 5 years ago committed by poire-z
parent b0738960df
commit 494b38e9c8

@ -302,7 +302,7 @@ If you'd like to change the order in which dictionaries are queried (and their r
local font_size = G_reader_settings:readSetting("dict_font_size") or 20 local font_size = G_reader_settings:readSetting("dict_font_size") or 20
return T(_("Font size (%1)"), font_size) return T(_("Font size (%1)"), font_size)
end, end,
callback = function() callback = function(touchmenu_instance)
local SpinWidget = require("ui/widget/spinwidget") local SpinWidget = require("ui/widget/spinwidget")
local font_size = G_reader_settings:readSetting("dict_font_size") or 20 local font_size = G_reader_settings:readSetting("dict_font_size") or 20
local items_font = SpinWidget:new{ local items_font = SpinWidget:new{
@ -315,11 +315,12 @@ If you'd like to change the order in which dictionaries are queried (and their r
title_text = _("Dictionary font size"), title_text = _("Dictionary font size"),
callback = function(spin) callback = function(spin)
G_reader_settings:saveSetting("dict_font_size", spin.value) G_reader_settings:saveSetting("dict_font_size", spin.value)
self.ui:onRefresh() if touchmenu_instance then touchmenu_instance:updateItems() end
end, end,
} }
UIManager:show(items_font) UIManager:show(items_font)
end end,
keep_menu_open = true,
} }
} }
} }

Loading…
Cancel
Save