diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-01-07 04:16:44 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-01-10 11:26:37 +0100 |
commit | a5f59c3802199f01dfbce70b01183d4d0166c2f2 (patch) | |
tree | 10cae00efab49a47129455a60bbd304b1fea0a76 | |
parent | d5143dba0fa2f6e47088a574cef1b6d626100841 (diff) |
Header/Footer, Page Breaks: Delay appearing by 500ms.
The delay was a good idea, just the 1s was too long.
-rw-r--r-- | sw/source/ui/docvw/HeaderFooterWin.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/docvw/PageBreakWin.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/inc/HeaderFooterWin.hxx | 1 | ||||
-rw-r--r-- | sw/source/ui/inc/PageBreakWin.hxx | 1 |
4 files changed, 27 insertions, 1 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx index ff7d50eddf80..330c1ff4f6c6 100644 --- a/sw/source/ui/docvw/HeaderFooterWin.cxx +++ b/sw/source/ui/docvw/HeaderFooterWin.cxx @@ -153,6 +153,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag m_pLine( NULL ), m_bIsAppearing( false ), m_nFadeRate( 100 ), + m_nDelayAppearing( 0 ), m_aFadeTimer( ) { // Get the font and configure it @@ -243,6 +244,9 @@ void SwHeaderFooterWin::ShowAll( bool bShow ) if ( !PopupMenu::IsInExecute() ) { m_bIsAppearing = bShow; + if ( bShow ) + m_nDelayAppearing = 0; + if ( m_aFadeTimer.IsActive( ) ) m_aFadeTimer.Stop(); m_aFadeTimer.Start( ); @@ -516,6 +520,14 @@ void SwHeaderFooterWin::Select( ) IMPL_LINK( SwHeaderFooterWin, FadeHandler, Timer *, EMPTYARG ) { + const int TICKS_BEFORE_WE_APPEAR = 10; + if ( m_bIsAppearing && m_nDelayAppearing < TICKS_BEFORE_WE_APPEAR ) + { + ++m_nDelayAppearing; + m_aFadeTimer.Start(); + return 0; + } + if ( m_bIsAppearing && m_nFadeRate > 0 ) m_nFadeRate -= 25; else if ( !m_bIsAppearing && m_nFadeRate < 100 ) @@ -535,7 +547,7 @@ IMPL_LINK( SwHeaderFooterWin, FadeHandler, Timer *, EMPTYARG ) Invalidate(); if ( IsVisible( ) && m_nFadeRate > 0 && m_nFadeRate < 100 ) - m_aFadeTimer.Start(); + m_aFadeTimer.Start(); return 0; } diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx index 06171011fc04..0edeb618d576 100644 --- a/sw/source/ui/docvw/PageBreakWin.cxx +++ b/sw/source/ui/docvw/PageBreakWin.cxx @@ -110,6 +110,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm ) m_pLine( NULL ), m_bIsAppearing( false ), m_nFadeRate( 100 ), + m_nDelayAppearing( 0 ), m_bDestroyed( false ), m_pMousePt( NULL ) { @@ -424,6 +425,9 @@ void SwPageBreakWin::SetReadonly( bool bReadonly ) void SwPageBreakWin::Fade( bool bFadeIn ) { m_bIsAppearing = bFadeIn; + if ( bFadeIn ) + m_nDelayAppearing = 0; + if ( !m_bDestroyed && m_aFadeTimer.IsActive( ) ) m_aFadeTimer.Stop(); if ( !m_bDestroyed ) @@ -439,6 +443,14 @@ IMPL_LINK( SwPageBreakWin, HideHandler, void *, EMPTYARG ) IMPL_LINK( SwPageBreakWin, FadeHandler, Timer *, EMPTYARG ) { + const int TICKS_BEFORE_WE_APPEAR = 10; + if ( m_bIsAppearing && m_nDelayAppearing < TICKS_BEFORE_WE_APPEAR ) + { + ++m_nDelayAppearing; + m_aFadeTimer.Start(); + return 0; + } + if ( m_bIsAppearing && m_nFadeRate > 0 ) m_nFadeRate -= 25; else if ( !m_bIsAppearing && m_nFadeRate < 100 ) diff --git a/sw/source/ui/inc/HeaderFooterWin.hxx b/sw/source/ui/inc/HeaderFooterWin.hxx index c895b534846a..6075bb3e1ad0 100644 --- a/sw/source/ui/inc/HeaderFooterWin.hxx +++ b/sw/source/ui/inc/HeaderFooterWin.hxx @@ -46,6 +46,7 @@ class SwHeaderFooterWin : public MenuButton, public SwFrameControl Window* m_pLine; bool m_bIsAppearing; int m_nFadeRate; + int m_nDelayAppearing; //< Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mouse over. Timer m_aFadeTimer; public: diff --git a/sw/source/ui/inc/PageBreakWin.hxx b/sw/source/ui/inc/PageBreakWin.hxx index c782571c2833..86c46231ed0b 100644 --- a/sw/source/ui/inc/PageBreakWin.hxx +++ b/sw/source/ui/inc/PageBreakWin.hxx @@ -45,6 +45,7 @@ class SwPageBreakWin : public MenuButton, public SwFrameControl Window* m_pLine; bool m_bIsAppearing; int m_nFadeRate; + int m_nDelayAppearing; //< Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mouse over. Timer m_aFadeTimer; bool m_bDestroyed; |