diff --git a/checkin_notes b/checkin_notes index 8228aef6f6..327cc9c544 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7747,7 +7747,6 @@ David 24 Oct 2011 parse.h Charlie 25 Oct 2011 -Charlie 23 Oct 2011 - MGR: Sort Simple View task selection control alphabetically. Subclassed CBOINCBitmapComboBox from wxBitmapComboBox to work around clientData bug in wxBitmapComboBox::Insert(). @@ -7760,3 +7759,11 @@ Charlie 23 Oct 2011 sg_TaskPanel.cpp,.h win_build/ boincmgr.vcproj + +Charlie 25 Oct 2011 + - MGR: Allow skin to specify the (simulated) opacity of Simple View + task and project panels. + + clientgui/ + sg_PanelBase.cpp + SkinManager.cpp,.h diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp index f28320172e..5e29c56d60 100644 --- a/clientgui/SkinManager.cpp +++ b/clientgui/SkinManager.cpp @@ -279,6 +279,7 @@ void CSkinSimple::Clear() { m_WorkunitRunningImage.Clear(); m_WorkunitSuspendedImage.Clear(); m_WorkunitWaitingImage.Clear(); + m_iPanelOpacity = DEFAULT_OPACITY; } @@ -312,6 +313,8 @@ int CSkinSimple::Parse(MIOFILE& in) { } else if (match_tag(buf, "")) { m_WorkunitWaitingImage.Parse(in); continue; + } else if (parse_int(buf, "", m_iPanelOpacity)) { + continue; } } diff --git a/clientgui/SkinManager.h b/clientgui/SkinManager.h index 05b0ab0a82..4d52ce437b 100644 --- a/clientgui/SkinManager.h +++ b/clientgui/SkinManager.h @@ -102,6 +102,11 @@ private: }; +// Default opacity for Simple View white panels +// is 60% (153 on a scale of 0 - 255). +#define MAX_OPACITY 255 +#define DEFAULT_OPACITY 153 + class CSkinSimple : public CSkinItem { DECLARE_DYNAMIC_CLASS( CSkinSimple ) @@ -123,6 +128,7 @@ public: CSkinImage* GetWorkunitRunningImage() { return &m_WorkunitRunningImage; } CSkinImage* GetWorkunitSuspendedImage() { return &m_WorkunitSuspendedImage; } CSkinImage* GetWorkunitWaitingImage() { return &m_WorkunitWaitingImage; } + int GetPanelOpacity() { return m_iPanelOpacity; } private: CSkinImage m_BackgroundImage; @@ -133,6 +139,7 @@ private: CSkinImage m_WorkunitRunningImage; CSkinImage m_WorkunitSuspendedImage; CSkinImage m_WorkunitWaitingImage; + int m_iPanelOpacity; }; diff --git a/clientgui/sg_PanelBase.cpp b/clientgui/sg_PanelBase.cpp index 1bee1be312..b9402e505c 100755 --- a/clientgui/sg_PanelBase.cpp +++ b/clientgui/sg_PanelBase.cpp @@ -16,6 +16,9 @@ // along with BOINC. If not, see . #include "stdwx.h" +#include "BOINCGUIApp.h" +#include "miofile.h" +#include "SkinManager.h" #include "sg_PanelBase.h" #define RECTANGLERADIUS 15.0 @@ -54,9 +57,6 @@ void CSimplePanelBase::ReskinInterface() { m_GotBGBitMap = false; } -#define WHITE_WEIGHT 60 -#define IMAGE_WEIGHT (100-WHITE_WEIGHT) - // Create a background bitmap simulating partial transparency void CSimplePanelBase::MakeBGBitMap() { wxRect r; @@ -70,6 +70,13 @@ void CSimplePanelBase::MakeBGBitMap() { CSimpleGUIPanel* backgroundPanel = (CSimpleGUIPanel*)GetParent(); wxPen bgPen(*wxWHITE, 1, wxTRANSPARENT); wxBrush bgBrush(*wxWHITE); + CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); + + wxASSERT(pSkinSimple); + wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); + + int white_weight = pSkinSimple->GetPanelOpacity(); + int image_weight = MAX_OPACITY - white_weight; // Workaround for CSimpleGUIPanel not reliably getting // Paint or EraseBackground events under Linux @@ -110,12 +117,12 @@ void CSimplePanelBase::MakeBGBitMap() { for (i=0; i