2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

PDF: no "Contrast set to" notification on opening (#12391)

This commit is contained in:
hius07 2024-08-21 20:57:22 +03:00 committed by GitHub
parent 64094435f2
commit 9c001a660a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,7 @@ function ReaderKoptListener:onReadSettings(config)
normal_zoom_mode = ReaderZooming.zoom_mode_label[normal_zoom_mode] and normal_zoom_mode or ReaderZooming.DEFAULT_ZOOM_MODE
self.normal_zoom_mode = normal_zoom_mode
self:setZoomMode(normal_zoom_mode)
self.ui:handleEvent(Event:new("GammaUpdate", self.document.configurable.contrast))
self.ui:handleEvent(Event:new("GammaUpdate", self.document.configurable.contrast, true)) -- no notification
-- since K2pdfopt v2.21 negative value of word spacing is also used, for config
-- compatability we should manually change previous -1 to a more reasonable -0.2
if self.document.configurable.word_spacing == -1 then

View File

@ -955,12 +955,14 @@ function ReaderView:onReaderFooterVisibilityChange()
end
end
function ReaderView:onGammaUpdate(gamma)
function ReaderView:onGammaUpdate(gamma, no_notification)
self.state.gamma = gamma
if self.page_scroll then
self.ui:handleEvent(Event:new("UpdateScrollPageGamma", gamma))
end
Notification:notify(T(_("Contrast set to: %1."), gamma))
if not no_notification then
Notification:notify(T(_("Contrast set to: %1."), gamma))
end
end
-- For ReaderKOptListener