Honor the alpha channel in our icon for the About popup (#5208)

It ends up with a black background otherwise.
(Old regression that dates back to my alpha shenanigans a few months
ago)
This commit is contained in:
NiLuJe
2019-08-14 17:01:26 +02:00
committed by GitHub
parent a87c33f1f2
commit 9e4a7797c9
2 changed files with 5 additions and 1 deletions

View File

@@ -45,7 +45,8 @@ common_info.about = {
callback = function()
UIManager:show(InfoMessage:new{
text = T(_("KOReader %1\n\nA document viewer for E Ink devices.\n\nLicensed under Affero GPL v3. All dependencies are free software.\n\nhttp://koreader.rocks/"), version),
icon_file = "resources/ko-icon.png"
icon_file = "resources/ko-icon.png",
alpha = true,
})
end
}

View File

@@ -58,6 +58,7 @@ local InfoMessage = InputContainer:new{
-- Whether the icon should be shown. If it is false, self.image will be ignored.
show_icon = true,
icon_file = nil, -- use this file instead of "resources/info-i.png"
alpha = false, -- does that icon have an alpha channel?
dismiss_callback = function() end,
}
@@ -91,11 +92,13 @@ function InfoMessage:init()
image = self.image,
width = self.image_width,
height = self.image_height,
alpha = self.alpha,
}
else
image_widget = ImageWidget:new{
file = self.icon_file or "resources/info-i.png",
scale_for_dpi = true,
alpha = self.alpha,
}
end
else