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)
pull/5210/head
NiLuJe 5 years ago committed by GitHub
parent a87c33f1f2
commit 9e4a7797c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,7 +45,8 @@ common_info.about = {
callback = function() callback = function()
UIManager:show(InfoMessage:new{ 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), 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 end
} }

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

Loading…
Cancel
Save