summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/HeaderFooterWin.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-12-28 20:01:57 +0100
committerJan Holesovsky <kendy@suse.cz>2011-12-29 13:46:20 +0100
commit64e08fd3c5980b74bb958dc566c229d92db18726 (patch)
treec70e96ad9bf59547d1a80a3500c9700fd285af7c /sw/source/ui/docvw/HeaderFooterWin.cxx
parent4e41996b5693414c0887c2c4d929cd16f4eb4577 (diff)
Header/Footer: Show / hide the control immediately.
- When the mouse pointer enters or leaves the headers / footers, show or hide the header / footer control immediately. Waiting for that to appear is annoying; and similarly for disappearing - one usually ended up clicking the header / footer area to speed that up, and had a feeling of misbehaving. - Few related re-paint improvements
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 64e75e456d41..b5a3c7045af9 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -78,7 +78,7 @@ using namespace drawinglayer::primitive2d;
namespace
{
- basegfx::BColor lcl_GetFillColor( basegfx::BColor aLineColor )
+ static basegfx::BColor lcl_GetFillColor( basegfx::BColor aLineColor )
{
basegfx::BColor aHslLine = basegfx::tools::rgb2hsl( aLineColor );
double nLuminance = aHslLine.getZ() * 2.5;
@@ -90,7 +90,7 @@ namespace
return basegfx::tools::hsl2rgb( aHslLine );
}
- basegfx::BColor lcl_GetLighterGradientColor( basegfx::BColor aDarkColor )
+ static basegfx::BColor lcl_GetLighterGradientColor( basegfx::BColor aDarkColor )
{
basegfx::BColor aHslDark = basegfx::tools::rgb2hsl( aDarkColor );
double nLuminance = aHslDark.getZ() * 255 + 20;
@@ -98,7 +98,7 @@ namespace
return basegfx::tools::hsl2rgb( aHslDark );
}
- B2DPolygon lcl_GetPolygon( const Rectangle& rRect, bool bHeader )
+ static B2DPolygon lcl_GetPolygon( const Rectangle& rRect, bool bHeader )
{
const double nRadius = 3;
const double nKappa((M_SQRT2 - 1.0) * 4.0 / 3.0);
@@ -250,6 +250,19 @@ void SwHeaderFooterWin::ShowAll( bool bShow )
}
}
+bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
+{
+ Rectangle aRect( GetPosPixel(), GetSizePixel() );
+ if ( aRect.IsInside( rDocPt ) )
+ return true;
+
+ Rectangle aLineRect( m_pLine->GetPosPixel(), m_pLine->GetSizePixel() );
+ if ( aLineRect.IsInside( rDocPt ) )
+ return true;
+
+ return false;
+}
+
void SwHeaderFooterWin::Paint( const Rectangle& )
{
const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) );