mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Dispatcher: fix action deleted arg (#13488)
This commit is contained in:
@@ -296,10 +296,15 @@ end
|
||||
|
||||
function ReaderFont:onSetFont(face)
|
||||
if face and self.font_face ~= face then
|
||||
self.font_face = face
|
||||
self.ui.document:setFontFace(face)
|
||||
-- signal readerrolling to update pos in new height
|
||||
self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
for _, fontinfo in pairs(FontList.fontinfo) do
|
||||
if fontinfo[1].name == face then
|
||||
self.font_face = face
|
||||
self.ui.document:setFontFace(face)
|
||||
-- signal readerrolling to update pos in new height
|
||||
self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -724,6 +724,7 @@ function ReaderStyleTweak:onToggleStyleTweak(tweak_id, item, no_notification)
|
||||
if type(tweak_id) == "table" then -- Dispatcher action 'Style tweak set on/off'
|
||||
tweak_id, toggle = unpack(tweak_id)
|
||||
end
|
||||
if self.tweaks_by_id[tweak_id] == nil then return true end
|
||||
local enabled, g_enabled = self:isTweakEnabled(tweak_id)
|
||||
if enabled == toggle then return true end
|
||||
local text
|
||||
|
||||
@@ -655,7 +655,8 @@ function Dispatcher:getNameFromItem(item, settings, dont_show_value)
|
||||
settingsList[item].args, settingsList[item].toggle = settingsList[item].args_func()
|
||||
end
|
||||
local value_num = util.arrayContains(settingsList[item].args, value)
|
||||
display_value = settingsList[item].toggle[value_num] or string.format("%.1f", value)
|
||||
display_value = settingsList[item].toggle[value_num]
|
||||
or (type(value) == "number" and string.format("%.1f", value) or value)
|
||||
end
|
||||
elseif category == "absolutenumber" then
|
||||
display_value = tostring(value)
|
||||
|
||||
Reference in New Issue
Block a user