[Libreoffice-commits] core.git: icon-themes/tango include/svx svx/inc svx/source svx/uiconfig

Maxim Monastirsky momonasmon at gmail.com
Sun Oct 26 03:37:34 PDT 2014


 icon-themes/tango/links.txt                   |    1 
 include/svx/dialogs.hrc                       |    2 
 svx/inc/helpid.hrc                            |    1 
 svx/source/sidebar/line/LinePropertyPanel.cxx |  106 --------------------------
 svx/source/sidebar/line/LinePropertyPanel.hrc |    3 
 svx/source/sidebar/line/LinePropertyPanel.hxx |   19 ----
 svx/source/sidebar/line/LinePropertyPanel.src |   21 -----
 svx/uiconfig/ui/sidebarline.ui                |    4 
 8 files changed, 4 insertions(+), 153 deletions(-)

New commits:
commit 35ae136427b6cb71de9728f82b9364b702ea2ef5
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Oct 26 11:53:33 2014 +0200

    fdo#84844 Sidebar: Use SvxColorToolBoxControl for line color
    
    Change-Id: I266cfd8c80088f698ec36662357477bb456a96fe

diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index 4c71487..4656c97 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -311,7 +311,6 @@ cmd/lc_circlepie.png cmd/lc_basicshapes.circle-pie.png
 cmd/sc_pie.png cmd/sc_basicshapes.circle-pie.png
 cmd/sc_circlepie.png cmd/sc_basicshapes.circle-pie.png
 sfx2/res/sortascending.png cmd/lc_sortascending.png
-svx/res/symphony/Line_color.png cmd/sc_xlinecolor.png
 svx/res/symphony/rotate_left.png cmd/sc_rotateleft.png
 svx/res/symphony/rotate_right.png cmd/sc_rotateright.png
 svx/res/symphony/sc_backgroundcolor.png cmd/sc_formatarea.png
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index e06a8a7..196a6eb 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -210,7 +210,6 @@
 #define RID_POPUPPANEL_AREAPAGE_TRGR        (RID_SVX_START + 320)
 
 #define RID_SIDEBAR_LINE_PANEL              (RID_SVX_START + 321)
-#define RID_POPUPPANEL_LINEPAGE_COLOR       (RID_SVX_START + 322)
 #define RID_POPUPPANEL_LINEPAGE_WIDTH       (RID_SVX_START + 324)
 
 #define RID_SIDEBAR_POSSIZE_PANEL           (RID_SVX_START + 325)
@@ -1029,7 +1028,6 @@
 #define IMG_PARA_CUSTOM_GRAY             (RID_SVX_SIDEBAR_BEGIN + 11)
 #define IL_NUM_BULLET                    (RID_SVX_SIDEBAR_BEGIN + 12)
 #define IL_NUM_BULLET_RTL                (RID_SVX_SIDEBAR_BEGIN + 13)
-#define IMG_LINE_COLOR                   (RID_SVX_SIDEBAR_BEGIN + 20)
 #define IMG_NONE_ICON                    (RID_SVX_SIDEBAR_BEGIN + 21)
 #define IMG_WIDTH1_ICON                  (RID_SVX_SIDEBAR_BEGIN + 22)
 #define IMG_WIDTH2_ICON                  (RID_SVX_SIDEBAR_BEGIN + 23)
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 6de49da..75bed5e 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -115,7 +115,6 @@
 #define HID_PPROPERTYPANEL_TEXT_UNDERLINE_VS "SVX_HID_PPROPERTYPANEL_TEXT_UNDERLINE_VS"
 #define HID_PPROPERTYPANEL_LINE_VS_WIDTH "SVX_HID_PPROPERTYPANEL_LINE_VS_WIDTH"
 #define HID_PPROPERTYPANEL_LINE_MTR_WIDTH "SVX_HID_PPROPERTYPANEL_LINE_MTR_WIDTH"
-#define HID_PPROPERTYPANEL_LINE_VS_COLOR "SVX_HID_PPROPERTYPANEL_LINE_VS_COLOR"
 #define HID_PPROPERTYPANEL_LINE_VS_STYLE "SVX_HID_PPROPERTYPANEL_LINE_VS_STYLE"
 #define HID_PPROPERTYPANEL_LINE_BTN_STYLE "SVX_HID_PPROPERTYPANEL_LINE_BTN_STYLE"
 #define HID_PPROPERTYPANEL_TEXT_SPACING_VS "SVX_HID_PPROPERTYPANEL_TEXT_SPACING_VS"
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 4b4a312..c5f9719 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -26,7 +26,6 @@
 #include <sfx2/objsh.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
-#include <svx/xlnclit.hxx>
 #include <svx/xtable.hxx>
 #include <svx/xdash.hxx>
 #include <svx/drawitem.hxx>
@@ -41,7 +40,6 @@
 #include <vcl/svapp.hxx>
 #include <svx/xlnwtit.hxx>
 #include <vcl/lstbox.hxx>
-#include <svx/tbxcolorupdate.hxx>
 #include <vcl/toolbox.hxx>
 #include <svx/xlntrit.hxx>
 #include <svx/xlnstit.hxx>
@@ -50,17 +48,14 @@
 #include <svx/xlinjoit.hxx>
 #include "svx/sidebar/PopupContainer.hxx"
 #include "svx/sidebar/PopupControl.hxx"
-#include <svx/sidebar/ColorControl.hxx>
 #include "LineWidthControl.hxx"
 #include <boost/bind.hpp>
-#include <boost/scoped_ptr.hpp>
 
 using namespace css;
 using namespace css::uno;
 using ::sfx2::sidebar::Theme;
 
 const char UNO_SELECTWIDTH[] = ".uno:SelectWidth";
-const char UNO_SELECTCOLOR[] = ".uno:SelectColor";
 
 namespace {
     void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLineEndList& rList)
@@ -161,7 +156,6 @@ LinePropertyPanel::LinePropertyPanel(
     maStyleControl(SID_ATTR_LINE_STYLE, *pBindings, *this),
     maDashControl (SID_ATTR_LINE_DASH, *pBindings, *this),
     maWidthControl(SID_ATTR_LINE_WIDTH, *pBindings, *this),
-    maColorControl(SID_ATTR_LINE_COLOR, *pBindings, *this),
     maStartControl(SID_ATTR_LINE_START, *pBindings, *this),
     maEndControl(SID_ATTR_LINE_END, *pBindings, *this),
     maLineEndListControl(SID_LINEEND_LIST, *pBindings, *this),
@@ -169,7 +163,6 @@ LinePropertyPanel::LinePropertyPanel(
     maTransControl(SID_ATTR_LINE_TRANSPARENCE, *pBindings, *this),
     maEdgeStyle(SID_ATTR_LINE_JOINT, *pBindings, *this),
     maCapStyle(SID_ATTR_LINE_CAP, *pBindings, *this),
-    maColor(COL_BLACK),
     mpStyleItem(),
     mpDashItem(),
     mnTrans(0),
@@ -177,20 +170,15 @@ LinePropertyPanel::LinePropertyPanel(
     mnWidthCoreValue(0),
     mpStartItem(0),
     mpEndItem(0),
-    maColorPopup(this, ::boost::bind(&LinePropertyPanel::CreateColorPopupControl, this, _1)),
     maLineWidthPopup(this, ::boost::bind(&LinePropertyPanel::CreateLineWidthPopupControl, this, _1)),
-    maIMGColor(SVX_RES(IMG_LINE_COLOR)),
     maIMGNone(SVX_RES(IMG_NONE_ICON)),
     mpIMGWidthIcon(),
     mxFrame(rxFrame),
     mpBindings(pBindings),
-    mbColorAvailable(true),
     mbWidthValuable(true)
 {
     get(mpFTWidth, "widthlabel");
     get(mpTBWidth, "width");
-    get(mpFTColor, "colorlabel");
-    get(mpTBColor, "color");
     get(mpFTStyle, "stylelabel");
     get(mpLBStyle, "linestyle");
     get(mpFTTrancparency, "translabel");
@@ -203,8 +191,6 @@ LinePropertyPanel::LinePropertyPanel(
     get(mpFTCapStyle, "caplabel");
     get(mpLBCapStyle, "linecapstyle");
 
-    const sal_uInt16 nIdColor = mpTBColor->GetItemId(UNO_SELECTCOLOR);
-    mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(0 /* not defined, default is transparent */, nIdColor, mpTBColor)),
     Initialize();
 }
 
@@ -229,17 +215,10 @@ void LinePropertyPanel::Initialize()
     mpIMGWidthIcon[7] = Image(SVX_RES(IMG_WIDTH8_ICON));
 
     meMapUnit = maWidthControl.GetCoreMetric();
-    const sal_uInt16 nIdColor = mpTBColor->GetItemId(UNO_SELECTCOLOR);
-
-    mpTBColor->SetItemImage(nIdColor, maIMGColor);
-    mpTBColor->SetItemBits( nIdColor, mpTBColor->GetItemBits( nIdColor ) | ToolBoxItemBits::DROPDOWNONLY );
-    Link aLink = LINK(this, LinePropertyPanel, ToolboxColorSelectHdl);
-    mpTBColor->SetDropdownClickHdl ( aLink );
-    mpTBColor->SetSelectHdl ( aLink );
 
     FillLineStyleList();
     SelectLineStyle();
-    aLink = LINK( this, LinePropertyPanel, ChangeLineStyleHdl );
+    Link aLink = LINK( this, LinePropertyPanel, ChangeLineStyleHdl );
     mpLBStyle->SetSelectHdl( aLink );
     mpLBStyle->SetAccessibleName(OUString( "Style"));
     mpLBStyle->AdaptDropDownLineCountToMaximum();
@@ -268,7 +247,6 @@ void LinePropertyPanel::Initialize()
     mpMFTransparent->SetAccessibleName(OUString( "Transparency"));  //wj acc
 
     mpTBWidth->SetAccessibleRelationLabeledBy(mpFTWidth);
-    mpTBColor->SetAccessibleRelationLabeledBy(mpFTColor);
     mpLBStyle->SetAccessibleRelationLabeledBy(mpFTStyle);
     mpMFTransparent->SetAccessibleRelationLabeledBy(mpFTTrancparency);
     mpLBStart->SetAccessibleRelationLabeledBy(mpFTArrow);
@@ -340,40 +318,8 @@ void LinePropertyPanel::NotifyItemUpdate(
     (void)bIsEnabled;
     const bool bDisabled(SfxItemState::DISABLED == eState);
 
-    // By default, fill and show the color of existing line-color
-    mpColorUpdater->Update( maColor );
-
     switch(nSID)
     {
-        case SID_ATTR_LINE_COLOR:
-        {
-            if(bDisabled)
-            {
-                mpFTColor->Disable();
-                mpTBColor->Disable();
-            }
-            else
-            {
-                mpFTColor->Enable();
-                mpTBColor->Enable();
-            }
-
-            if(eState >= SfxItemState::DEFAULT)
-            {
-                const XLineColorItem* pItem = dynamic_cast< const XLineColorItem* >(pState);
-                if(pItem)
-                {
-                    maColor = pItem->GetColorValue();
-                    mbColorAvailable = true;
-                    mpColorUpdater->Update( maColor );
-                    break;
-                }
-            }
-
-            mbColorAvailable = false;
-            mpColorUpdater->Update(COL_WHITE);
-            break;
-        }
         case SID_ATTR_LINE_DASH:
         case SID_ATTR_LINE_STYLE:
         {
@@ -677,21 +623,6 @@ void LinePropertyPanel::NotifyItemUpdate(
 
 
 
-IMPL_LINK(LinePropertyPanel, ToolboxColorSelectHdl,ToolBox*, pToolBox)
-{
-    const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
-
-    if(aCommand == UNO_SELECTCOLOR)
-    {
-        maColorPopup.Show(*pToolBox);
-        maColorPopup.SetCurrentColor(maColor, mbColorAvailable);
-    }
-    return 0;
-}
-
-
-
-
 IMPL_LINK_NOARG(LinePropertyPanel, ChangeLineStyleHdl)
 {
     const sal_Int32 nPos(mpLBStyle->GetSelectEntryPos());
@@ -868,30 +799,6 @@ IMPL_LINK( LinePropertyPanel, ChangeTransparentHdl, void *, EMPTYARG )
 
 
 
-namespace
-{
-    Color GetTransparentColor (void)
-    {
-        return COL_TRANSPARENT;
-    }
-} // end of anonymous namespace
-
-PopupControl* LinePropertyPanel::CreateColorPopupControl (PopupContainer* pParent)
-{
-    return new ColorControl(
-        pParent,
-        mpBindings,
-        SVX_RES(RID_POPUPPANEL_LINEPAGE_COLOR),
-        SVX_RES(VS_COLOR),
-        ::boost::bind(GetTransparentColor),
-        ::boost::bind(&LinePropertyPanel::SetColor, this, _1, _2),
-        pParent,
-        0);
-}
-
-
-
-
 PopupControl* LinePropertyPanel::CreateLineWidthPopupControl (PopupContainer* pParent)
 {
     return new LineWidthControl(pParent, *this);
@@ -952,17 +859,6 @@ void LinePropertyPanel::SetWidthIcon()
 
 
 
-void LinePropertyPanel::SetColor (
-    const OUString& rsColorName,
-    const Color aColor)
-{
-    XLineColorItem aColorItem(rsColorName, aColor);
-    mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_COLOR, SfxCallMode::RECORD, &aColorItem, 0L);
-    maColor = aColor;
-}
-
-
-
 void LinePropertyPanel::SetWidth(long nWidth)
 {
     mnWidthCoreValue = nWidth;
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hrc b/svx/source/sidebar/line/LinePropertyPanel.hrc
index cf1b7fc..764ebfd 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hrc
+++ b/svx/source/sidebar/line/LinePropertyPanel.hrc
@@ -22,9 +22,6 @@
 #define CUSTOM_W    74
 #define CUSTOM_H    POPUPPANEL_MARGIN_LARGE * 2 +  TEXT_HEIGHT + 12 +  TEXT_CONTROL_SPACING_VERTICAL
 
-//color popup page
-#define VS_COLOR        1
-
 //style popup page
 #define PB_OPTIONS              2
 
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index ec5b90e..476c479 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -27,13 +27,11 @@
 #include <vcl/field.hxx>
 #include <boost/scoped_ptr.hpp>
 #include <boost/scoped_array.hpp>
-#include <svx/sidebar/ColorPopup.hxx>
 #include <svx/sidebar/PanelLayout.hxx>
 #include <svx/xtable.hxx>
 #include "LineWidthPopup.hxx"
 
 
-namespace svx { class ToolboxButtonColorUpdater; }
 class XLineStyleItem;
 class XLineDashItem;
 class XLineStartItem;
@@ -51,7 +49,6 @@ namespace {
 namespace svx { namespace sidebar {
 
 class PopupContainer;
-class ColorPopup;
 class LineWidthControl;
 
 
@@ -86,8 +83,6 @@ private:
     //ui controls
     FixedText*                        mpFTWidth;
     ToolBox*                          mpTBWidth;
-    FixedText*                        mpFTColor;
-    ToolBox*                          mpTBColor;
     FixedText*                        mpFTStyle;
     ListBox*                          mpLBStyle;
     FixedText*                        mpFTTrancparency;
@@ -104,7 +99,6 @@ private:
     ::sfx2::sidebar::ControllerItem                         maStyleControl;
     ::sfx2::sidebar::ControllerItem                         maDashControl;
     ::sfx2::sidebar::ControllerItem                         maWidthControl;
-    ::sfx2::sidebar::ControllerItem                         maColorControl;
     ::sfx2::sidebar::ControllerItem                         maStartControl;
     ::sfx2::sidebar::ControllerItem                         maEndControl;
     ::sfx2::sidebar::ControllerItem                         maLineEndListControl;
@@ -113,8 +107,6 @@ private:
     ::sfx2::sidebar::ControllerItem                         maEdgeStyle;
     ::sfx2::sidebar::ControllerItem                         maCapStyle;
 
-    Color                                                   maColor;
-    ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
     ::boost::scoped_ptr< XLineStyleItem >                   mpStyleItem;
     ::boost::scoped_ptr< XLineDashItem >                    mpDashItem;
     sal_uInt16                                              mnTrans;
@@ -126,11 +118,9 @@ private:
     ::boost::scoped_ptr< XLineEndItem >                     mpEndItem;
 
     //popup windows
-    ColorPopup maColorPopup;
     LineWidthPopup maLineWidthPopup;
 
-    // images from ressource
-    Image                                                   maIMGColor;
+    // images from resource
     Image                                                   maIMGNone;
 
     // multi-images
@@ -140,7 +130,6 @@ private:
     SfxBindings*                                            mpBindings;
 
     /// bitfield
-    bool                mbColorAvailable : 1;
     bool                mbWidthValuable : 1;
 
     void SetupIcons(void);
@@ -151,7 +140,6 @@ private:
     void SelectLineStyle();
 
     DECL_LINK(ImplWidthPopupModeEndHdl, FloatingWindow* );
-    DECL_LINK(ToolboxColorSelectHdl, ToolBox*);
     DECL_LINK(ChangeLineStyleHdl, void*);
     DECL_LINK(ToolboxWidthSelectHdl, ToolBox*);
     DECL_LINK(ChangeTransparentHdl , void *);
@@ -167,11 +155,6 @@ private:
         SfxBindings* pBindings);
     virtual ~LinePropertyPanel(void);
 
-    void SetColor(
-        const OUString& rsColorName,
-        const Color aColor);
-
-    PopupControl* CreateColorPopupControl (PopupContainer* pParent);
     PopupControl* CreateLineWidthPopupControl (PopupContainer* pParent);
 };
 
diff --git a/svx/source/sidebar/line/LinePropertyPanel.src b/svx/source/sidebar/line/LinePropertyPanel.src
index a41f10b..28ccd5d 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.src
+++ b/svx/source/sidebar/line/LinePropertyPanel.src
@@ -21,10 +21,6 @@
 #include <svx/dialogs.hrc>
 #include "helpid.hrc"
 
-Image IMG_LINE_COLOR
-{
-    ImageBitmap = Bitmap{File = "symphony/Line_color.png";};
-};
 Image IMG_NONE_ICON
 {
     ImageBitmap = Bitmap{File = "symphony/blank.png";};
@@ -63,23 +59,6 @@ Image IMG_WIDTH8_ICON
     ImageBitmap = Bitmap{File = "symphony/width8.png";};
 };
 
-Control RID_POPUPPANEL_LINEPAGE_COLOR
-{
-    OutputSize = TRUE;
-    DialogControl = TRUE;
-    Border = FALSE;
-    Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT  );
-
-    Control VS_COLOR
-    {
-        HelpId = HID_PPROPERTYPANEL_LINE_VS_COLOR ;
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
-        Size = MAP_APPFONT (  POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2);
-        TabStop = TRUE ;
-        Text = "Color";
-    };
-};
 Control RID_POPUPPANEL_LINEPAGE_WIDTH
 {
     OutputSize = TRUE;
diff --git a/svx/uiconfig/ui/sidebarline.ui b/svx/uiconfig/ui/sidebarline.ui
index 289012b..5aa8431 100644
--- a/svx/uiconfig/ui/sidebarline.ui
+++ b/svx/uiconfig/ui/sidebarline.ui
@@ -111,7 +111,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkToolbar" id="color">
+                  <object class="sfxlo-SidebarToolBox" id="color">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="has_tooltip">True</property>
@@ -126,7 +126,7 @@
                         <property name="tooltip_markup" translatable="yes">Select the color of the line.</property>
                         <property name="tooltip_text" translatable="yes">Select the color of the line.</property>
                         <property name="margin_left">20</property>
-                        <property name="action_name">.uno:SelectColor</property>
+                        <property name="action_name">.uno:XLineColor</property>
                         <property name="use_underline">True</property>
                       </object>
                       <packing>


More information about the Libreoffice-commits mailing list