From 6698ccee24e20c382a706a5ad4f893b3ca3d9b40 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 13 Dec 2011 00:27:42 +0000 Subject: [PATCH] MGR: If CSkinIcon PNG file has an alpha channel, use it as mask and ignore any tag svn path=/trunk/boinc/; revision=24779 --- checkin_notes | 7 +++++++ clientgui/SkinManager.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8013db04a5..873c3017eb 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9006,3 +9006,10 @@ Rom 12 Dec 2011 win_build/installerv2/redist/Windows/x64/ boinccas.dll boinccas95.dll + +Charlie 7 Dec 2011 + - MGR: If CSkinIcon PNG file has an alpha channel, use it as mask and + ignore any tag. + + clientgui/ + SkinManager.cpp diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp index 5e29c56d60..59da0fca3b 100644 --- a/clientgui/SkinManager.cpp +++ b/clientgui/SkinManager.cpp @@ -238,8 +238,10 @@ bool CSkinIcon::Validate() { if (!m_icoIcon.Ok()) { if (!m_strDesiredIcon.IsEmpty()) { // Configure bitmap object with optional transparency mask - wxBitmap bmp = wxBitmap(wxImage(m_strDesiredIcon, wxBITMAP_TYPE_ANY)); - if (!m_strDesiredTransparencyMask.IsEmpty()) { + wxImage img = wxImage(m_strDesiredIcon, wxBITMAP_TYPE_ANY); + wxBitmap bmp = wxBitmap(img); + // If PNG file has alpha channel use it as mask & ignore tag + if (!(m_strDesiredTransparencyMask.IsEmpty() || img.HasAlpha())) { bmp.SetMask(new wxMask(bmp, ParseColor(m_strDesiredTransparencyMask))); } // Now set the icon object using the newly created bitmap with optional transparency mask