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/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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 rect.Set(0, 0, 0, 0); | 71 rect.Set(0, 0, 0, 0); |
72 FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>( | 72 FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>( |
73 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); | 73 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); |
74 if (!pfMinWidth) | 74 if (!pfMinWidth) |
75 return; | 75 return; |
76 if (IsVertical()) | 76 if (IsVertical()) |
77 rect.Set(0, 0, (*pfMinWidth), (*pfMinWidth) * 3); | 77 rect.Set(0, 0, (*pfMinWidth), (*pfMinWidth) * 3); |
78 else | 78 else |
79 rect.Set(0, 0, (*pfMinWidth) * 3, (*pfMinWidth)); | 79 rect.Set(0, 0, (*pfMinWidth) * 3, (*pfMinWidth)); |
80 CFWL_Widget::GetWidgetRect(rect, true); | 80 |
| 81 InflateWidgetRect(rect); |
81 } | 82 } |
82 | 83 |
83 void CFWL_ScrollBar::Update() { | 84 void CFWL_ScrollBar::Update() { |
84 if (IsLocked()) | 85 if (IsLocked()) |
85 return; | 86 return; |
86 if (!m_pProperties->m_pThemeProvider) | 87 if (!m_pProperties->m_pThemeProvider) |
87 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 88 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
88 | 89 |
89 Layout(); | 90 Layout(); |
90 } | 91 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 | 513 |
513 void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { | 514 void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { |
514 CFWL_ScrollBar* pButton = static_cast<CFWL_ScrollBar*>(m_pWidget); | 515 CFWL_ScrollBar* pButton = static_cast<CFWL_ScrollBar*>(m_pWidget); |
515 | 516 |
516 if (pButton->m_pTimerInfo) | 517 if (pButton->m_pTimerInfo) |
517 pButton->m_pTimerInfo->StopTimer(); | 518 pButton->m_pTimerInfo->StopTimer(); |
518 | 519 |
519 if (!pButton->SendEvent()) | 520 if (!pButton->SendEvent()) |
520 pButton->m_pTimerInfo = StartTimer(0, true); | 521 pButton->m_pTimerInfo = StartTimer(0, true); |
521 } | 522 } |
OLD | NEW |