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

Unified Diff: xfa/fwl/core/cfwl_listbox.cpp

Issue 2533623002: Cleanup default FWL params part I (Closed)
Patch Set: Rebase to master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/cfwl_listbox.h ('k') | xfa/fwl/core/cfwl_monthcalendar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/cfwl_listbox.cpp
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index be9e8b93955b6fc4bd0ea724d37bc8f3afaf426c..7589623e51fc12afd2e3bcc5aad7d93c8d299040 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -96,13 +96,13 @@ void CFWL_ListBox::Update() {
FWL_WidgetHit CFWL_ListBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
if (IsShowScrollBar(false)) {
CFX_RectF rect;
- m_pHorzScrollBar->GetWidgetRect(rect);
+ m_pHorzScrollBar->GetWidgetRect(rect, false);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::HScrollBar;
}
if (IsShowScrollBar(true)) {
CFX_RectF rect;
- m_pVertScrollBar->GetWidgetRect(rect);
+ m_pVertScrollBar->GetWidgetRect(rect, false);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::VScrollBar;
}
@@ -645,13 +645,13 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) {
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarFocus) ==
0 ||
(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused)) {
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
+ m_pVertScrollBar->RemoveStates(FWL_WGTSTATE_Invisible);
}
m_pVertScrollBar->Update();
} else if (m_pVertScrollBar) {
m_pVertScrollBar->SetPos(0);
m_pVertScrollBar->SetTrackPos(0);
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible);
}
if (bShowHorzScr) {
if (!m_pHorzScrollBar)
@@ -676,13 +676,13 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) {
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarFocus) ==
0 ||
(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused)) {
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
+ m_pHorzScrollBar->RemoveStates(FWL_WGTSTATE_Invisible);
}
m_pHorzScrollBar->Update();
} else if (m_pHorzScrollBar) {
m_pHorzScrollBar->SetPos(0);
m_pHorzScrollBar->SetTrackPos(0);
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible);
}
if (bShowVertScr && bShowHorzScr) {
m_rtStatic.Set(m_rtClient.right() - m_fScorllBarWidth,
@@ -830,10 +830,18 @@ void CFWL_ListBox::OnDrawWidget(CFX_Graphics* pGraphics,
void CFWL_ListBox::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (GetStylesEx() & FWL_STYLEEXT_LTB_ShowScrollBarFocus) {
- if (m_pVertScrollBar)
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, !bSet);
- if (m_pHorzScrollBar)
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, !bSet);
+ if (m_pVertScrollBar) {
+ if (bSet)
+ m_pVertScrollBar->RemoveStates(FWL_WGTSTATE_Invisible);
+ else
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible);
+ }
+ if (m_pHorzScrollBar) {
+ if (bSet)
+ m_pHorzScrollBar->RemoveStates(FWL_WGTSTATE_Invisible);
+ else
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible);
+ }
}
if (bSet)
m_pProperties->m_dwStates |= (FWL_WGTSTATE_Focused);
« no previous file with comments | « xfa/fwl/core/cfwl_listbox.h ('k') | xfa/fwl/core/cfwl_monthcalendar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698