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/basewidget/ifwl_pushbutton.h" | 9 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return TRUE; | 95 return TRUE; |
96 } | 96 } |
97 void* CFWL_PushButtonTP::GetCapacity(CFWL_ThemePart* pThemePart, | 97 void* CFWL_PushButtonTP::GetCapacity(CFWL_ThemePart* pThemePart, |
98 CFWL_WidgetCapacity dwCapacity) { | 98 CFWL_WidgetCapacity dwCapacity) { |
99 if (dwCapacity == CFWL_WidgetCapacity::Margin) { | 99 if (dwCapacity == CFWL_WidgetCapacity::Margin) { |
100 m_fValue = 0; | 100 m_fValue = 0; |
101 return &m_fValue; | 101 return &m_fValue; |
102 } | 102 } |
103 return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); | 103 return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); |
104 } | 104 } |
105 FWL_ERR CFWL_PushButtonTP::Initialize() { | 105 FWL_Error CFWL_PushButtonTP::Initialize() { |
106 InitTTO(); | 106 InitTTO(); |
107 return CFWL_WidgetTP::Initialize(); | 107 return CFWL_WidgetTP::Initialize(); |
108 } | 108 } |
109 FWL_ERR CFWL_PushButtonTP::Finalize() { | 109 FWL_Error CFWL_PushButtonTP::Finalize() { |
110 FinalizeTTO(); | 110 FinalizeTTO(); |
111 return CFWL_WidgetTP::Finalize(); | 111 return CFWL_WidgetTP::Finalize(); |
112 } | 112 } |
113 void CFWL_PushButtonTP::SetThemeData(uint32_t dwID) { | 113 void CFWL_PushButtonTP::SetThemeData(uint32_t dwID) { |
114 if (dwID) { | 114 if (dwID) { |
115 m_pThemeData->clrBorder[0] = ArgbEncode(255, 55, 98, 6); | 115 m_pThemeData->clrBorder[0] = ArgbEncode(255, 55, 98, 6); |
116 m_pThemeData->clrBorder[1] = ArgbEncode(255, 55, 98, 6); | 116 m_pThemeData->clrBorder[1] = ArgbEncode(255, 55, 98, 6); |
117 m_pThemeData->clrBorder[2] = ArgbEncode(255, 55, 98, 6); | 117 m_pThemeData->clrBorder[2] = ArgbEncode(255, 55, 98, 6); |
118 m_pThemeData->clrBorder[3] = ArgbEncode(255, 55, 98, 6); | 118 m_pThemeData->clrBorder[3] = ArgbEncode(255, 55, 98, 6); |
119 m_pThemeData->clrBorder[4] = ArgbEncode(255, 172, 168, 153); | 119 m_pThemeData->clrBorder[4] = ArgbEncode(255, 172, 168, 153); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (dwStates & CFWL_PartState_Default) { | 162 if (dwStates & CFWL_PartState_Default) { |
163 color += 3; | 163 color += 3; |
164 } else { | 164 } else { |
165 if (dwStates & CFWL_PartState_Hovered) | 165 if (dwStates & CFWL_PartState_Hovered) |
166 color += 2; | 166 color += 2; |
167 if (dwStates & CFWL_PartState_Pressed) | 167 if (dwStates & CFWL_PartState_Pressed) |
168 color += 1; | 168 color += 1; |
169 } | 169 } |
170 return color; | 170 return color; |
171 } | 171 } |
OLD | NEW |