Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: xfa/fwl/theme/cfwl_scrollbartp.cpp

Issue 2002643003: Fix a bug on scrollbar's checking theme states (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_scrollbartp.h" 7 #include "xfa/fwl/theme/cfwl_scrollbartp.h"
8 8
9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" 9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h"
10 #include "xfa/fwl/core/cfwl_themebackground.h" 10 #include "xfa/fwl/core/cfwl_themebackground.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (m_pThemeData) { 44 if (m_pThemeData) {
45 SetThemeData(FWL_GetThemeColor(dwThemeID)); 45 SetThemeData(FWL_GetThemeColor(dwThemeID));
46 } 46 }
47 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); 47 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren);
48 } 48 }
49 FX_BOOL CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) { 49 FX_BOOL CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) {
50 if (!pParams) 50 if (!pParams)
51 return FALSE; 51 return FALSE;
52 IFWL_Widget* pWidget = pParams->m_pWidget; 52 IFWL_Widget* pWidget = pParams->m_pWidget;
53 FWLTHEME_STATE eState = FWLTHEME_STATE_Normal; 53 FWLTHEME_STATE eState = FWLTHEME_STATE_Normal;
54 switch (pParams->m_dwStates & 0x03) { 54 if (pParams->m_dwStates & CFWL_PartState_Hovered)
55 case CFWL_PartState_Hovered: { 55 eState = FWLTHEME_STATE_Hover;
56 eState = FWLTHEME_STATE_Hover; 56 else if (pParams->m_dwStates & CFWL_PartState_Pressed)
57 break; 57 eState = FWLTHEME_STATE_Pressed;
58 } 58 else if (pParams->m_dwStates & CFWL_PartState_Disabled)
59 case CFWL_PartState_Pressed: { 59 eState = FWLTHEME_STATE_Disabale;
60 eState = FWLTHEME_STATE_Pressed;
61 break;
62 }
63 case CFWL_PartState_Disabled: {
64 eState = FWLTHEME_STATE_Disabale;
65 break;
66 }
67 }
68 CFX_Graphics* pGraphics = pParams->m_pGraphics; 60 CFX_Graphics* pGraphics = pParams->m_pGraphics;
69 CFX_RectF* pRect = &pParams->m_rtPart; 61 CFX_RectF* pRect = &pParams->m_rtPart;
70 FX_BOOL bVert = pWidget->GetStylesEx(); 62 FX_BOOL bVert = pWidget->GetStylesEx();
71 switch (pParams->m_iPart) { 63 switch (pParams->m_iPart) {
72 case CFWL_Part::ForeArrow: { 64 case CFWL_Part::ForeArrow: {
73 DrawMaxMinBtn(pGraphics, pRect, 65 DrawMaxMinBtn(pGraphics, pRect,
74 bVert ? FWLTHEME_DIRECTION_Up : FWLTHEME_DIRECTION_Left, 66 bVert ? FWLTHEME_DIRECTION_Up : FWLTHEME_DIRECTION_Left,
75 eState, &pParams->m_matrix); 67 eState, &pParams->m_matrix);
76 break; 68 break;
77 } 69 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254); 296 m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254);
305 m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253); 297 m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253);
306 m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216); 298 m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216);
307 m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245); 299 m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245);
308 m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249); 300 m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249);
309 m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211); 301 m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211);
310 m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); 302 m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236);
311 m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); 303 m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251);
312 } 304 }
313 } 305 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698