mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add: gamma settings in crereader
This commit is contained in:
@@ -6,6 +6,7 @@ CREReader = UniReader:new{
|
||||
pos = 0,
|
||||
percent = 0,
|
||||
|
||||
gamma_index = 15,
|
||||
font_face = nil,
|
||||
}
|
||||
|
||||
@@ -36,10 +37,15 @@ function CREReader:loadSpecialSettings()
|
||||
local font_face = self.settings:readSetting("font_face")
|
||||
self.font_face = font_face or "FreeSerif"
|
||||
self.doc:setFontFace(self.font_face)
|
||||
|
||||
local gamma_index = self.settings:readSetting("gamma_index")
|
||||
self.gamma_index = gamma_index or self.gamma_index
|
||||
cre.setGammaIndex(self.gamma_index)
|
||||
end
|
||||
|
||||
function CREReader:saveSpecialSettings()
|
||||
self.settings:savesetting("font_face", self.font_face)
|
||||
self.settings:savesetting("gamma_index", self.gamma_index)
|
||||
end
|
||||
|
||||
function CREReader:getLastPageOrPos()
|
||||
@@ -60,6 +66,7 @@ function CREReader:setzoom(page, preCache)
|
||||
end
|
||||
|
||||
function CREReader:addJump(pos, notes)
|
||||
return
|
||||
end
|
||||
|
||||
function CREReader:goto(pos)
|
||||
@@ -196,4 +203,20 @@ function CREReader:adjustCreReaderCommands()
|
||||
cr:redrawCurrentPage()
|
||||
end
|
||||
)
|
||||
self.commands:add(KEY_VPLUS, nil, "vol+",
|
||||
"increase gamma",
|
||||
function(cr)
|
||||
cre.setGammaIndex(self.gamma_index + 1)
|
||||
self.gamma_index = cre.getGammaIndex()
|
||||
cr:redrawCurrentPage()
|
||||
end
|
||||
)
|
||||
self.commands:add(KEY_VMINUS, nil, "vol-",
|
||||
"decrease gamma",
|
||||
function(cr)
|
||||
cre.setGammaIndex(self.gamma_index - 1)
|
||||
self.gamma_index = cre.getGammaIndex()
|
||||
cr:redrawCurrentPage()
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user