mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix a few logic holes in dithering mode selection (#6419)
* Allow switching to SW dithering on a HW-capable device without that being lost on boot (and, worse, left in an undithered state). * Make sure the automagic toggles between HW/SW in the Dev menu are properly saved.
This commit is contained in:
@@ -356,11 +356,12 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
return not Device.screen.hw_dithering
|
||||
end,
|
||||
callback = function()
|
||||
G_reader_settings:flipNilOrFalse("dev_no_hw_dither")
|
||||
Device.screen:toggleHWDithering()
|
||||
G_reader_settings:saveSetting("dev_no_hw_dither", not Device.screen.hw_dithering)
|
||||
-- Make sure SW dithering gets disabled when we enable HW dithering
|
||||
if Device.screen.hw_dithering and Device.screen.sw_dithering then
|
||||
Device.screen:toggleSWDithering()
|
||||
G_reader_settings:saveSetting("dev_no_sw_dither", true)
|
||||
Device.screen:toggleSWDithering(false)
|
||||
end
|
||||
UIManager:setDirty("all", "full")
|
||||
end,
|
||||
@@ -376,11 +377,12 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
return not Device.screen.sw_dithering
|
||||
end,
|
||||
callback = function()
|
||||
G_reader_settings:flipNilOrFalse("dev_no_sw_dither")
|
||||
Device.screen:toggleSWDithering()
|
||||
G_reader_settings:saveSetting("dev_no_sw_dither", not Device.screen.sw_dithering)
|
||||
-- Make sure HW dithering gets disabled when we enable SW dithering
|
||||
if Device.screen.hw_dithering and Device.screen.sw_dithering then
|
||||
Device.screen:toggleHWDithering()
|
||||
G_reader_settings:saveSetting("dev_no_hw_dither", true)
|
||||
Device.screen:toggleHWDithering(false)
|
||||
end
|
||||
UIManager:setDirty("all", "full")
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user