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

Side by Side Diff: xfa/fwl/core/cfwl_scrollbar.cpp

Issue 2556873004: Convert GetWidgetRect to return rect. (Closed)
Patch Set: Review feedback Created 4 years 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 | « xfa/fwl/core/cfwl_scrollbar.h ('k') | xfa/fwl/core/cfwl_spinbutton.h » ('j') | 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/core/cfwl_scrollbar.h" 7 #include "xfa/fwl/core/cfwl_scrollbar.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 m_rtMinTrack.Reset(); 55 m_rtMinTrack.Reset();
56 m_rtMaxTrack.Reset(); 56 m_rtMaxTrack.Reset();
57 } 57 }
58 58
59 CFWL_ScrollBar::~CFWL_ScrollBar() {} 59 CFWL_ScrollBar::~CFWL_ScrollBar() {}
60 60
61 FWL_Type CFWL_ScrollBar::GetClassID() const { 61 FWL_Type CFWL_ScrollBar::GetClassID() const {
62 return FWL_Type::ScrollBar; 62 return FWL_Type::ScrollBar;
63 } 63 }
64 64
65 void CFWL_ScrollBar::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
66 if (!bAutoSize) {
67 rect = m_pProperties->m_rtWidget;
68 return;
69 }
70
71 rect.Set(0, 0, 0, 0);
72 FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>(
73 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
74 if (!pfMinWidth)
75 return;
76 if (IsVertical())
77 rect.Set(0, 0, (*pfMinWidth), (*pfMinWidth) * 3);
78 else
79 rect.Set(0, 0, (*pfMinWidth) * 3, (*pfMinWidth));
80
81 InflateWidgetRect(rect);
82 }
83
84 void CFWL_ScrollBar::Update() { 65 void CFWL_ScrollBar::Update() {
85 if (IsLocked()) 66 if (IsLocked())
86 return; 67 return;
87 if (!m_pProperties->m_pThemeProvider) 68 if (!m_pProperties->m_pThemeProvider)
88 m_pProperties->m_pThemeProvider = GetAvailableTheme(); 69 m_pProperties->m_pThemeProvider = GetAvailableTheme();
89 70
90 Layout(); 71 Layout();
91 } 72 }
92 73
93 void CFWL_ScrollBar::DrawWidget(CFX_Graphics* pGraphics, 74 void CFWL_ScrollBar::DrawWidget(CFX_Graphics* pGraphics,
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 494
514 void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { 495 void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) {
515 CFWL_ScrollBar* pButton = static_cast<CFWL_ScrollBar*>(m_pWidget); 496 CFWL_ScrollBar* pButton = static_cast<CFWL_ScrollBar*>(m_pWidget);
516 497
517 if (pButton->m_pTimerInfo) 498 if (pButton->m_pTimerInfo)
518 pButton->m_pTimerInfo->StopTimer(); 499 pButton->m_pTimerInfo->StopTimer();
519 500
520 if (!pButton->SendEvent()) 501 if (!pButton->SendEvent())
521 pButton->m_pTimerInfo = StartTimer(0, true); 502 pButton->m_pTimerInfo = StartTimer(0, true);
522 } 503 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_scrollbar.h ('k') | xfa/fwl/core/cfwl_spinbutton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698