Flash when displaying covers to reduce ghosting (#15724)
Fixes #11602 again (my fix was overwritten). Fixes #14805 as well.
This commit is contained in:
1 parent
23230cf5a0
commit
6296a3cc7f
2 files changed
+20
-3
No files matched your search
@@ -93,7 +93,11 @@ function CoverMenu:updateItems(select_number, no_recalculate_dimen)
|
||||
local refresh_dimen =
|
||||
old_dimen and old_dimen:combine(self.dimen)
|
||||
or self.dimen
|
||||
return "ui", refresh_dimen, self.show_parent.dithered
|
||||
local refreshtype = "ui"
|
||||
if self._has_cover_images and BookInfoManager:getSetting("flash_ui_cover_images") then
|
||||
refreshtype = "flashui"
|
||||
end
|
||||
return refreshtype, refresh_dimen, self.show_parent.dithered
|
||||
end)
|
||||
|
||||
-- As additionally done in FileChooser:updateItems()
|
||||
@@ -137,13 +141,17 @@ function CoverMenu:updateItems(select_number, no_recalculate_dimen)
|
||||
if item.bookinfo_found then
|
||||
logger.dbg(" found", item.text)
|
||||
self.show_parent.dithered = item._has_cover_image
|
||||
local refreshtype = "ui"
|
||||
if item._has_cover_image and BookInfoManager:getSetting("flash_ui_cover_images") then
|
||||
refreshtype = "flashui"
|
||||
end
|
||||
local refreshfunc = function()
|
||||
if item.refresh_dimen then
|
||||
-- MosaicMenuItem may exceed its own dimen in its paintTo
|
||||
-- with its "description" hint
|
||||
return "ui", item.refresh_dimen, self.show_parent.dithered
|
||||
return refreshtype, item.refresh_dimen, self.show_parent.dithered
|
||||
else
|
||||
return "ui", item[1].dimen, self.show_parent.dithered
|
||||
return refreshtype, item[1].dimen, self.show_parent.dithered
|
||||
end
|
||||
end
|
||||
UIManager:setDirty(self.show_parent, refreshfunc)
|
||||
|
||||
@@ -349,6 +349,15 @@ function CoverBrowser:addToMainMenu(menu_items)
|
||||
BookInfoManager:toggleSetting("hide_file_info")
|
||||
fc:updateItems(1, true)
|
||||
end,
|
||||
},
|
||||
{
|
||||
text = _("Flash when displaying covers"),
|
||||
checked_func = function()
|
||||
return BookInfoManager:getSetting("flash_ui_cover_images")
|
||||
end,
|
||||
callback = function()
|
||||
BookInfoManager:toggleSetting("flash_ui_cover_images")
|
||||
end,
|
||||
separator = true,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user