diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/controlwrapper.hxx | 23 | ||||
-rw-r--r-- | include/svx/PaletteManager.hxx | 16 | ||||
-rw-r--r-- | include/svx/SvxColorValueSet.hxx | 2 | ||||
-rw-r--r-- | include/svx/bmpmask.hxx | 15 | ||||
-rw-r--r-- | include/svx/colorbox.hxx | 93 | ||||
-rw-r--r-- | include/svx/colorwindow.hxx | 98 | ||||
-rw-r--r-- | include/svx/dialogs.hrc | 7 | ||||
-rw-r--r-- | include/svx/float3d.hxx | 33 | ||||
-rw-r--r-- | include/svx/fontwork.hxx | 9 | ||||
-rw-r--r-- | include/svx/sidebar/AreaPropertyPanelBase.hxx | 6 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 5 | ||||
-rw-r--r-- | include/svx/tbcontrl.hxx | 6 | ||||
-rw-r--r-- | include/svx/tbxcolorupdate.hxx | 1 |
13 files changed, 239 insertions, 75 deletions
diff --git a/include/sfx2/controlwrapper.hxx b/include/sfx2/controlwrapper.hxx index 33db87efaad0..41bd92ff799e 100644 --- a/include/sfx2/controlwrapper.hxx +++ b/include/sfx2/controlwrapper.hxx @@ -115,7 +115,7 @@ private: | +- DummyWindowWrapper [1] | +- CheckBoxWrapper [1] | +- EditWrapper [1] - | +- ColorListBoxWrapper [1] + | +- SvxColorListBoxWrapper [1] | | | +- NumericFieldWrapper< ValueT > [1] | | | @@ -245,26 +245,6 @@ public: }; -/** A wrapper for the SVTOOLS ColorListBox. */ -class SFX2_DLLPUBLIC ColorListBoxWrapper: - public SingleControlWrapper< ColorListBox, Color > -{ - /* Note: cannot use 'const Color&' as template argument, because the - SVTOOLS ColorListBox returns the color by value and not by reference, - therefore GetControlValue() must return a temporary object too. */ -public: - explicit ColorListBoxWrapper(ColorListBox & rListBox); - - virtual ~ColorListBoxWrapper(); - - virtual bool IsControlDontKnow() const override; - virtual void SetControlDontKnow( bool bSet ) override; - - virtual Color GetControlValue() const override; - virtual void SetControlValue( Color aColor ) override; -}; - - /** A wrapper for the VCL NumericField. */ template< typename ValueT > class NumericFieldWrapper : public SingleControlWrapper< NumericField, ValueT > @@ -280,7 +260,6 @@ public: virtual void SetControlValue( ValueT nValue ) SAL_OVERRIDE; }; - /** A wrapper for the VCL MetricField. Adds support for field units during accessing the control value. The diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx index ceeea5d5a5e8..09662558ffdf 100644 --- a/include/svx/PaletteManager.hxx +++ b/include/svx/PaletteManager.hxx @@ -25,12 +25,8 @@ #include <svx/tbxcolorupdate.hxx> #include <tools/urlobj.hxx> -#include <comphelper/processfactory.hxx> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/URLTransformer.hpp> -#include <com/sun/star/frame/XDispatch.hpp> -#include <com/sun/star/frame/Desktop.hpp> -#include <com/sun/star/frame/XDispatchProvider.hpp> #include <deque> #include <vector> @@ -48,10 +44,10 @@ class SVX_DLLPUBLIC PaletteManager XColorListRef pColorList; Color mLastColor; - std::deque<Color> maRecentColors; + std::deque<NamedColor> maRecentColors; std::vector<std::unique_ptr<Palette>> m_Palettes; - std::function<void(const OUString&, const Color&)> maColorSelectFunction; + std::function<void(const OUString&, const NamedColor&)> maColorSelectFunction; css::uno::Reference < css::uno::XComponentContext > m_context; public: PaletteManager(); @@ -73,14 +69,14 @@ public: const Color& GetLastColor(); void SetLastColor(const Color& rLastColor); - void AddRecentColor(const Color& rRecentColor); + void AddRecentColor(const Color& rRecentColor, const OUString& rColorName, bool bFront = true); void SetBtnUpdater(svx::ToolboxButtonColorUpdater* pBtnUpdater); - void PopupColorPicker(const OUString& aCommand); + void PopupColorPicker(vcl::Window* pParent, const OUString& aCommand, const Color& rInitialColor); - void SetColorSelectFunction(const std::function<void(const OUString&, const Color&)>& aColorSelectFunction); + void SetColorSelectFunction(const std::function<void(const OUString&, const NamedColor&)>& aColorSelectFunction); - static void DispatchColorCommand(const OUString& aCommand, const Color& rColor); + static void DispatchColorCommand(const OUString& aCommand, const NamedColor& rColor); }; #endif // INCLUDED_SVX_PALETTEMANAGER_HXX diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx index 0b9f53366cb5..1e6d6a615c79 100644 --- a/include/svx/SvxColorValueSet.hxx +++ b/include/svx/SvxColorValueSet.hxx @@ -28,7 +28,7 @@ class XColorList; class SVX_DLLPUBLIC SvxColorValueSet : public ValueSet { public: - SvxColorValueSet(vcl::Window* pParent, WinBits nWinStyle = WB_ITEMBORDER); + SvxColorValueSet(vcl::Window* pParent, WinBits nWinStyle); virtual void Resize() override; diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx index b8c404e1b8fd..e8359a8d53a5 100644 --- a/include/svx/bmpmask.hxx +++ b/include/svx/bmpmask.hxx @@ -75,6 +75,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMaskChildWindow : public SfxChildWindo class MaskData; class MaskSet; class ColorWindow; +class SvxColorListBox; class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow { @@ -88,28 +89,27 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow VclPtr<CheckBox> m_pCbx1; VclPtr<MaskSet> m_pQSet1; VclPtr<MetricField> m_pSp1; - VclPtr<ColorLB> m_pLbColor1; + VclPtr<SvxColorListBox> m_pLbColor1; VclPtr<CheckBox> m_pCbx2; VclPtr<MaskSet> m_pQSet2; VclPtr<MetricField> m_pSp2; - VclPtr<ColorLB> m_pLbColor2; + VclPtr<SvxColorListBox> m_pLbColor2; VclPtr<CheckBox> m_pCbx3; VclPtr<MaskSet> m_pQSet3; VclPtr<MetricField> m_pSp3; - VclPtr<ColorLB> m_pLbColor3; + VclPtr<SvxColorListBox> m_pLbColor3; VclPtr<CheckBox> m_pCbx4; VclPtr<MaskSet> m_pQSet4; VclPtr<MetricField> m_pSp4; - VclPtr<ColorLB> m_pLbColor4; + VclPtr<SvxColorListBox> m_pLbColor4; MaskData* pData; VclPtr<CheckBox> m_pCbxTrans; - VclPtr<ColorLB> m_pLbColorTrans; + VclPtr<SvxColorListBox> m_pLbColorTrans; - XColorListRef pColLst; Color aPipetteColor; SvxBmpMaskSelectItem aSelItem; @@ -140,9 +140,6 @@ public: void SetColor( const Color& rColor ); void PipetteClicked(); - bool NeedsColorList() const; - void SetColorList( const XColorListRef &pColorList ); - void SetExecState( bool bEnable ); Graphic Mask( const Graphic& rGraphic ); diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx new file mode 100644 index 000000000000..8043363f9856 --- /dev/null +++ b/include/svx/colorbox.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SVX_COLORBOX_HXX +#define INCLUDED_SVX_COLORBOX_HXX + +#include <vcl/menubtn.hxx> +#include <svx/colorwindow.hxx> +#include <sfx2/controlwrapper.hxx> + +class SvxColorListBox; + +class SvxListBoxColorWrapper +{ +public: + SvxListBoxColorWrapper(SvxColorListBox* pControl); + void operator()(const OUString& rCommand, const NamedColor& rColor); +private: + VclPtr<SvxColorListBox> mxControl; +}; + +class SVX_DLLPUBLIC SvxColorListBox : public MenuButton +{ +private: + friend class SvxListBoxColorWrapper; + VclPtr<SvxColorWindow> m_xColorWindow; + Link<SvxColorListBox&, void> m_aSelectedLink; + SvxListBoxColorWrapper m_aColorWrapper; + Color m_aAutoDisplayColor; + NamedColor m_aSelectedColor; + sal_uInt16 m_nSlotId; + bool m_bShowNoneButton; + PaletteManager m_aPaletteManager; + BorderColorStatus m_aBorderColorStatus; + + DECL_LINK_TYPED(MenuActivateHdl, MenuButton *, void); + void Selected(const NamedColor& rNamedColor); + void createColorWindow(); + void LockWidthRequest(); + VclPtr<SvxColorWindow> getColorWindow() const; +public: + SvxColorListBox(vcl::Window* pParent); + virtual ~SvxColorListBox() override; + virtual void dispose() override; + + void SetSelectHdl(const Link<SvxColorListBox&, void>& rLink) + { + m_aSelectedLink = rLink; + } + + void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false); + + NamedColor GetSelectEntry() const; + Color GetSelectEntryColor() const; + + void SelectEntry(const NamedColor& rColor); + void SelectEntry(const Color& rColor); + + void SetNoSelection() { getColorWindow()->SetNoSelection(); } + bool IsNoSelection() const { return getColorWindow()->IsNoSelection(); } + + void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; } + void ShowPreview(const NamedColor &rColor); +}; + +/** A wrapper for SvxColorListBox. */ +class SVX_DLLPUBLIC SvxColorListBoxWrapper + : public sfx::SingleControlWrapper<SvxColorListBox, Color> +{ + /* Note: cannot use 'const Color&' as template argument, because the + SvxColorListBox returns the color by value and not by reference, + therefore GetControlValue() must return a temporary object too. */ +public: + explicit SvxColorListBoxWrapper(SvxColorListBox& rListBox); + + virtual ~SvxColorListBoxWrapper() override; + + virtual bool IsControlDontKnow() const override; + virtual void SetControlDontKnow( bool bSet ) override; + + virtual Color GetControlValue() const override; + virtual void SetControlValue( Color aColor ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx new file mode 100644 index 000000000000..1371a92dfde2 --- /dev/null +++ b/include/svx/colorwindow.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SOURCE_TBXCTRLS_COLORWINDOW_HXX +#define INCLUDED_SVX_SOURCE_TBXCTRLS_COLORWINDOW_HXX + +#include <sfx2/tbxctrl.hxx> +#include <svtools/toolbarmenu.hxx> +#include <svtools/valueset.hxx> +#include <svl/lstner.hxx> +#include <rtl/ustring.hxx> +#include <com/sun/star/frame/XFrame.hpp> +#include <svx/SvxColorValueSet.hxx> +#include <svx/PaletteManager.hxx> +#include <vcl/lstbox.hxx> + +#include <functional> + +class BorderColorStatus; +class Button; +typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction; + +#define COL_NONE_COLOR ::Color(0x80, 0xFF, 0xFF, 0xFF) + +class SVX_DLLPUBLIC SvxColorWindow : public svtools::ToolbarPopup +{ +private: + const sal_uInt16 theSlotId; + VclPtr<SvxColorValueSet> mpColorSet; + VclPtr<SvxColorValueSet> mpRecentColorSet; + + VclPtr<ListBox> mpPaletteListBox; + VclPtr<PushButton> mpButtonAutoColor; + VclPtr<PushButton> mpButtonNoneColor; + VclPtr<PushButton> mpButtonPicker; + VclPtr<FixedLine> mpAutomaticSeparator; + OUString maCommand; + Link<const NamedColor&, void> maSelectedLink; + + VclPtr<vcl::Window> mxParentWindow; + PaletteManager& mrPaletteManager; + BorderColorStatus& mrBorderColorStatus; + + ColorSelectFunction maColorSelectFunction; + + DECL_LINK_TYPED( SelectHdl, ValueSet*, void ); + DECL_LINK_TYPED( SelectPaletteHdl, ListBox&, void); + DECL_LINK_TYPED( AutoColorClickHdl, Button*, void ); + DECL_LINK_TYPED( OpenPickerClickHdl, Button*, void ); + + static bool SelectValueSetEntry(SvxColorValueSet* pColorSet, const Color& rColor); + static NamedColor GetSelectEntryColor(ValueSet * pColorSet); + NamedColor GetAutoColor() const; + NamedColor GetNoneColor() const; + +public: + SvxColorWindow(const OUString& rCommand, + PaletteManager& rPaletteManager, + BorderColorStatus& rBorderColorStatus, + sal_uInt16 nSlotId, + const css::uno::Reference< css::frame::XFrame >& rFrame, + vcl::Window* pParentWindow, + ColorSelectFunction const& rColorSelectFunction); + virtual ~SvxColorWindow() override; + virtual void dispose() override; + void ShowNoneButton(); + void StartSelection(); + void SetNoSelection(); + bool IsNoSelection() const; + void SelectEntry(const NamedColor& rColor); + void SelectEntry(const Color& rColor); + NamedColor GetSelectEntryColor() const; + + virtual void KeyInput( const KeyEvent& rKEvt ) override; + virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw (com::sun::star::uno::RuntimeException, std::exception) override; + + void SetSelectedHdl( const Link<const NamedColor&, void>& rLink ) { maSelectedLink = rLink; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 59260ae53f00..8d46ec4323d3 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -31,8 +31,10 @@ // some strings also used in CUI #define RID_SVXERRCTX (RID_SVX_START + 351) #define RID_SVXSTR_COLOR (RID_SVX_START + 179) -#define RID_SVXSTR_TRANSPARENT (RID_SVX_START + 190) +#define RID_SVXSTR_NOFILL (RID_SVX_START + 190) #define RID_SVXSTR_AUTOMATIC (RID_SVX_START + 841) +#define RID_SVXSTR_BY_AUTHOR (RID_SVX_START + 842) +#define RID_SVXSTR_TRANSPARENT (RID_SVX_START + 843) #define RID_SVXSTR_INVISIBLE (RID_SVX_START + 178) #define RID_SVXSTR_NONE (RID_SVX_START + 183) #define RID_SVXSTR_SOLID (RID_SVX_START + 160) @@ -145,9 +147,6 @@ #define RID_SVXIMAGE_COLORDLG (RID_SVX_START + 214) #define RID_SVXFLOAT3D_FAVORITE (RID_SVX_START + 73) -#define RID_SVXFLOAT3D_FIX_X (RID_SVX_START + 74) -#define RID_SVXFLOAT3D_FIX_Y (RID_SVX_START + 75) -#define RID_SVXFLOAT3D_FIX_Z (RID_SVX_START + 76) #define RID_SVXFLOAT3D_FIX_R (RID_SVX_START + 77) #define RID_SVXFLOAT3D_FIX_G (RID_SVX_START + 78) #define RID_SVXFLOAT3D_FIX_B (RID_SVX_START + 84) diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx index 6f22ef7d7d40..4179c1660c58 100644 --- a/include/svx/float3d.hxx +++ b/include/svx/float3d.hxx @@ -42,14 +42,13 @@ enum ViewType3D VIEWTYPE_MATERIAL }; -class SdrModel; class FmFormModel; class VirtualDevice; class E3dView; class SdrPageView; class Svx3DCtrlItem; class SvxConvertTo3DItem; - +class SvxColorListBox; struct Svx3DWinImpl; @@ -114,16 +113,16 @@ private: VclPtr<PushButton> m_pBtnLight6; VclPtr<PushButton> m_pBtnLight7; VclPtr<PushButton> m_pBtnLight8; - VclPtr<ColorLB> m_pLbLight1; - VclPtr<ColorLB> m_pLbLight2; - VclPtr<ColorLB> m_pLbLight3; - VclPtr<ColorLB> m_pLbLight4; - VclPtr<ColorLB> m_pLbLight5; - VclPtr<ColorLB> m_pLbLight6; - VclPtr<ColorLB> m_pLbLight7; - VclPtr<ColorLB> m_pLbLight8; + VclPtr<SvxColorListBox> m_pLbLight1; + VclPtr<SvxColorListBox> m_pLbLight2; + VclPtr<SvxColorListBox> m_pLbLight3; + VclPtr<SvxColorListBox> m_pLbLight4; + VclPtr<SvxColorListBox> m_pLbLight5; + VclPtr<SvxColorListBox> m_pLbLight6; + VclPtr<SvxColorListBox> m_pLbLight7; + VclPtr<SvxColorListBox> m_pLbLight8; VclPtr<PushButton> m_pBtnLightColor; - VclPtr<ColorLB> m_pLbAmbientlight; // ListBox + VclPtr<SvxColorListBox> m_pLbAmbientlight; // ListBox VclPtr<PushButton> m_pBtnAmbientColor; // color button // Textures @@ -145,13 +144,13 @@ private: // material editor VclPtr<VclContainer> m_pFLMaterial; VclPtr<ListBox> m_pLbMatFavorites; - VclPtr<ColorLB> m_pLbMatColor; + VclPtr<SvxColorListBox> m_pLbMatColor; VclPtr<PushButton> m_pBtnMatColor; - VclPtr<ColorLB> m_pLbMatEmission; + VclPtr<SvxColorListBox> m_pLbMatEmission; VclPtr<PushButton> m_pBtnEmissionColor; VclPtr<VclContainer> m_pFLMatSpecular; - VclPtr<ColorLB> m_pLbMatSpecular; + VclPtr<SvxColorListBox> m_pLbMatSpecular; VclPtr<PushButton> m_pBtnSpecularColor; VclPtr<MetricField> m_pMtrMatSpecularIntensity; @@ -193,7 +192,7 @@ private: DECL_LINK_TYPED( ClickAssignHdl, Button*, void ); DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( ClickColorHdl, Button*, void ); - DECL_LINK_TYPED( SelectHdl, ListBox&, void ); + DECL_LINK_TYPED( SelectHdl, SvxColorListBox&, void ); DECL_LINK_TYPED( ModifyHdl, Edit&, void ); void ClickLight(PushButton &rBtn); @@ -202,7 +201,7 @@ private: SVX_DLLPRIVATE void Construct(); SVX_DLLPRIVATE void Reset(); - SVX_DLLPRIVATE bool LBSelectColor( ColorLB* pLb, const Color& rColor ); + SVX_DLLPRIVATE bool LBSelectColor( SvxColorListBox* pLb, const Color& rColor ); SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn = nullptr ); SVX_DLLPRIVATE ColorLB* GetLbByButton( const PushButton* pBtn = nullptr ); @@ -218,7 +217,7 @@ public: virtual ~Svx3DWin(); virtual void dispose() override; - void InitColorLB( const SdrModel* pDoc ); + void InitColorLB(); bool IsUpdateMode() const { return bUpdate; } void Update( SfxItemSet& rSet ); diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx index 5cbd86fde070..c69e901bf6c0 100644 --- a/include/svx/fontwork.hxx +++ b/include/svx/fontwork.hxx @@ -35,6 +35,7 @@ class SdrView; class SdrPageView; class SdrObject; +class SvxColorListBox; class XFormTextAdjustItem; class XFormTextDistanceItem; @@ -107,7 +108,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow VclPtr<FixedImage> m_pFbShadowY; VclPtr<MetricField> m_pMtrFldShadowY; - VclPtr<ColorLB> m_pShadowColorLB; + VclPtr<SvxColorListBox> m_pShadowColorLB; SfxBindings& rBindings; Idle aInputIdle; @@ -138,8 +139,6 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow long nSaveShadowAngle; long nSaveShadowSize; - XColorListRef pColorList; - friend class SvxFontWorkChildWindow; friend class SvxFontWorkControllerItem; @@ -150,7 +149,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow DECL_LINK_TYPED( ModifyInputHdl_Impl, Edit&, void ); DECL_LINK_TYPED( InputTimoutHdl_Impl, Timer *, void ); - DECL_LINK_TYPED( ColorSelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ColorSelectHdl_Impl, SvxColorListBox&, void ); void SetStyle_Impl(const XFormTextStyleItem*); void SetAdjust_Impl(const XFormTextAdjustItem*); @@ -175,8 +174,6 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow vcl::Window* pParent); virtual ~SvxFontWorkDialog(); virtual void dispose() override; - - void SetColorList(const XColorListRef &pTable); }; #endif // INCLUDED_SVX_FONTWORK_HXX diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index ef653bdc219c..342f2fd1617f 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -25,6 +25,7 @@ #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/SidebarController.hxx> #include <sfx2/sidebar/SidebarToolBox.hxx> +#include <svx/colorbox.hxx> #include <svx/xgrad.hxx> #include <svx/itemwin.hxx> #include <svx/xfillit0.hxx> @@ -126,8 +127,8 @@ protected: VclPtr<FixedText> mpColorTextFT; VclPtr<SvxFillTypeBox> mpLbFillType; VclPtr<SvxFillAttrBox> mpLbFillAttr; - VclPtr<ColorLB> mpLbFillGradFrom; - VclPtr<ColorLB> mpLbFillGradTo; + VclPtr<SvxColorListBox> mpLbFillGradFrom; + VclPtr<SvxColorListBox> mpLbFillGradTo; VclPtr<sfx2::sidebar::SidebarToolBox> mpToolBoxColor; // for new color picker VclPtr<FixedText> mpTrspTextFT; VclPtr<ListBox> mpLBTransType; @@ -159,6 +160,7 @@ protected: DECL_LINK_TYPED(SelectFillTypeHdl, ListBox&, void ); DECL_LINK_TYPED(SelectFillAttrHdl, ListBox&, void ); + DECL_LINK_TYPED(SelectFillColorHdl, SvxColorListBox&, void ); DECL_LINK_TYPED(ChangeTrgrTypeHdl_Impl, ListBox&, void); DECL_LINK_TYPED(ModifyTransparentHdl_Impl, Edit&, void); DECL_LINK_TYPED(ModifyTransSliderHdl, Slider*, void); diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 67cbc9a24973..06ce25a9b47c 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -1032,8 +1032,11 @@ #define SID_EDIT_POSTIT ( SID_SVX_START + 1158 ) #define SID_ANCHOR_MENU ( SID_SVX_START + 1159 ) +#define SID_AUTHOR_COLOR ( SID_SVX_START + 1160 ) +#define SID_BMPMASK_COLOR ( SID_SVX_START + 1161 ) + // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE (SID_ANCHOR_MENU + 1) +#define SID_SVX_FIRSTFREE (SID_BMPMASK_COLOR + 1) // Overflow check for slot IDs diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 34e5563ca31f..fa04ee76c855 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -136,6 +136,7 @@ #include <svx/strarray.hxx> #include <svx/svxdllapi.h> #include <com/sun/star/awt/FontDescriptor.hpp> +#include <svx/colorwindow.hxx> #include <svx/PaletteManager.hxx> #include <memory> @@ -226,17 +227,16 @@ public: Color GetColor(); }; -typedef std::function<void(const OUString&, const Color&)> ColorSelectFunction; class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl { using SfxToolBoxControl::StateChanged; std::unique_ptr<svx::ToolboxButtonColorUpdater> m_xBtnUpdater; - PaletteManager mPaletteManager; + PaletteManager mrPaletteManager; BorderColorStatus maBorderColorStatus; bool bSidebarType; ColorSelectFunction maColorSelectFunction; - DECL_LINK_TYPED(SelectedHdl, const Color&, void); + DECL_LINK_TYPED(SelectedHdl, const NamedColor&, void); public: SFX_DECL_TOOLBOX_CONTROL(); SvxColorToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox); diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx index 34e1689915a7..ebf5b183e62d 100644 --- a/include/svx/tbxcolorupdate.hxx +++ b/include/svx/tbxcolorupdate.hxx @@ -49,6 +49,7 @@ namespace svx ~ToolboxButtonColorUpdater(); void Update( const Color& rColor, bool bForceUpdate = false ); + Color GetCurrentColor() const { return maCurColor; } private: ToolboxButtonColorUpdater(ToolboxButtonColorUpdater &) = delete; |