| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/theme/cfwl_formtp.h" | 7 #include "xfa/fwl/theme/cfwl_formtp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 71 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
| 72 } | 72 } |
| 73 InitCaption(TRUE); | 73 InitCaption(TRUE); |
| 74 InitCaption(FALSE); | 74 InitCaption(FALSE); |
| 75 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 75 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); |
| 76 } | 76 } |
| 77 FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 77 FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
| 78 if (!pParams) | 78 if (!pParams) |
| 79 return FALSE; | 79 return FALSE; |
| 80 int32_t iActive = 0; | 80 int32_t iActive = 0; |
| 81 if (pParams->m_dwStates & CFWL_PartState_Inactive) { | 81 if (pParams->m_dwStates & CFWL_PartState_Inactive) |
| 82 iActive = 1; | 82 iActive = 1; |
| 83 } | 83 |
| 84 FWLTHEME_STATE eState = FWLTHEME_STATE_Normal; | 84 FWLTHEME_STATE eState = FWLTHEME_STATE_Normal; |
| 85 switch (pParams->m_dwStates & 0x03) { | 85 if (pParams->m_dwStates & CFWL_PartState_Hovered) |
| 86 case CFWL_PartState_Hovered: { | 86 eState = FWLTHEME_STATE_Hover; |
| 87 eState = FWLTHEME_STATE_Hover; | 87 else if (pParams->m_dwStates & CFWL_PartState_Pressed) |
| 88 break; | 88 eState = FWLTHEME_STATE_Pressed; |
| 89 } | 89 else if (pParams->m_dwStates & CFWL_PartState_Disabled) |
| 90 case CFWL_PartState_Pressed: { | 90 eState = FWLTHEME_STATE_Disabale; |
| 91 eState = FWLTHEME_STATE_Pressed; | 91 |
| 92 break; | |
| 93 } | |
| 94 case CFWL_PartState_Disabled: { | |
| 95 eState = FWLTHEME_STATE_Disabale; | |
| 96 break; | |
| 97 } | |
| 98 default: {} | |
| 99 } | |
| 100 switch (pParams->m_iPart) { | 92 switch (pParams->m_iPart) { |
| 101 case CFWL_Part::Border: { | 93 case CFWL_Part::Border: { |
| 102 DrawFormBorder(pParams->m_pGraphics, &pParams->m_rtPart, eState, | 94 DrawFormBorder(pParams->m_pGraphics, &pParams->m_rtPart, eState, |
| 103 &pParams->m_matrix, iActive); | 95 &pParams->m_matrix, iActive); |
| 104 break; | 96 break; |
| 105 } | 97 } |
| 106 case CFWL_Part::Edge: { | 98 case CFWL_Part::Edge: { |
| 107 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), | 99 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), |
| 108 &pParams->m_rtPart, &pParams->m_matrix); | 100 &pParams->m_rtPart, &pParams->m_matrix); |
| 109 break; | 101 break; |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 path.Clear(); | 865 path.Clear(); |
| 874 path.AddRectangle(0, 5, 1, 15); | 866 path.AddRectangle(0, 5, 1, 15); |
| 875 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], | 867 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], |
| 876 m_pThemeData->clrHeadBK[1][2], &path); | 868 m_pThemeData->clrHeadBK[1][2], &path); |
| 877 path.Clear(); | 869 path.Clear(); |
| 878 path.AddRectangle(0, 20, 1, kCYCaption - 19); | 870 path.AddRectangle(0, 20, 1, kCYCaption - 19); |
| 879 DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[1][2], | 871 DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[1][2], |
| 880 m_pThemeData->clrHeadBK[1][3], &path); | 872 m_pThemeData->clrHeadBK[1][3], &path); |
| 881 } | 873 } |
| 882 } | 874 } |
| OLD | NEW |