diff options
-rw-r--r-- | xfa/fwl/theme/cfwl_arrowdata.cpp | 63 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_arrowdata.h | 3 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_checkboxtp.cpp | 103 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_checkboxtp.h | 4 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_monthcalendartp.cpp | 28 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_monthcalendartp.h | 4 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_pushbuttontp.cpp | 67 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_pushbuttontp.h | 4 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_scrollbartp.cpp | 58 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_scrollbartp.h | 4 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_widgettp.cpp | 8 |
11 files changed, 127 insertions, 219 deletions
diff --git a/xfa/fwl/theme/cfwl_arrowdata.cpp b/xfa/fwl/theme/cfwl_arrowdata.cpp index 51af713cbb..523a8555bf 100644 --- a/xfa/fwl/theme/cfwl_arrowdata.cpp +++ b/xfa/fwl/theme/cfwl_arrowdata.cpp @@ -8,6 +8,8 @@ #include <algorithm> +#include "third_party/base/ptr_util.h" + namespace { CFWL_ArrowData* g_pInstance = nullptr; @@ -29,45 +31,30 @@ void CFWL_ArrowData::DestroyInstance() { g_pInstance = nullptr; } +CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(nullptr) { + SetColorData(); +} + CFWL_ArrowData::~CFWL_ArrowData() {} -void CFWL_ArrowData::SetColorData(uint32_t dwID) { +void CFWL_ArrowData::SetColorData() { if (!m_pColorData) - m_pColorData.reset(new CColorData); - - if (dwID) { - m_pColorData->clrBorder[0] = ArgbEncode(255, 142, 153, 125); - m_pColorData->clrBorder[1] = ArgbEncode(255, 157, 171, 119); - m_pColorData->clrBorder[2] = ArgbEncode(255, 118, 131, 97); - m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153); - m_pColorData->clrStart[0] = ArgbEncode(255, 203, 215, 186); - m_pColorData->clrStart[1] = ArgbEncode(255, 218, 232, 185); - m_pColorData->clrStart[2] = ArgbEncode(255, 203, 215, 186); - m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251); - m_pColorData->clrEnd[0] = ArgbEncode(255, 149, 167, 117); - m_pColorData->clrEnd[1] = ArgbEncode(255, 198, 211, 155); - m_pColorData->clrEnd[2] = ArgbEncode(255, 149, 167, 117); - m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236); - m_pColorData->clrSign[0] = ArgbEncode(255, 255, 255, 255); - m_pColorData->clrSign[1] = ArgbEncode(255, 255, 255, 255); - m_pColorData->clrSign[2] = ArgbEncode(255, 255, 255, 255); - m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128); - } else { - m_pColorData->clrBorder[0] = ArgbEncode(255, 202, 216, 249); - m_pColorData->clrBorder[1] = ArgbEncode(255, 171, 190, 233); - m_pColorData->clrBorder[2] = ArgbEncode(255, 135, 147, 219); - m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153); - m_pColorData->clrStart[0] = ArgbEncode(255, 225, 234, 254); - m_pColorData->clrStart[1] = ArgbEncode(255, 253, 255, 255); - m_pColorData->clrStart[2] = ArgbEncode(255, 110, 142, 241); - m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251); - m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251); - m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251); - m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235); - m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236); - m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133); - m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133); - m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133); - m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128); - } + m_pColorData = pdfium::MakeUnique<CColorData>(); + + m_pColorData->clrBorder[0] = ArgbEncode(255, 202, 216, 249); + m_pColorData->clrBorder[1] = ArgbEncode(255, 171, 190, 233); + m_pColorData->clrBorder[2] = ArgbEncode(255, 135, 147, 219); + m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153); + m_pColorData->clrStart[0] = ArgbEncode(255, 225, 234, 254); + m_pColorData->clrStart[1] = ArgbEncode(255, 253, 255, 255); + m_pColorData->clrStart[2] = ArgbEncode(255, 110, 142, 241); + m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251); + m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251); + m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251); + m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235); + m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236); + m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133); + m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133); + m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133); + m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128); } diff --git a/xfa/fwl/theme/cfwl_arrowdata.h b/xfa/fwl/theme/cfwl_arrowdata.h index 1bcdac15fb..0062e4d6a4 100644 --- a/xfa/fwl/theme/cfwl_arrowdata.h +++ b/xfa/fwl/theme/cfwl_arrowdata.h @@ -24,13 +24,14 @@ class CFWL_ArrowData { static CFWL_ArrowData* GetInstance(); static bool HasInstance(); static void DestroyInstance(); - void SetColorData(uint32_t dwID); std::unique_ptr<CColorData> m_pColorData; private: CFWL_ArrowData(); ~CFWL_ArrowData(); + + void SetColorData(); }; #endif // XFA_FWL_THEME_CFWL_ARROWDATA_H_ diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp index 731790c616..32c390a5df 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.cpp +++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp @@ -27,7 +27,7 @@ const int kSignPath = 100; #define CHECKBOX_COLOR_BOXRB2 (ArgbEncode(255, 255, 255, 255)) CFWL_CheckBoxTP::CFWL_CheckBoxTP() : m_pThemeData(new CKBThemeData) { - SetThemeData(0); + SetThemeData(); } CFWL_CheckBoxTP::~CFWL_CheckBoxTP() { @@ -179,73 +179,42 @@ void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_CheckBoxTP::SetThemeData(uint32_t dwID) { +void CFWL_CheckBoxTP::SetThemeData() { uint32_t* pData = (uint32_t*)&m_pThemeData->clrBoxBk; - if (dwID) { - *pData++ = 0, *pData++ = 0, *pData++ = ArgbEncode(255, 220, 220, 215), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 240, 207), - *pData++ = ArgbEncode(255, 248, 179, 48), - *pData++ = ArgbEncode(255, 176, 176, 167), - *pData++ = ArgbEncode(255, 241, 239, 239), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 220, 220, 215), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 240, 207), - *pData++ = ArgbEncode(255, 248, 179, 48), - *pData++ = ArgbEncode(255, 176, 176, 167), - *pData++ = ArgbEncode(255, 241, 239, 239), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 220, 220, 215), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 240, 207), - *pData++ = ArgbEncode(255, 248, 179, 48), - *pData++ = ArgbEncode(255, 176, 176, 167), - *pData++ = ArgbEncode(255, 241, 239, 239), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrSignBorderNormal = ArgbEncode(255, 154, 167, 114); - m_pThemeData->clrSignBorderDisable = ArgbEncode(255, 202, 200, 187); - m_pThemeData->clrSignCheck = ArgbEncode(255, 164, 180, 138); - m_pThemeData->clrSignNeutral = ArgbEncode(2255, 28, 134, 26); - m_pThemeData->clrSignNeutralNormal = ArgbEncode(255, 114, 192, 113); - m_pThemeData->clrSignNeutralHover = ArgbEncode(255, 33, 161, 33); - m_pThemeData->clrSignNeutralPressed = ArgbEncode(255, 28, 134, 26); - } else { - *pData++ = 0, *pData++ = 0, *pData++ = ArgbEncode(255, 220, 220, 215), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 240, 207), - *pData++ = ArgbEncode(255, 248, 179, 48), - *pData++ = ArgbEncode(255, 176, 176, 167), - *pData++ = ArgbEncode(255, 241, 239, 239), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 220, 220, 215), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 240, 207), - *pData++ = ArgbEncode(255, 248, 179, 48), - *pData++ = ArgbEncode(255, 176, 176, 167), - *pData++ = ArgbEncode(255, 241, 239, 239), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 220, 220, 215), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 240, 207), - *pData++ = ArgbEncode(255, 248, 179, 48), - *pData++ = ArgbEncode(255, 176, 176, 167), - *pData++ = ArgbEncode(255, 241, 239, 239), - *pData++ = ArgbEncode(255, 255, 255, 255), - *pData++ = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrSignBorderNormal = ArgbEncode(255, 28, 81, 128); - m_pThemeData->clrSignBorderDisable = ArgbEncode(255, 202, 200, 187); - m_pThemeData->clrSignCheck = ArgbEncode(255, 28, 81, 128); - m_pThemeData->clrSignNeutral = ArgbEncode(255, 28, 134, 26); - m_pThemeData->clrSignNeutralNormal = ArgbEncode(255, 114, 192, 113); - m_pThemeData->clrSignNeutralHover = ArgbEncode(255, 33, 161, 33); - m_pThemeData->clrSignNeutralPressed = ArgbEncode(255, 28, 134, 26); - } + + *pData++ = 0; + *pData++ = 0; + *pData++ = ArgbEncode(255, 220, 220, 215), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 255, 240, 207), + *pData++ = ArgbEncode(255, 248, 179, 48), + *pData++ = ArgbEncode(255, 176, 176, 167), + *pData++ = ArgbEncode(255, 241, 239, 239), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 220, 220, 215), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 255, 240, 207), + *pData++ = ArgbEncode(255, 248, 179, 48), + *pData++ = ArgbEncode(255, 176, 176, 167), + *pData++ = ArgbEncode(255, 241, 239, 239), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 220, 220, 215), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 255, 240, 207), + *pData++ = ArgbEncode(255, 248, 179, 48), + *pData++ = ArgbEncode(255, 176, 176, 167), + *pData++ = ArgbEncode(255, 241, 239, 239), + *pData++ = ArgbEncode(255, 255, 255, 255), + *pData++ = ArgbEncode(255, 255, 255, 255); + m_pThemeData->clrSignBorderNormal = ArgbEncode(255, 28, 81, 128); + m_pThemeData->clrSignBorderDisable = ArgbEncode(255, 202, 200, 187); + m_pThemeData->clrSignCheck = ArgbEncode(255, 28, 81, 128); + m_pThemeData->clrSignNeutral = ArgbEncode(255, 28, 134, 26); + m_pThemeData->clrSignNeutralNormal = ArgbEncode(255, 114, 192, 113); + m_pThemeData->clrSignNeutralHover = ArgbEncode(255, 33, 161, 33); + m_pThemeData->clrSignNeutralPressed = ArgbEncode(255, 28, 134, 26); } void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) { diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h index b04262edc2..81447b4899 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.h +++ b/xfa/fwl/theme/cfwl_checkboxtp.h @@ -66,11 +66,13 @@ class CFWL_CheckBoxTP : public CFWL_WidgetTP { FX_ARGB argbFill, CFX_Matrix* pMatrix); - void SetThemeData(uint32_t dwID); void InitCheckPath(FX_FLOAT fCheckLen); std::unique_ptr<CKBThemeData> m_pThemeData; std::unique_ptr<CFX_Path> m_pCheckPath; + + private: + void SetThemeData(); }; #endif // XFA_FWL_THEME_CFWL_CHECKBOXTP_H_ diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp index 402b237b21..8aff0f1690 100644 --- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp +++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp @@ -50,7 +50,7 @@ const int kSeparatorY = kHeaderHeight + kDatesCellHeight + kSeparatorDOffset; } // namespace CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() : m_pThemeData(new MCThemeData) { - SetThemeData(0); + SetThemeData(); } CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() {} @@ -540,22 +540,12 @@ FWLTHEME_STATE CFWL_MonthCalendarTP::GetState(uint32_t dwFWLStates) { return FWLTHEME_STATE_Normal; } -void CFWL_MonthCalendarTP::SetThemeData(uint32_t dwThemeID) { - if (dwThemeID == 0) { - m_pThemeData->clrCaption = ArgbEncode(0xff, 0, 153, 255); - m_pThemeData->clrSeperator = ArgbEncode(0xff, 141, 161, 239); - m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 193, 211, 251); - m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 173, 188, 239); - m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 103, 144, 209); - m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); - m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); - } else { - m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0); - m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64); - m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191); - m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183); - m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0); - m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); - m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); - } +void CFWL_MonthCalendarTP::SetThemeData() { + m_pThemeData->clrCaption = ArgbEncode(0xff, 0, 153, 255); + m_pThemeData->clrSeperator = ArgbEncode(0xff, 141, 161, 239); + m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 193, 211, 251); + m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 173, 188, 239); + m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 103, 144, 209); + m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); + m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); } diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.h b/xfa/fwl/theme/cfwl_monthcalendartp.h index 5e30bf272b..dc60ef12c8 100644 --- a/xfa/fwl/theme/cfwl_monthcalendartp.h +++ b/xfa/fwl/theme/cfwl_monthcalendartp.h @@ -46,10 +46,12 @@ class CFWL_MonthCalendarTP : public CFWL_WidgetTP { void DrawHSeperator(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); void DrawWeekNumSep(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); FWLTHEME_STATE GetState(uint32_t dwFWLStates); - void SetThemeData(uint32_t dwThemeID); std::unique_ptr<MCThemeData> m_pThemeData; CFX_WideString wsResource; + + private: + void SetThemeData(); }; #endif // XFA_FWL_THEME_CFWL_MONTHCALENDARTP_H_ diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp index f5c5004f07..3f38c0f8b1 100644 --- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp +++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp @@ -16,7 +16,7 @@ #define PUSHBUTTON_SIZE_Corner 2 CFWL_PushButtonTP::CFWL_PushButtonTP() : m_pThemeData(new PBThemeData) { - SetThemeData(0); + SetThemeData(); } CFWL_PushButtonTP::~CFWL_PushButtonTP() {} @@ -107,50 +107,27 @@ void CFWL_PushButtonTP::Finalize() { CFWL_WidgetTP::Finalize(); } -void CFWL_PushButtonTP::SetThemeData(uint32_t dwID) { - if (dwID) { - m_pThemeData->clrBorder[0] = ArgbEncode(255, 55, 98, 6); - m_pThemeData->clrBorder[1] = ArgbEncode(255, 55, 98, 6); - m_pThemeData->clrBorder[2] = ArgbEncode(255, 55, 98, 6); - m_pThemeData->clrBorder[3] = ArgbEncode(255, 55, 98, 6); - m_pThemeData->clrBorder[4] = ArgbEncode(255, 172, 168, 153); - m_pThemeData->clrStart[0] = ArgbEncode(255, 255, 255, 246); - m_pThemeData->clrStart[1] = ArgbEncode(255, 223, 205, 180); - m_pThemeData->clrStart[2] = ArgbEncode(255, 252, 197, 149); - m_pThemeData->clrStart[3] = ArgbEncode(255, 194, 209, 143); - m_pThemeData->clrStart[4] = ArgbEncode(255, 216, 216, 216); - m_pThemeData->clrEnd[0] = ArgbEncode(255, 227, 209, 184); - m_pThemeData->clrEnd[1] = ArgbEncode(255, 248, 244, 228); - m_pThemeData->clrEnd[2] = ArgbEncode(255, 207, 114, 37); - m_pThemeData->clrEnd[3] = ArgbEncode(255, 144, 193, 84); - m_pThemeData->clrEnd[4] = ArgbEncode(255, 172, 168, 153); - m_pThemeData->clrFill[0] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrFill[1] = ArgbEncode(255, 226, 225, 218); - m_pThemeData->clrFill[2] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrFill[3] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrFill[4] = ArgbEncode(255, 245, 244, 234); - } else { - m_pThemeData->clrBorder[0] = ArgbEncode(255, 0, 60, 116); - m_pThemeData->clrBorder[1] = ArgbEncode(255, 0, 60, 116); - m_pThemeData->clrBorder[2] = ArgbEncode(255, 0, 60, 116); - m_pThemeData->clrBorder[3] = ArgbEncode(255, 0, 60, 116); - m_pThemeData->clrBorder[4] = ArgbEncode(255, 201, 199, 186); - m_pThemeData->clrStart[0] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrStart[1] = ArgbEncode(255, 209, 204, 193); - m_pThemeData->clrStart[2] = ArgbEncode(255, 255, 240, 207); - m_pThemeData->clrStart[3] = ArgbEncode(255, 206, 231, 255); - m_pThemeData->clrStart[4] = ArgbEncode(255, 245, 244, 234); - m_pThemeData->clrEnd[0] = ArgbEncode(255, 214, 208, 197); - m_pThemeData->clrEnd[1] = ArgbEncode(255, 242, 241, 238); - m_pThemeData->clrEnd[2] = ArgbEncode(255, 229, 151, 0); - m_pThemeData->clrEnd[3] = ArgbEncode(255, 105, 130, 238); - m_pThemeData->clrEnd[4] = ArgbEncode(255, 245, 244, 234); - m_pThemeData->clrFill[0] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrFill[1] = ArgbEncode(255, 226, 225, 218); - m_pThemeData->clrFill[2] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrFill[3] = ArgbEncode(255, 255, 255, 255); - m_pThemeData->clrFill[4] = ArgbEncode(255, 245, 244, 234); - } +void CFWL_PushButtonTP::SetThemeData() { + m_pThemeData->clrBorder[0] = ArgbEncode(255, 0, 60, 116); + m_pThemeData->clrBorder[1] = ArgbEncode(255, 0, 60, 116); + m_pThemeData->clrBorder[2] = ArgbEncode(255, 0, 60, 116); + m_pThemeData->clrBorder[3] = ArgbEncode(255, 0, 60, 116); + m_pThemeData->clrBorder[4] = ArgbEncode(255, 201, 199, 186); + m_pThemeData->clrStart[0] = ArgbEncode(255, 255, 255, 255); + m_pThemeData->clrStart[1] = ArgbEncode(255, 209, 204, 193); + m_pThemeData->clrStart[2] = ArgbEncode(255, 255, 240, 207); + m_pThemeData->clrStart[3] = ArgbEncode(255, 206, 231, 255); + m_pThemeData->clrStart[4] = ArgbEncode(255, 245, 244, 234); + m_pThemeData->clrEnd[0] = ArgbEncode(255, 214, 208, 197); + m_pThemeData->clrEnd[1] = ArgbEncode(255, 242, 241, 238); + m_pThemeData->clrEnd[2] = ArgbEncode(255, 229, 151, 0); + m_pThemeData->clrEnd[3] = ArgbEncode(255, 105, 130, 238); + m_pThemeData->clrEnd[4] = ArgbEncode(255, 245, 244, 234); + m_pThemeData->clrFill[0] = ArgbEncode(255, 255, 255, 255); + m_pThemeData->clrFill[1] = ArgbEncode(255, 226, 225, 218); + m_pThemeData->clrFill[2] = ArgbEncode(255, 255, 255, 255); + m_pThemeData->clrFill[3] = ArgbEncode(255, 255, 255, 255); + m_pThemeData->clrFill[4] = ArgbEncode(255, 245, 244, 234); } int32_t CFWL_PushButtonTP::GetColorID(uint32_t dwStates) const { diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.h b/xfa/fwl/theme/cfwl_pushbuttontp.h index db17e9cac6..559f1a7f5f 100644 --- a/xfa/fwl/theme/cfwl_pushbuttontp.h +++ b/xfa/fwl/theme/cfwl_pushbuttontp.h @@ -32,7 +32,6 @@ class CFWL_PushButtonTP : public CFWL_WidgetTP { FX_ARGB clrFill[5]; }; - void SetThemeData(uint32_t dwID); void SetTopLineColor(uint32_t* pData); void SetLeftLineColor(uint32_t* pData); void SetRightLineColor(uint32_t* pData); @@ -44,6 +43,9 @@ class CFWL_PushButtonTP : public CFWL_WidgetTP { int32_t GetColorID(uint32_t dwStates) const; std::unique_ptr<PBThemeData> m_pThemeData; + + private: + void SetThemeData(); }; #endif // XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_ diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp index f966d2de99..13e89587df 100644 --- a/xfa/fwl/theme/cfwl_scrollbartp.cpp +++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp @@ -20,7 +20,7 @@ const float kPawLength = 12.5f; } // namespace CFWL_ScrollBarTP::CFWL_ScrollBarTP() : m_pThemeData(new SBThemeData) { - SetThemeData(0); + SetThemeData(); } CFWL_ScrollBarTP::~CFWL_ScrollBarTP() {} @@ -256,47 +256,27 @@ void CFWL_ScrollBarTP::DrawMaxMinBtn(CFX_Graphics* pGraphics, DrawArrowBtn(pGraphics, &rtArrowBtn, eDict, eState, pMatrix); } -void CFWL_ScrollBarTP::SetThemeData(uint32_t dwID) { +void CFWL_ScrollBarTP::SetThemeData() { m_pThemeData->clrPawColorLight[3] = ArgbEncode(0xff, 208, 223, 172); m_pThemeData->clrPawColorDark[3] = ArgbEncode(0xff, 140, 157, 115); m_pThemeData->clrBtnBK[3][0] = ArgbEncode(0xff, 164, 180, 139); m_pThemeData->clrBtnBK[3][1] = ArgbEncode(0xff, 141, 157, 115); m_pThemeData->clrBtnBorder[3] = ArgbEncode(0xff, 236, 233, 216); - if (dwID) { - m_pThemeData->clrPawColorLight[0] = ArgbEncode(0xff, 208, 223, 172); - m_pThemeData->clrPawColorDark[0] = ArgbEncode(0xff, 140, 157, 115); - m_pThemeData->clrBtnBK[0][0] = ArgbEncode(0xff, 162, 179, 141); - m_pThemeData->clrBtnBK[0][1] = ArgbEncode(0xff, 149, 167, 117); - m_pThemeData->clrBtnBorder[0] = ArgbEncode(0xff, 142, 153, 125); - m_pThemeData->clrPawColorLight[1] = ArgbEncode(0xff, 235, 245, 212); - m_pThemeData->clrPawColorDark[1] = ArgbEncode(0xff, 182, 198, 142); - m_pThemeData->clrBtnBK[1][0] = ArgbEncode(0xff, 200, 213, 170); - m_pThemeData->clrBtnBK[1][1] = ArgbEncode(0xff, 195, 208, 150); - m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 189, 203, 150); - m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 208, 223, 172); - m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 140, 157, 115); - m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 164, 180, 139); - m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 141, 157, 115); - m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 128, 146, 102); - m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); - m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); - } else { - m_pThemeData->clrPawColorLight[0] = ArgbEncode(0xff, 238, 244, 254); - m_pThemeData->clrPawColorDark[0] = ArgbEncode(0xff, 140, 176, 248); - m_pThemeData->clrBtnBK[0][0] = ArgbEncode(0xff, 197, 213, 252); - m_pThemeData->clrBtnBK[0][1] = ArgbEncode(0xff, 182, 205, 251); - m_pThemeData->clrBtnBorder[0] = ArgbEncode(0xff, 148, 176, 221); - m_pThemeData->clrPawColorLight[1] = ArgbEncode(0xff, 252, 253, 255); - m_pThemeData->clrPawColorDark[1] = ArgbEncode(0xff, 156, 197, 255); - m_pThemeData->clrBtnBK[1][0] = ArgbEncode(0xff, 216, 232, 255); - m_pThemeData->clrBtnBK[1][1] = ArgbEncode(0xff, 204, 225, 255); - m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254); - m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253); - m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216); - m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245); - m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249); - m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211); - m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); - m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); - } + m_pThemeData->clrPawColorLight[0] = ArgbEncode(0xff, 238, 244, 254); + m_pThemeData->clrPawColorDark[0] = ArgbEncode(0xff, 140, 176, 248); + m_pThemeData->clrBtnBK[0][0] = ArgbEncode(0xff, 197, 213, 252); + m_pThemeData->clrBtnBK[0][1] = ArgbEncode(0xff, 182, 205, 251); + m_pThemeData->clrBtnBorder[0] = ArgbEncode(0xff, 148, 176, 221); + m_pThemeData->clrPawColorLight[1] = ArgbEncode(0xff, 252, 253, 255); + m_pThemeData->clrPawColorDark[1] = ArgbEncode(0xff, 156, 197, 255); + m_pThemeData->clrBtnBK[1][0] = ArgbEncode(0xff, 216, 232, 255); + m_pThemeData->clrBtnBK[1][1] = ArgbEncode(0xff, 204, 225, 255); + m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254); + m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253); + m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216); + m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245); + m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249); + m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211); + m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); + m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); } diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h index 839a71b034..ef2bbc99d1 100644 --- a/xfa/fwl/theme/cfwl_scrollbartp.h +++ b/xfa/fwl/theme/cfwl_scrollbartp.h @@ -54,9 +54,11 @@ class CFWL_ScrollBarTP : public CFWL_WidgetTP { bool bVert, FWLTHEME_STATE eState, CFX_Matrix* pMatrix = nullptr); - void SetThemeData(uint32_t dwID); std::unique_ptr<SBThemeData> m_pThemeData; + + private: + void SetThemeData(); }; #endif // XFA_FWL_THEME_CFWL_SCROLLBARTP_H_ diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 0a33a82a0a..d6273696ce 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -593,7 +593,7 @@ void CFWL_WidgetTP::DrawBtn(CFX_Graphics* pGraphics, CFX_Path path; path.Create(); if (!CFWL_ArrowData::HasInstance()) - CFWL_ArrowData::GetInstance()->SetColorData(0); + CFWL_ArrowData::GetInstance(); CFWL_ArrowData::CColorData* pColorData = CFWL_ArrowData::GetInstance()->m_pColorData.get(); @@ -617,17 +617,13 @@ void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics* pGraphics, CFX_Matrix* pMatrix) { DrawBtn(pGraphics, pRect, eState, pMatrix); if (!CFWL_ArrowData::HasInstance()) - CFWL_ArrowData::GetInstance()->SetColorData(0); + CFWL_ArrowData::GetInstance(); CFWL_ArrowData::CColorData* pColorData = CFWL_ArrowData::GetInstance()->m_pColorData.get(); DrawArrow(pGraphics, pRect, eDict, pColorData->clrSign[eState - 1], pMatrix); } -CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(nullptr) { - SetColorData(0); -} - CFWL_FontData::CFWL_FontData() : m_dwStyles(0), m_dwCodePage(0) {} CFWL_FontData::~CFWL_FontData() {} |