summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-10-27 13:57:38 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2014-10-27 14:28:13 +0200
commit3c3257e499ff48e89b58ce722364ca96738970b1 (patch)
treecf1f491b8840fd132714a0fc3083841d37b16523
parent2dfa6b15ec315c587784070963c397bf5b75e2b0 (diff)
fdo#84844 Sidebar: Use SvxColorToolBoxControl for fill color
Change-Id: I0aa9dbef960391334097b68c980064724435db38
-rw-r--r--icon-themes/tango/links.txt1
-rw-r--r--include/svx/dialogs.hrc6
-rw-r--r--svx/inc/helpid.hrc1
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx126
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hrc2
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx23
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.src21
-rw-r--r--svx/uiconfig/ui/sidebararea.ui6
8 files changed, 8 insertions, 178 deletions
diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index 4656c97fd5a4..3bbd2594cc23 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -315,7 +315,6 @@ 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
svx/res/symphony/sch_backgroundcolor.png cmd/sc_formatarea.png
-svx/res/symphony/fill_color.png cmd/sc_formatarea.png
sw/res/sidebar/pageproppanel/last_custom_common.png svx/res/symphony/last_custom_common.png
sw/res/sidebar/pageproppanel/last_custom_common_grey.png svx/res/symphony/last_custom_common_grey.png
sc/imglst/na05.png cmd/sc_upsearch.png
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 196a6eb24f3e..d3a74f08198a 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -206,7 +206,6 @@
#define RID_POPUPPANEL_TEXTPAGE_FONT_COLOR (RID_SVX_START + 316)
#define RID_POPUPPANEL_TEXTPAGE_SPACING (RID_SVX_START + 317)
-#define RID_POPUPPANEL_AERAPAGE_COLOR (RID_SVX_START + 319)
#define RID_POPUPPANEL_AREAPAGE_TRGR (RID_SVX_START + 320)
#define RID_SIDEBAR_LINE_PANEL (RID_SVX_START + 321)
@@ -1043,9 +1042,8 @@
#define IMG_RADIAL (RID_SVX_SIDEBAR_BEGIN + 33)
#define IMG_SQUARE (RID_SVX_SIDEBAR_BEGIN + 34)
#define IMG_LINEAR (RID_SVX_SIDEBAR_BEGIN + 35)
-#define IMG_AREA_COLOR (RID_SVX_SIDEBAR_BEGIN + 36)
-#define IMG_ROT_LEFT (RID_SVX_SIDEBAR_BEGIN + 37)
-#define IMG_ROT_RIGHT (RID_SVX_SIDEBAR_BEGIN + 38)
+#define IMG_ROT_LEFT (RID_SVX_SIDEBAR_BEGIN + 36)
+#define IMG_ROT_RIGHT (RID_SVX_SIDEBAR_BEGIN + 37)
#define RID_SVX_SIDEBAR_END (RID_SVX_START + 1279)
#define RID_SVXIMG_GREENCHECK (RID_SVX_START + 1280)
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 75bed5efec4f..02c098ec7f75 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -118,7 +118,6 @@
#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"
-#define HID_PPROPERTYPANEL_AREA_COLOR_VS "SVX_HID_PPROPERTYPANEL_AREA_COLOR_VS"
#define HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES "SVX_HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES"
#define HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR "SVX_HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR"
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 9ab67b106d18..63467d2f3209 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -38,7 +38,6 @@
#include <svx/svxitems.hrc>
#include <vcl/toolbox.hxx>
#include <svtools/toolbarmenu.hxx>
-#include <svx/sidebar/ColorControl.hxx>
#include <boost/bind.hpp>
@@ -46,7 +45,6 @@ using namespace css;
using namespace css::uno;
using ::sfx2::sidebar::Theme;
-const char UNO_SIDEBARCOLOR[] = ".uno:sidebarcolor";
const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient";
namespace svx { namespace sidebar {
@@ -65,7 +63,6 @@ AreaPropertyPanel::AreaPropertyPanel(
SfxBindings* pBindings)
: PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui", rxFrame),
meLastXFS(static_cast<sal_uInt16>(-1)),
- maLastColor(Color(COL_DEFAULT_SHAPE_FILLING)),
mnLastPosGradient(0),
mnLastPosHatch(0),
mnLastPosBitmap(0),
@@ -86,7 +83,6 @@ AreaPropertyPanel::AreaPropertyPanel(
maGradientControl(SID_ATTR_FILL_GRADIENT, *pBindings, *this),
maHatchControl(SID_ATTR_FILL_HATCH, *pBindings, *this),
maBitmapControl(SID_ATTR_FILL_BITMAP, *pBindings, *this),
- maColorTableControl(SID_COLOR_TABLE, *pBindings, *this),
maGradientListControl(SID_GRADIENT_LIST, *pBindings, *this),
maHatchListControl(SID_HATCH_LIST, *pBindings, *this),
maBitmapListControl(SID_BITMAP_LIST, *pBindings, *this),
@@ -98,14 +94,11 @@ AreaPropertyPanel::AreaPropertyPanel(
maImgRadial(SVX_RES(IMG_RADIAL)),
maImgSquare(SVX_RES(IMG_SQUARE)),
maImgLinear(SVX_RES(IMG_LINEAR)),
- maImgColor(SVX_RES(IMG_AREA_COLOR)),
maTrGrPopup(this, ::boost::bind(&AreaPropertyPanel::CreateTransparencyGradientControl, this, _1)),
- maColorPopup(this, ::boost::bind(&AreaPropertyPanel::CreateColorPopupControl, this, _1)),
mpFloatTransparenceItem(),
mpTransparanceItem(),
mxFrame(rxFrame),
- mpBindings(pBindings),
- mbColorAvail(true)
+ mpBindings(pBindings)
{
get(mpColorTextFT, "filllabel");
get(mpLbFillType, "fillstyle");
@@ -116,9 +109,6 @@ AreaPropertyPanel::AreaPropertyPanel(
get(mpMTRTransparent, "settransparency");
get(mpBTNGradient, "selectgradient");
- const sal_uInt16 nIdColor = mpToolBoxColor->GetItemId(UNO_SIDEBARCOLOR);
- mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, nIdColor, mpToolBoxColor)),
-
Initialize();
}
@@ -164,18 +154,6 @@ void AreaPropertyPanel::Initialize()
aLink = LINK( this, AreaPropertyPanel, SelectFillAttrHdl );
mpLbFillAttr->SetSelectHdl( aLink );
- //add for new color picker
- mpLbFillAttr->Hide();
- const sal_uInt16 nIdColor = mpToolBoxColor->GetItemId(UNO_SIDEBARCOLOR);
- mpToolBoxColor->SetItemImage(nIdColor, maImgColor);
- mpToolBoxColor->SetItemBits( nIdColor, mpToolBoxColor->GetItemBits( nIdColor ) | ToolBoxItemBits::DROPDOWNONLY );
- mpToolBoxColor->SetItemText(nIdColor, msHelpFillAttr);
-
- aLink = LINK(this, AreaPropertyPanel, ToolBoxColorDropHdl);
- mpToolBoxColor->SetDropdownClickHdl ( aLink );
- mpToolBoxColor->SetSelectHdl ( aLink );
-
- //add end
mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanel, ChangeTrgrTypeHdl_Impl));
mpLBTransType->SetAccessibleName(OUString( "Transparency")); //wj acc
@@ -237,7 +215,7 @@ IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
mpLbFillAttr->Hide();
mpToolBoxColor->Show();
const OUString aTmpStr;
- const Color aColor = maLastColor;
+ const Color aColor = mpColorItem->GetColorValue();
const XFillColorItem aXFillColorItem( aTmpStr, aColor );
// #i122676# change FillStyle and Color in one call
@@ -504,41 +482,6 @@ IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox )
}
-IMPL_LINK(AreaPropertyPanel, ToolBoxColorDropHdl, ToolBox*, pToolBox)
-{
- const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
-
- if(UNO_SIDEBARCOLOR == aCommand)
- {
- maColorPopup.Show(*pToolBox);
-
- if (mpColorItem)
- {
- maColorPopup.SetCurrentColor(mpColorItem->GetColorValue(), mbColorAvail);
- }
- else
- {
- maColorPopup.SetCurrentColor(COL_WHITE, false);
- }
- }
-
- return 0;
-}
-
-
-
-void AreaPropertyPanel::SetColor (
- const OUString& rsColorName,
- const Color aColor)
-{
- const XFillColorItem aXFillColorItem(rsColorName, aColor);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, &aXFillColorItem, 0L);
- maLastColor = aColor;
-}
-
-
-
-
PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent)
{
return new AreaTransparencyGradientControl(pParent, *this);
@@ -547,22 +490,6 @@ PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContain
-PopupControl* AreaPropertyPanel::CreateColorPopupControl (PopupContainer* pParent)
-{
- return new ColorControl(
- pParent,
- mpBindings,
- SVX_RES(RID_POPUPPANEL_AERAPAGE_COLOR),
- SVX_RES(VS_COLOR),
- ::boost::bind(&AreaPropertyPanel::GetLastColor, this),
- ::boost::bind(&AreaPropertyPanel::SetColor, this, _1,_2),
- pParent,
- 0);
-}
-
-
-
-
void AreaPropertyPanel::SetupIcons(void)
{
if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
@@ -857,24 +784,7 @@ void AreaPropertyPanel::NotifyItemUpdate(
mpLbFillAttr->Hide();
mpToolBoxColor->Show();
- if(SfxItemState::DEFAULT == eState)
- {
- mpToolBoxColor->Enable();
- mbColorAvail = true;
- // maLastColor = mpColorItem->GetColorValue();
- Update();
- }
- else if(SfxItemState::DISABLED == eState)
- {
- mpToolBoxColor->Disable();
- mbColorAvail = false;
- mpColorUpdater->Update(COL_WHITE);
- }
- else
- {
- mbColorAvail = false;
- mpColorUpdater->Update(COL_WHITE);
- }
+ Update();
}
break;
}
@@ -965,31 +875,6 @@ void AreaPropertyPanel::NotifyItemUpdate(
}
break;
}
- case SID_COLOR_TABLE:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- if(mpStyleItem && drawing::FillStyle_SOLID == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- if(mpColorItem)
- {
- const Color aColor = mpColorItem->GetColorValue();
- const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxColorListItem aItem(*static_cast<const SvxColorListItem*>(pSh->GetItem(SID_COLOR_TABLE)));
-
- mpLbFillAttr->Clear();
- mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetColorList());
- mpLbFillAttr->SelectEntry(aColor);
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- }
- break;
- }
case SID_GRADIENT_LIST:
{
if(SfxItemState::DEFAULT == eState)
@@ -1094,11 +979,6 @@ void AreaPropertyPanel::Update()
{
mpLbFillAttr->Hide();
mpToolBoxColor->Show();
- mpColorUpdater->Update(mpColorItem->GetColorValue());
- }
- else
- {
- mpColorUpdater->Update(COL_WHITE);
}
break;
}
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hrc b/svx/source/sidebar/area/AreaPropertyPanel.hrc
index c50783b4c5cb..d627b637d923 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hrc
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hrc
@@ -22,8 +22,6 @@
#define TBI_LEFT 1
#define TBI_RIGHT 1
-#define VS_COLOR 1
-
#define FT_TRGR_CENTER_X 9
#define MTR_TRGR_CENTER_X 10
#define FT_TRGR_CENTER_Y 11
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 0d3540f6e21d..3bc035358ca7 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -19,7 +19,6 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
-#include <svx/sidebar/ColorPopup.hxx>
#include "AreaTransparencyGradientPopup.hxx"
#include <vcl/ctrl.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
@@ -37,13 +36,11 @@
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
#include <svl/intitem.hxx>
-#include <svx/tbxcolorupdate.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <boost/scoped_ptr.hpp>
class XFillFloatTransparenceItem;
-namespace svx { class ToolboxButtonColorUpdater; }
namespace svx { namespace sidebar {
@@ -85,7 +82,6 @@ public:
private:
sal_uInt16 meLastXFS;
- Color maLastColor;
sal_Int32 mnLastPosGradient;
sal_Int32 mnLastPosHatch;
@@ -109,8 +105,6 @@ private:
MetricField* mpMTRTransparent;
ToolBox* mpBTNGradient;
- ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
-
::boost::scoped_ptr< XFillStyleItem > mpStyleItem;
::boost::scoped_ptr< XFillColorItem > mpColorItem;
::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem;
@@ -122,7 +116,6 @@ private:
::sfx2::sidebar::ControllerItem maGradientControl;
::sfx2::sidebar::ControllerItem maHatchControl;
::sfx2::sidebar::ControllerItem maBitmapControl;
- ::sfx2::sidebar::ControllerItem maColorTableControl;
::sfx2::sidebar::ControllerItem maGradientListControl;
::sfx2::sidebar::ControllerItem maHatchListControl;
::sfx2::sidebar::ControllerItem maBitmapListControl;
@@ -135,12 +128,8 @@ private:
Image maImgRadial;
Image maImgSquare;
Image maImgLinear;
- Image maImgColor;
-
- OUString msHelpFillAttr;
AreaTransparencyGradientPopup maTrGrPopup;
- ColorPopup maColorPopup;
::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem;
@@ -148,9 +137,6 @@ private:
css::uno::Reference<css::frame::XFrame> mxFrame;
SfxBindings* mpBindings;
- /// bitfield
- bool mbColorAvail : 1;
-
DECL_LINK(SelectFillTypeHdl, ListBox* );
DECL_LINK(SelectFillAttrHdl, ListBox* );
DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
@@ -160,10 +146,6 @@ private:
PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
- // for color picker
- PopupControl* CreateColorPopupControl (PopupContainer* pParent);
- DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker
-
// constructor/destuctor
AreaPropertyPanel(
vcl::Window* pParent,
@@ -175,11 +157,6 @@ private:
void Initialize();
void Update();
void ImpUpdateTransparencies();
-
- const Color& GetLastColor (void) const { return maLastColor;}
- void SetColor (
- const OUString& rsColorName,
- const Color aColor);
};
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.src b/svx/source/sidebar/area/AreaPropertyPanel.src
index bc7a16134e0e..4dea34cbee45 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.src
+++ b/svx/source/sidebar/area/AreaPropertyPanel.src
@@ -45,10 +45,6 @@ Image IMG_LINEAR
{
ImageBitmap = Bitmap{File = "symphony/linear.png";};
};
-Image IMG_AREA_COLOR
-{
- ImageBitmap = Bitmap{File = "symphony/fill_color.png";};
-};
Image IMG_ROT_LEFT
{
ImageBitmap = Bitmap{File = "symphony/rotate_left.png";};
@@ -236,22 +232,5 @@ Control RID_POPUPPANEL_AREAPAGE_TRGR
Text [ en-US ] = "Rotate clockwise by 45 degrees." ;
};
};
-Control RID_POPUPPANEL_AERAPAGE_COLOR
-{
- OutputSize = TRUE;
- DialogControl = TRUE;
- Border = FALSE;
- Size = MAP_APPFONT( POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT );
-
- Control VS_COLOR
- {
- HelpID = HID_PPROPERTYPANEL_AREA_COLOR_VS;
- 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";
- };
-};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/sidebararea.ui b/svx/uiconfig/ui/sidebararea.ui
index 725980cc55c2..cbea7cb64cc5 100644
--- a/svx/uiconfig/ui/sidebararea.ui
+++ b/svx/uiconfig/ui/sidebararea.ui
@@ -63,7 +63,7 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
- <object class="GtkToolbar" id="selectcolor">
+ <object class="sfxlo-SidebarToolBox" id="selectcolor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -74,7 +74,7 @@
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Select the color to apply.</property>
<property name="tooltip_text" translatable="yes">Select the color to apply.</property>
- <property name="action_name">.uno:sidebarcolor</property>
+ <property name="action_name">.uno:FillColor</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -91,7 +91,7 @@
</child>
<child>
<object class="svxlo-SvxFillAttrBox" id="fillattr">
- <property name="visible">True</property>
+ <property name="visible">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Select the effect to apply.</property>