diff --git a/frontend/apps/reader/modules/readerview.lua b/frontend/apps/reader/modules/readerview.lua index a64f7debd558..880b67e8c6e6 100644 --- a/frontend/apps/reader/modules/readerview.lua +++ b/frontend/apps/reader/modules/readerview.lua @@ -1094,7 +1094,7 @@ end function ReaderView:onPageGapUpdate(page_gap) self.page_gap.height = Screen:scaleBySize(page_gap) - Notification:notify(T(_("Page gap set to %1 (%2 px)."), page_gap, self.page_gap.height)) + Notification:notify(T(_("Page gap set to %1."), optionsutil.formatFlexSize(page_gap, G_reader_settings:readSetting("dimension_units", "mm")))) return true end diff --git a/frontend/ui/data/optionsutil.lua b/frontend/ui/data/optionsutil.lua index b366b849bbd9..7ca4bbadaf9c 100644 --- a/frontend/ui/data/optionsutil.lua +++ b/frontend/ui/data/optionsutil.lua @@ -36,7 +36,7 @@ local function convertSizeTo(px, format) return Screen:scaleBySize(px) / display_dpi * 25.4 * format_factor end -local function real_size_string(value, unit) +function optionsutil.formatFlexSize(value, unit) if not value then -- This shouldn't really ever happen... return "" @@ -155,21 +155,21 @@ function optionsutil.showValues(configurable, option, prefix, document, unit) local nb_current, nb_default = tonumber(current), tonumber(default) if nb_current == nil or nb_default == nil then text = T(_("%1\n%2\nCurrent value: %3\nDefault value: %4"), name_text, help_text, - real_size_string(value_current or current, unit), - real_size_string(value_default or default, unit)) + optionsutil.formatFlexSize(value_current or current, unit), + optionsutil.formatFlexSize(value_default or default, unit)) elseif value_default then text = T(_("%1\n%2\nCurrent value: %3 (%4)\nDefault value: %5 (%6)"), name_text, help_text, - current, real_size_string(value_current, unit), - default, real_size_string(value_default, unit)) + current, optionsutil.formatFlexSize(value_current, unit), + default, optionsutil.formatFlexSize(value_default, unit)) else text = T(_("%1\n%2\nCurrent value: %3 (%4)\nDefault value: %5"), name_text, help_text, - current, real_size_string(value_current, unit), + current, optionsutil.formatFlexSize(value_current, unit), default) end else text = T(_("%1\n%2\nCurrent value: %3\nDefault value: %4"), name_text, help_text, - real_size_string(current, unit), - real_size_string(default, unit)) + optionsutil.formatFlexSize(current, unit), + optionsutil.formatFlexSize(default, unit)) end UIManager:show(InfoMessage:new{ text=text }) end @@ -185,8 +185,8 @@ Current margins: left: %1 right: %2 Default margins: not set]]), - real_size_string(current[1], unit), - real_size_string(current[2], unit)) + optionsutil.formatFlexSize(current[1], unit), + optionsutil.formatFlexSize(current[2], unit)) }) else UIManager:show(InfoMessage:new{ @@ -197,10 +197,10 @@ Current margins: Default margins: left: %3 right: %4]]), - real_size_string(current[1], unit), - real_size_string(current[2], unit), - real_size_string(default[1], unit), - real_size_string(default[2], unit)) + optionsutil.formatFlexSize(current[1], unit), + optionsutil.formatFlexSize(current[2], unit), + optionsutil.formatFlexSize(default[1], unit), + optionsutil.formatFlexSize(default[2], unit)) }) end end