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
committerPetr Mladek <pmladek@suse.cz>2012-01-10 11:19:10 +0100
commit77ec56689230606281c60b945f3d5edc1e97d7f7 (patch)
treead18b65f4dd45e9c36220ab09700eb9dbac6d38e /sw/source/ui/docvw/HeaderFooterWin.cxx
parentcbb7814247ad99eac2de0fac207774755bdfc2bd (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 Signed-off-by: Stefan Knorr (Astron) <heinzlesspam@googlemail.com> Signed-off-by: Cor Nouws <oolst@nouenoff.nl> Signed-off-by: Michael Meeks <michael.meeks@suse.com>
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 180b975d7fc5..ff7d50eddf80 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);
@@ -249,6 +249,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() ) ) );