mirror of
https://github.com/koreader/koreader
synced 2024-11-04 12:00:25 +00:00
Reader: do not apply font size out of range (#10295)
This commit is contained in:
parent
14de514ae8
commit
b01e1c5918
@ -69,6 +69,9 @@ function ReaderCoptListener:onReadSettings(config)
|
||||
end
|
||||
|
||||
function ReaderCoptListener:onConfigChange(option_name, option_value)
|
||||
-- font_size is historically and sadly shared by both mupdf and cre reader modules,
|
||||
-- but fortunately they can be distinguished by their different ranges
|
||||
if option_name == "font_size" and option_value < 5 then return end
|
||||
self.document.configurable[option_name] = option_value
|
||||
self.ui:handleEvent(Event:new("StartActivityIndicator"))
|
||||
return true
|
||||
|
@ -72,6 +72,9 @@ function ReaderKoptListener:onDocLangUpdate(lang)
|
||||
end
|
||||
|
||||
function ReaderKoptListener:onConfigChange(option_name, option_value)
|
||||
-- font_size is historically and sadly shared by both mupdf and cre reader modules,
|
||||
-- but fortunately they can be distinguished by their different ranges
|
||||
if option_name == "font_size" and option_value > 5 then return end
|
||||
self.document.configurable[option_name] = option_value
|
||||
self.ui:handleEvent(Event:new("StartActivityIndicator"))
|
||||
UIManager:setDirty("all", "partial")
|
||||
|
@ -1023,8 +1023,10 @@ function ReaderView:onSWDitheringUpdate(toggle)
|
||||
end
|
||||
|
||||
function ReaderView:onFontSizeUpdate(font_size)
|
||||
self.ui:handleEvent(Event:new("ReZoom", font_size))
|
||||
Notification:notify(T(_("Font zoom set to: %1."), font_size))
|
||||
if self.ui.paging then
|
||||
self.ui:handleEvent(Event:new("ReZoom", font_size))
|
||||
Notification:notify(T(_("Font zoom set to: %1."), font_size))
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderView:onDefectSizeUpdate()
|
||||
|
@ -437,7 +437,7 @@ Note that your selected font size is not affected by this setting.]]),
|
||||
item_text = not Device:isTouchDevice() and {_("decrease"), _("increase")} or nil,
|
||||
more_options = true,
|
||||
more_options_param = {
|
||||
value_min = 7,
|
||||
value_min = 12,
|
||||
value_max = 255,
|
||||
value_step = 0.5,
|
||||
precision = "%.1f",
|
||||
|
Loading…
Reference in New Issue
Block a user