From 494b38e9c8abab7a8149c14cddfd458131aac441 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 28 Nov 2019 10:54:06 +0100 Subject: [PATCH] [fix] Dictionary font size: avoid crash in reader mode (#5650) --- frontend/apps/reader/modules/readerdictionary.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index 47058844b..3406f60ec 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -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 return T(_("Font size (%1)"), font_size) end, - callback = function() + callback = function(touchmenu_instance) local SpinWidget = require("ui/widget/spinwidget") local font_size = G_reader_settings:readSetting("dict_font_size") or 20 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"), callback = function(spin) G_reader_settings:saveSetting("dict_font_size", spin.value) - self.ui:onRefresh() + if touchmenu_instance then touchmenu_instance:updateItems() end end, } UIManager:show(items_font) - end + end, + keep_menu_open = true, } } }