diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2020-02-24 17:15:11 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-02-26 09:33:53 +0100 |
commit | d8c7864407249fd1ed69713dfdf4fa533a9efb0b (patch) | |
tree | 0dcdb41579c5e31e7d4a4e84787304f9f1827ca0 /sc | |
parent | a8c3addfce4df0fa8278d83764148d4aec40b36e (diff) |
Resolves tdf#127508 - Flat table header in Calc
Amends 67fd62b3edc86c2891f279b25cf9919c4bbbbca1 with
flat corner button
Change-Id: Ia26aff0844069dd435cf4edd7524c19f5f0f22ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89365
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 35 |
2 files changed, 5 insertions, 33 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index dc65f970d78e..8a8d3e9125cc 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -71,14 +71,13 @@ class ScCornerButton : public vcl::Window { private: ScViewData* const pViewData; - bool const bAdd; protected: virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; virtual void Resize() override; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; public: - ScCornerButton( vcl::Window* pParent, ScViewData* pData, bool bAdditional ); + ScCornerButton( vcl::Window* pParent, ScViewData* pData ); virtual ~ScCornerButton() override; virtual void StateChanged( StateChangedType nType ) override; diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 53e03e61de07..f45a575ec461 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -68,10 +68,9 @@ using namespace ::com::sun::star; // Corner-Button -ScCornerButton::ScCornerButton( vcl::Window* pParent, ScViewData* pData, bool bAdditional ) : +ScCornerButton::ScCornerButton( vcl::Window* pParent, ScViewData* pData ) : Window( pParent, WinBits( 0 ) ), - pViewData( pData ), - bAdd( bAdditional ) + pViewData( pData ) { EnableRTL( false ); } @@ -94,32 +93,6 @@ void ScCornerButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rect bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() ); long nDarkX = bLayoutRTL ? 0 : nPosX; - if (!bAdd) - { - // match the shaded look of column/row headers - - Color aFace(rStyleSettings.GetFaceColor()); - Color aWhite(COL_WHITE); - Color aCenter(aFace); - aCenter.Merge(aWhite, 0xd0); // lighten up a bit - Color aOuter(aFace ); - aOuter.Merge(aWhite, 0xa0); // lighten up more - - long nCenterX = (aSize.Width() / 2) - 1; - long nCenterY = (aSize.Height() / 2) - 1; - - rRenderContext.SetLineColor(); - rRenderContext.SetFillColor(aCenter); - rRenderContext.DrawRect(tools::Rectangle(nCenterX, nCenterY, nCenterX, nPosY)); - rRenderContext.DrawRect(tools::Rectangle(nCenterX, nCenterY, nDarkX, nCenterY)); - rRenderContext.SetFillColor(aOuter); - rRenderContext.DrawRect(tools::Rectangle(0, 0, nPosX, nCenterY - 1)); - if (bLayoutRTL) - rRenderContext.DrawRect(tools::Rectangle(nCenterX + 1, nCenterY, nPosX, nPosY)); - else - rRenderContext.DrawRect(tools::Rectangle(0, nCenterY, nCenterX - 1, nPosY)); - } - // both buttons have the same look now - only dark right/bottom lines rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor()); rRenderContext.DrawLine(Point(0, nPosY), Point(nPosX, nPosY)); @@ -201,8 +174,8 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* aVScrollBottom( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), aHScrollLeft( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), aHScrollRight( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), - aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, false ) ), - aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, true ) ), + aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData ) ), + aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData ) ), aScrollBarBox( VclPtr<ScrollBarBox>::Create( pFrameWin, WB_SIZEABLE ) ), mxInputHintOO(), pTimerWindow( nullptr ), |