diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-08-10 13:32:48 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-08-23 17:53:59 +0200 |
commit | e280b01cafdfd5c7c3b5660a8e9031a9eeb2865c (patch) | |
tree | 653ced58fbf49a4aa6164726a465e1389579bbae /vcl | |
parent | 9b10ef9fc39dc0251b03d6d9285bb86aab29abee (diff) |
Draw separating line at the top of the status bar.
This makes the status bar optically one pixel smaller; which is correct,
because the new icons used there are one pixel smaller too ;-)
This also kills IsTopBorder() and IsBottomBorder(), as they always returned
'false' anyway.
Change-Id: I94c87e8d4ac1ff3c4df57b17e530f3b087efa1e1
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/status.hxx | 4 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 52 |
2 files changed, 5 insertions, 51 deletions
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx index ac28972e133d..f181e4b7799d 100644 --- a/vcl/inc/vcl/status.hxx +++ b/vcl/inc/vcl/status.hxx @@ -101,7 +101,6 @@ private: sal_Bool mbFormat; sal_Bool mbProgressMode; sal_Bool mbInUserDraw; - sal_Bool mbBottomBorder; Link maClickHdl; Link maDoubleClickHdl; @@ -173,9 +172,6 @@ public: void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ); rtl::OString GetHelpId( sal_uInt16 nItemId ) const; - sal_Bool IsBottomBorder() const { return mbBottomBorder; } - sal_Bool IsTopBorder() const; - void StartProgressMode( const XubString& rText ); void SetProgressValue( sal_uInt16 nPercent ); void EndProgressMode(); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index e7ffdffdcb4e..51c01c9ecd68 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -60,14 +60,12 @@ public: VirtualDevice* mpVirDev; long mnItemBorderWidth; - bool mbTopBorder:1; bool mbDrawItemFrames:1; }; StatusBar::ImplData::ImplData() { mpVirDev = NULL; - mbTopBorder = false; mbDrawItemFrames = false; mnItemBorderWidth = 0; } @@ -152,7 +150,6 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle ) mbVisibleItems = sal_True; mbProgressMode = sal_False; mbInUserDraw = sal_False; - mbBottomBorder = sal_False; mnItemsWidth = STATUSBAR_OFFSET_X; mnDX = 0; mnDY = 0; @@ -335,8 +332,6 @@ Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const aRect.Right() = aRect.Left() + pItem->mnWidth + pItem->mnExtraWidth; aRect.Top() = mnItemY; aRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y; - if( IsTopBorder() ) - aRect.Bottom()+=2; } } @@ -658,8 +653,6 @@ void StatusBar::ImplCalcProgressRect() maPrgsFrameRect.Left() = maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET; maPrgsFrameRect.Top() = mnItemY; maPrgsFrameRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y; - if( IsTopBorder() ) - maPrgsFrameRect.Bottom()+=2; // calculate size of progress rects mnPrgsSize = maPrgsFrameRect.Bottom()-maPrgsFrameRect.Top()-(STATUSBAR_PRGS_OFFSET*2); @@ -767,24 +760,11 @@ void StatusBar::Paint( const Rectangle& ) } } - // draw borders - if( IsTopBorder() ) - { - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetLineColor( rStyleSettings.GetShadowColor() ); - DrawLine( Point( 0, 0 ), Point( mnDX-1, 0 ) ); - SetLineColor( rStyleSettings.GetLightColor() ); - DrawLine( Point( 0, 1 ), Point( mnDX-1, 1 ) ); - } - - if ( IsBottomBorder() ) - { - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetLineColor( rStyleSettings.GetShadowColor() ); - DrawLine( Point( 0, mnDY-2 ), Point( mnDX-1, mnDY-2 ) ); - SetLineColor( rStyleSettings.GetLightColor() ); - DrawLine( Point( 0, mnDY-1 ), Point( mnDX-1, mnDY-1 ) ); - } + // draw line at the top of the status bar (to visually distinguish it from + // shell / docking area) + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + SetLineColor( rStyleSettings.GetShadowColor() ); + DrawLine( Point( 0, 0 ), Point( mnDX-1, 0 ) ); } // ----------------------------------------------------------------------- @@ -803,18 +783,9 @@ void StatusBar::Resize() mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset; mnDY = aSize.Height(); mnCalcHeight = mnDY; - // subtract border - if( IsTopBorder() ) - mnCalcHeight -= 2; - if ( IsBottomBorder() ) - mnCalcHeight -= 2; mnItemY = STATUSBAR_OFFSET_Y; - if( IsTopBorder() ) - mnItemY += 2; mnTextY = (mnCalcHeight-GetTextHeight())/2; - if( IsTopBorder() ) - mnTextY += 2; // Formatierung neu ausloesen mbFormat = sal_True; @@ -1338,13 +1309,6 @@ rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const return aRet; } -sal_Bool StatusBar::IsTopBorder() const -{ - return mpImplData->mbTopBorder; -} - -// ----------------------------------------------------------------------- - void StatusBar::StartProgressMode( const XubString& rText ) { DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" ); @@ -1498,12 +1462,6 @@ Size StatusBar::CalcWindowSizePixel() const if( nCalcHeight < nProgressHeight+2 ) nCalcHeight = nProgressHeight+2; - // add border - if( IsTopBorder() ) - nCalcHeight += 2; - if ( IsBottomBorder() ) - nCalcHeight += 2; - return Size( nCalcWidth, nCalcHeight ); } |