Fix: Qt failing to paint a darker button if source image is indexed

By converting the image to an 8-bits per channel image with alpha channel
we make sure the client won't fail painting a darker button,
and keep the transparency if the source image had.
This commit is contained in:
likeawindrammer 2020-08-23 13:58:30 -06:00
parent 9f4487d9cf
commit d1ac36d3c2

View File

@ -27,6 +27,7 @@ void AOEmoteButton::set_image(QString p_image, QString p_emote_comment)
} }
else if (p_image.contains("_on") && file_exists(tmp_p_image.replace("_on", "_off"))) { else if (p_image.contains("_on") && file_exists(tmp_p_image.replace("_on", "_off"))) {
QImage tmpImage(tmp_p_image); QImage tmpImage(tmp_p_image);
tmpImage = tmpImage.convertToFormat(QImage::Format_ARGB32);
QPoint p1, p2; QPoint p1, p2;
p2.setY(tmpImage.height()); p2.setY(tmpImage.height());