diff options
author | Ruslan Kabatsayev <b7.10110111@gmail.com> | 2012-07-09 03:31:54 +0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-10 17:34:55 +0100 |
commit | 17ea32a1a36d81a0a12df12adbe15e8eaf1c7c62 (patch) | |
tree | f2571b7f5b0a1da2b040ee48efeb160cd82319ba /svtools/source/control | |
parent | 1c222c5a767311d6628bdef3cfc7d7bc1e72e6ea (diff) |
Make bottom tabbar items follow native theme
Change-Id: Ia1c4b4ece81655a91c6e489ee51291684e06c157
Diffstat (limited to 'svtools/source/control')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index a922241b2b44..0c43549beccf 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1098,14 +1098,20 @@ public: void drawOutputAreaBorder() { + Size aOutputSize = mrParent.GetOutputSizePixel(); + Rectangle aOutRect = mrParent.GetPageArea(); + + Rectangle borderRect(Point(aOutRect.Left(),-10),Size(aOutputSize.Width(),12)); + if( mrParent.IsNativeControlSupported(CTRL_FRAME,PART_ENTIRE_CONTROL) && + mrParent.DrawNativeControl(CTRL_FRAME,PART_ENTIRE_CONTROL,borderRect, + CTRL_STATE_ENABLED,ImplControlValue(FRAME_DRAW_IN),rtl::OUString()) ) + return; + WinBits nWinStyle = mrParent.GetStyle(); // Bei Border oben und unten einen Strich extra malen if ( (nWinStyle & WB_BORDER) || (nWinStyle & WB_TOPBORDER) ) { - Size aOutputSize = mrParent.GetOutputSizePixel(); - Rectangle aOutRect = mrParent.GetPageArea(); - // Bei 3D-Tabs wird auch der Border in 3D gemalt if ( nWinStyle & WB_3DTAB ) { @@ -1198,6 +1204,27 @@ public: void drawTab() { + ControlState nState(CTRL_STATE_ENABLED); + if( mbSelected ) + nState|=CTRL_STATE_SELECTED; + TabitemValue tiValue; + tiValue.mnPosition|=TABITEM_IS_AT_BOTTOM; + Rectangle tabRect(maRect); + tabRect.Left()+=5; + tabRect.Right()-=4; + tabRect.Bottom()+=1; + if( !mbSelected ) + { + tabRect.Bottom()-=2; + tabRect.Top()+=2; + } + if( mrParent.IsNativeControlSupported(CTRL_TAB_ITEM,PART_ENTIRE_CONTROL) && + mrParent.DrawNativeControl(CTRL_TAB_ITEM,PART_ENTIRE_CONTROL,tabRect, + nState,tiValue,rtl::OUString()) ) + { + return; + } + mrParent.SetLineColor(mpStyleSettings->GetDarkShadowColor()); // Je nach Status die richtige FillInBrush setzen @@ -1422,9 +1449,12 @@ void TabBar::Paint( const Rectangle& ) if ( bCurrent ) { - SetLineColor(); - SetFillColor(aSelectColor); - aDrawer.drawOverTopBorder(mnWinStyle & WB_3DTAB); + if(!IsNativeControlSupported(CTRL_TAB_ITEM,PART_ENTIRE_CONTROL)) + { + SetLineColor(); + SetFillColor(aSelectColor); + aDrawer.drawOverTopBorder(mnWinStyle & WB_3DTAB); + } return; } |