summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp15
-rw-r--r--xfa/fwl/theme/cfwl_formtp.cpp26
2 files changed, 16 insertions, 25 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 9a10c60a3d..23cc21f360 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -166,22 +166,21 @@ void CFWL_CheckBoxTP::DrawSign(IFWL_Widget* pWidget,
CFX_RectF rtSign(*pRtBox);
rtSign.Deflate(kSignMargin, kSignMargin);
uint32_t dwColor = m_pThemeData->clrSignCheck;
- FX_BOOL bCheck = TRUE;
+ bool bCheck = true;
if ((dwStates & CFWL_PartState_Disabled) &&
(dwStates & CFWL_PartState_Checked)) {
dwColor = m_pThemeData->clrSignBorderDisable;
} else if (dwStates & CFWL_PartState_Neutral) {
- if (dwStates & CFWL_PartState_Normal) {
- bCheck = FALSE;
- dwColor = m_pThemeData->clrSignNeutralNormal;
- } else if (dwStates & CFWL_PartState_Hovered) {
- bCheck = FALSE;
+ if (dwStates & CFWL_PartState_Hovered) {
dwColor = m_pThemeData->clrSignNeutralHover;
} else if (dwStates & CFWL_PartState_Pressed) {
- bCheck = FALSE, dwColor = m_pThemeData->clrSignNeutralPressed;
+ dwColor = m_pThemeData->clrSignNeutralPressed;
} else if (dwStates & CFWL_PartState_Disabled) {
- bCheck = FALSE, dwColor = m_pThemeData->clrSignBorderDisable;
+ dwColor = m_pThemeData->clrSignBorderDisable;
+ } else {
+ dwColor = m_pThemeData->clrSignNeutralNormal;
}
+ bCheck = false;
}
if (bCheck) {
uint32_t dwStyle = pWidget->GetStylesEx();
diff --git a/xfa/fwl/theme/cfwl_formtp.cpp b/xfa/fwl/theme/cfwl_formtp.cpp
index 971e738765..033375911b 100644
--- a/xfa/fwl/theme/cfwl_formtp.cpp
+++ b/xfa/fwl/theme/cfwl_formtp.cpp
@@ -78,25 +78,17 @@ FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) {
if (!pParams)
return FALSE;
int32_t iActive = 0;
- if (pParams->m_dwStates & CFWL_PartState_Inactive) {
+ if (pParams->m_dwStates & CFWL_PartState_Inactive)
iActive = 1;
- }
+
FWLTHEME_STATE eState = FWLTHEME_STATE_Normal;
- switch (pParams->m_dwStates & 0x03) {
- case CFWL_PartState_Hovered: {
- eState = FWLTHEME_STATE_Hover;
- break;
- }
- case CFWL_PartState_Pressed: {
- eState = FWLTHEME_STATE_Pressed;
- break;
- }
- case CFWL_PartState_Disabled: {
- eState = FWLTHEME_STATE_Disabale;
- break;
- }
- default: {}
- }
+ if (pParams->m_dwStates & CFWL_PartState_Hovered)
+ eState = FWLTHEME_STATE_Hover;
+ else if (pParams->m_dwStates & CFWL_PartState_Pressed)
+ eState = FWLTHEME_STATE_Pressed;
+ else if (pParams->m_dwStates & CFWL_PartState_Disabled)
+ eState = FWLTHEME_STATE_Disabale;
+
switch (pParams->m_iPart) {
case CFWL_Part::Border: {
DrawFormBorder(pParams->m_pGraphics, &pParams->m_rtPart, eState,