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_pushbuttontp.h" | 7 #include "xfa/fwl/theme/cfwl_pushbuttontp.h" |
8 | 8 |
9 #include "xfa/fwl/cfwl_pushbutton.h" | 9 #include "xfa/fwl/cfwl_pushbutton.h" |
10 #include "xfa/fwl/cfwl_themebackground.h" | 10 #include "xfa/fwl/cfwl_themebackground.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 bool CFWL_PushButtonTP::IsValidWidget(CFWL_Widget* pWidget) { | 24 bool CFWL_PushButtonTP::IsValidWidget(CFWL_Widget* pWidget) { |
25 return pWidget && pWidget->GetClassID() == FWL_Type::PushButton; | 25 return pWidget && pWidget->GetClassID() == FWL_Type::PushButton; |
26 } | 26 } |
27 | 27 |
28 void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 28 void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
29 switch (pParams->m_iPart) { | 29 switch (pParams->m_iPart) { |
30 case CFWL_Part::Border: { | 30 case CFWL_Part::Border: { |
31 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); | 31 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); |
32 break; | 32 break; |
33 } | 33 } |
34 case CFWL_Part::Edge: { | |
35 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), | |
36 &pParams->m_rtPart, &pParams->m_matrix); | |
37 break; | |
38 } | |
39 case CFWL_Part::Background: { | 34 case CFWL_Part::Background: { |
40 CFX_RectF& rect = pParams->m_rtPart; | 35 CFX_RectF& rect = pParams->m_rtPart; |
41 FX_FLOAT fRight = rect.right(); | 36 FX_FLOAT fRight = rect.right(); |
42 FX_FLOAT fBottom = rect.bottom(); | 37 FX_FLOAT fBottom = rect.bottom(); |
43 CFX_Path strokePath; | 38 CFX_Path strokePath; |
44 strokePath.Create(); | 39 strokePath.Create(); |
45 strokePath.MoveTo(rect.left + PUSHBUTTON_SIZE_Corner, rect.top); | 40 strokePath.MoveTo(rect.left + PUSHBUTTON_SIZE_Corner, rect.top); |
46 strokePath.LineTo(fRight - PUSHBUTTON_SIZE_Corner, rect.top); | 41 strokePath.LineTo(fRight - PUSHBUTTON_SIZE_Corner, rect.top); |
47 strokePath.LineTo(fRight, rect.top + PUSHBUTTON_SIZE_Corner); | 42 strokePath.LineTo(fRight, rect.top + PUSHBUTTON_SIZE_Corner); |
48 strokePath.LineTo(fRight, fBottom - PUSHBUTTON_SIZE_Corner); | 43 strokePath.LineTo(fRight, fBottom - PUSHBUTTON_SIZE_Corner); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if (dwStates & CFWL_PartState_Default) { | 132 if (dwStates & CFWL_PartState_Default) { |
138 color += 3; | 133 color += 3; |
139 } else { | 134 } else { |
140 if (dwStates & CFWL_PartState_Hovered) | 135 if (dwStates & CFWL_PartState_Hovered) |
141 color += 2; | 136 color += 2; |
142 if (dwStates & CFWL_PartState_Pressed) | 137 if (dwStates & CFWL_PartState_Pressed) |
143 color += 1; | 138 color += 1; |
144 } | 139 } |
145 return color; | 140 return color; |
146 } | 141 } |
OLD | NEW |