[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - icon-themes/galaxy svx/source

Maxim Monastirsky momonasmon at gmail.com
Mon Dec 2 03:07:33 PST 2013


 icon-themes/galaxy/svx/res/symphony/Line_color.png          |binary
 icon-themes/galaxy/svx/res/symphony/fill_color.png          |binary
 icon-themes/galaxy/svx/res/symphony/sc_backgroundcolor.png  |binary
 icon-themes/galaxy/svx/res/symphony/sch_backgroundcolor.png |binary
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx          |    3 -
 svx/source/tbxctrls/tbxcolorupdate.cxx                      |   31 +-----------
 6 files changed, 5 insertions(+), 29 deletions(-)

New commits:
commit aac1da796aa1fc1a01a0cd8a6fac7d668a8c259e
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Dec 1 13:24:54 2013 +0200

    fdo#71748 Fix color pickers
    
    This commit includes the following changes:
    
    1) Remove boxes from PNG files, and draw them ourselves.
    This will ensure that the color rec will always fit the box.
    Also it will make all color pickers look the same, and greatly
    simplify the code. (a part of the code was not reachable anyway.)
    
    2) Fix color preview for toolbar large icons. (a regression of
    commit f59c47fc1e79050d3342924e6173b0f4b6ddaf02.)
    
    3) Fix sidebar paragraph color picker initial drawing. reset should
    be called *after* the icon assignment.
    
    Change-Id: I13ae02bc3dd68dd14877ccc949784072c58bf211
    Reviewed-on: https://gerrit.libreoffice.org/6882
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit e239f372c6abcd8371d0a666c828bf1c31195dd4)

diff --git a/icon-themes/galaxy/svx/res/symphony/Line_color.png b/icon-themes/galaxy/svx/res/symphony/Line_color.png
index a9522b9..0e57320 100644
Binary files a/icon-themes/galaxy/svx/res/symphony/Line_color.png and b/icon-themes/galaxy/svx/res/symphony/Line_color.png differ
diff --git a/icon-themes/galaxy/svx/res/symphony/fill_color.png b/icon-themes/galaxy/svx/res/symphony/fill_color.png
index 1d88375..7c44c6e 100644
Binary files a/icon-themes/galaxy/svx/res/symphony/fill_color.png and b/icon-themes/galaxy/svx/res/symphony/fill_color.png differ
diff --git a/icon-themes/galaxy/svx/res/symphony/sc_backgroundcolor.png b/icon-themes/galaxy/svx/res/symphony/sc_backgroundcolor.png
index 7f926b6..7c44c6e 100644
Binary files a/icon-themes/galaxy/svx/res/symphony/sc_backgroundcolor.png and b/icon-themes/galaxy/svx/res/symphony/sc_backgroundcolor.png differ
diff --git a/icon-themes/galaxy/svx/res/symphony/sch_backgroundcolor.png b/icon-themes/galaxy/svx/res/symphony/sch_backgroundcolor.png
index a2e234f..20e5081 100644
Binary files a/icon-themes/galaxy/svx/res/symphony/sch_backgroundcolor.png and b/icon-themes/galaxy/svx/res/symphony/sch_backgroundcolor.png differ
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 2457bcf..dbb63b1 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -345,9 +345,8 @@ void ParaPropertyPanel::InitToolBoxBGColor()
 {
     const sal_uInt16 nIdBackColor = mpTBxBackColor->GetItemId(UNO_PARABACKCOLOR);
 
-    mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, nIdBackColor, mpTBxBackColor));
-
     mpTBxBackColor->SetItemImage(nIdBackColor, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor);
+    mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, nIdBackColor, mpTBxBackColor));
     mpTBxBackColor->SetItemBits( nIdBackColor, mpTBxBackColor->GetItemBits( nIdBackColor ) | TIB_DROPDOWNONLY );
 
     Link aLink = LINK(this, ParaPropertyPanel, ToolBoxBackColorDDHandler);
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index 53376bf..fc44187 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -126,7 +126,7 @@ namespace svx
 
                 mbWasHiContrastMode = mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode();
 
-                if( COL_TRANSPARENT != aColor.GetColor() )
+                if( ( COL_TRANSPARENT != aColor.GetColor() ) && ( maBmpSize.Width() == maBmpSize.Height() ) )
                     pBmpAcc->SetLineColor( aColor );
                 else if( mpTbx->GetBackground().GetColor().IsDark() )
                     pBmpAcc->SetLineColor( Color( COL_WHITE ) );
@@ -135,33 +135,10 @@ namespace svx
 
                 pBmpAcc->SetFillColor( maCurColor = aColor );
 
-                if( maBmpSize.Width() <= 16 )
-                    maUpdRect = Rectangle( Point( 0,12 ), Size( maBmpSize.Width(), 4 ) );
-                else if(76 == maBmpSize.Width() && 12 == maBmpSize.Height())
-                {
-                    maUpdRect.Left() = 22;
-                    maUpdRect.Top() = 2;
-                    maUpdRect.Right() = 73;
-                    maUpdRect.Bottom() = 9;
-                }
-                else if(maBmpSize.Width() >= (2 * maBmpSize.Height() - 2) && maBmpSize.Height() >= 16)
-                {
-                    maUpdRect.Left() = maBmpSize.Height() + 2;
-                    maUpdRect.Top() = 2;
-                    maUpdRect.Right() = maBmpSize.Width() - 3;
-                    maUpdRect.Bottom() = maBmpSize.Height() - 3;
-                }
+                if( maBmpSize.Width() == maBmpSize.Height() )
+                    maUpdRect = Rectangle( Point( 0, maBmpSize.Height() * 3 / 4 ), Size( maBmpSize.Width(), maBmpSize.Height() / 4 ) );
                 else
-                {
-                    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;
-                }
+                    maUpdRect = Rectangle( Point( maBmpSize.Height() + 2, 2 ), Point( maBmpSize.Width() - 3, maBmpSize.Height() - 3 ) );
 
                 pBmpAcc->DrawRect( maUpdRect );
 


More information about the Libreoffice-commits mailing list