summaryrefslogtreecommitdiffstats
path: root/include/svx/sidebar/LinePropertyPanelBase.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-21 15:43:46 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-22 17:55:28 +0100
commiteae55d7397f953ca8a4be1a2665e8ca887adfe81 (patch)
tree47d84a1b81c3a4d7b4719b328cb1241ae80f1a2f /include/svx/sidebar/LinePropertyPanelBase.hxx
parentfix crash in popdown of popovers that contain a user-managed scrolling window (diff)
downloadcore-eae55d7397f953ca8a4be1a2665e8ca887adfe81.tar.gz
core-eae55d7397f953ca8a4be1a2665e8ca887adfe81.zip
rework line style to be a wide toolbar button
involves converting SvxLineStyleToolBoxControl to a PopupWindowController because chart is doing interesting things in its panel there needs to be a non-standard way to report/detect the selected line style, which is then reused to disable/enable the arrows when none is selected/deselected in non-chart sidebars SvxLineBox becomes a toolbar dropdown instead of a combobox itemwindow linectrl.cxx split into linewidthctrl.cxx and linewidthctrl because SvxLineBox is now needed in svxcore Change-Id: Icf0ef5e612b894a43d389af8a2908138c2e9c580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87164 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx/sidebar/LinePropertyPanelBase.hxx')
-rw-r--r--include/svx/sidebar/LinePropertyPanelBase.hxx38
1 files changed, 18 insertions, 20 deletions
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index 1a68126513cc..f8e534ddf1a4 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -45,15 +45,14 @@ namespace svx
namespace sidebar
{
+class DisableArrowsWrapper;
+
class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout
{
public:
virtual ~LinePropertyPanelBase() override;
virtual void dispose() override;
- virtual void DataChanged(
- const DataChangedEvent& rEvent) override;
-
void SetWidth(long nWidth);
void SetWidthIcon(int n);
void SetWidthIcon();
@@ -67,28 +66,28 @@ public:
virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
+ void SetNoneLineStyle(bool bNoneLineStyle)
+ {
+ if (bNoneLineStyle != mbNoneLineStyle)
+ {
+ mbNoneLineStyle = bNoneLineStyle;
+ ActivateControls();
+ }
+ }
+
protected:
- virtual void setLineStyle(const XLineStyleItem& rItem) = 0;
- virtual void setLineDash(const XLineDashItem& rItem) = 0;
- virtual void setLineEndStyle(const XLineEndItem* pItem) = 0;
- virtual void setLineStartStyle(const XLineStartItem* pItem) = 0;
+ void ActivateControls();
+
virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
virtual void setLineJoint(const XLineJointItem* pItem) = 0;
virtual void setLineCap(const XLineCapItem* pItem) = 0;
- void updateLineStyle(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
- void updateLineDash(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
- void FillLineStyleList();
-
- void SelectLineStyle();
- void ActivateControls();
-
void setMapUnit(MapUnit eMapUnit);
void enableArrowHead();
@@ -99,15 +98,15 @@ protected:
std::unique_ptr<weld::Toolbar> mxTBColor;
std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
+ std::unique_ptr<weld::Toolbar> mxLineStyleTB;
+ std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
+
private:
//ui controls
std::unique_ptr<weld::Label> mxFTWidth;
std::unique_ptr<weld::Toolbar> mxTBWidth;
- std::unique_ptr<SvxLineLB> mxLBStyle;
std::unique_ptr<weld::Label> mxFTTransparency;
std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
- std::unique_ptr<weld::Toolbar> mxArrowsTB;
- std::unique_ptr<ToolbarUnoDispatcher> mxArrowsDispatch;
std::unique_ptr<weld::Label> mxFTEdgeStyle;
std::unique_ptr<weld::ComboBox> mxLBEdgeStyle;
std::unique_ptr<weld::Label> mxFTCapStyle;
@@ -117,13 +116,11 @@ private:
//popup windows
std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
- std::unique_ptr<XLineStyleItem> mpStyleItem;
- std::unique_ptr<XLineDashItem> mpDashItem;
+ std::unique_ptr<DisableArrowsWrapper> mxDisableArrowsWrapper;
sal_uInt16 mnTrans;
MapUnit meMapUnit;
sal_Int32 mnWidthCoreValue;
- XDashListRef mxLineStyleList;
// images from resource
OUString maIMGNone;
@@ -133,6 +130,7 @@ private:
bool mbWidthValuable : 1;
bool mbArrowSupported;
+ bool mbNoneLineStyle;
void Initialize();