summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-10-26 11:53:33 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2014-10-26 12:35:21 +0200
commit35ae136427b6cb71de9728f82b9364b702ea2ef5 (patch)
treedfc60069e8b9ef2c247e32f3a078ddeaf57d5df8 /svx
parent4eeee7647601c1b5c22d0d3881e47b1f3a46a304 (diff)
fdo#84844 Sidebar: Use SvxColorToolBoxControl for line color
Change-Id: I266cfd8c80088f698ec36662357477bb456a96fe
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/helpid.hrc1
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx106
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hrc3
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx19
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.src21
-rw-r--r--svx/uiconfig/ui/sidebarline.ui4
6 files changed, 4 insertions, 150 deletions
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 6de49daafc3d..75bed5efec4f 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 4b4a312e70a3..c5f971902b41 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 cf1b7fce5eb8..764ebfd2d7cc 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 ec5b90e2b01f..476c4799f855 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 a41f10b10780..28ccd5d90a7a 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 289012b456f5..5aa8431e1215 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>