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

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

Issue 2535623002: Cleanup caret show/hide code (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_caret.h ('k') | xfa/fwl/core/cfwl_comboedit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/cfwl_caret.cpp
diff --git a/xfa/fwl/core/cfwl_caret.cpp b/xfa/fwl/core/cfwl_caret.cpp
index b4ebf2cec8280d3c07b447990501c00168a920db..b42945c6a87b92bb2b2f7426ff46a1974b3b0ccd 100644
--- a/xfa/fwl/core/cfwl_caret.cpp
+++ b/xfa/fwl/core/cfwl_caret.cpp
@@ -55,15 +55,19 @@ void CFWL_Caret::DrawWidget(CFX_Graphics* pGraphics,
DrawCaretBK(pGraphics, m_pProperties->m_pThemeProvider, pMatrix);
}
-void CFWL_Caret::ShowCaret(bool bFlag) {
+void CFWL_Caret::ShowCaret() {
+ if (m_pTimerInfo)
+ m_pTimerInfo->StopTimer();
+ m_pTimerInfo = m_pTimer->StartTimer(kFrequency, true);
+ SetStates(FWL_WGTSTATE_Invisible, false);
+}
+
+void CFWL_Caret::HideCaret() {
if (m_pTimerInfo) {
m_pTimerInfo->StopTimer();
m_pTimerInfo = nullptr;
}
- if (bFlag)
- m_pTimerInfo = m_pTimer->StartTimer(kFrequency, true);
-
- SetStates(FWL_WGTSTATE_Invisible, !bFlag);
+ SetStates(FWL_WGTSTATE_Invisible, true);
}
void CFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics,
« no previous file with comments | « xfa/fwl/core/cfwl_caret.h ('k') | xfa/fwl/core/cfwl_comboedit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698