From f59c47fc1e79050d3342924e6173b0f4b6ddaf02 Mon Sep 17 00:00:00 2001 From: Prashant Pandey Date: Thu, 12 Sep 2013 14:54:08 +0530 Subject: [Sidebar]: Fix the vague behaviour of color fill toolbox in Draw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, in 'Draw' when we make any object, say a rectangle and fill color inside it, then in the sidebar 'Fill and Controls', the color of the rectangle made is shown over the entire button. This is vague and the color is to be shown such that it is only filled inside the color- button appropriately. Change-Id: I31502a2931364d83569ff04f9ee8429bfe2225ad Reviewed-on: https://gerrit.libreoffice.org/5930 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/tbxctrls/tbxcolorupdate.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 289395868748..b3e4fc7c0618 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -36,7 +36,7 @@ namespace svx /* Note: The initial color shown on the button is set in /core/svx/source/tbxctrls/tbxcolorupdate.cxx (ToolboxButtonColorUpdater::ToolboxButtonColorUpdater()) . - The initial color used by the button is set in /core/svx/source/tbxcntrls/tbcontrl.cxx + The initial color used by the button is set in /core/svx/source/tbxctrls/tbcontrl.cxx (SvxColorExtToolBoxControl::SvxColorExtToolBoxControl()) and in case of writer for text(background)color also in /core/sw/source/ui/docvw/edtwin.cxx (SwEditWin::aTextBackColor and SwEditWin::aTextBackColor) @@ -148,7 +148,16 @@ namespace svx maUpdRect.Bottom() = maBmpSize.Height() - 3; } else - maUpdRect = Rectangle( Point( 1, maBmpSize.Height() - 7 ), Size( maBmpSize.Width() - 2 ,6 ) ); + { + maUpdRect = Rectangle( Point( 0, 0 ), Size( maBmpSize.Width(), maBmpSize.Height() ) ); + + // Now, fit the selected color inside the toolbox color-rectangle such that + // the distinct boundaries of the rectangle of toolbox are also clearly visible. + maUpdRect.Left() += 21; + maUpdRect.Top() += 1; + maUpdRect.Bottom() -= 1; + maUpdRect.Right() -= 4; + } pBmpAcc->DrawRect( maUpdRect ); -- cgit v1.2.3