summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-06 09:51:42 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-08 09:50:52 +0100
commit4f6d95ead1286748810e937c7672de08b8b39a38 (patch)
tree1851e9d75d59850570f32bdf2eee4a54825c61f6 /include
parent95945a601b7b3310ba3a891f374cfb2cabe49226 (diff)
weld LinePropertyPanel
Change-Id: If4ff18c3d312d273e9d28aeef97db053f56007ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86309 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/sidebar/LinePropertyPanelBase.hxx70
-rw-r--r--include/svx/sidebar/LineWidthPopup.hxx33
2 files changed, 50 insertions, 53 deletions
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index e114d7b8e9b3..c91c2dd136b6 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -19,17 +19,16 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <memory>
#include <svl/poolitem.hxx>
+#include <svx/dlgctrl.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <svx/xtable.hxx>
#include <svx/sidebar/LineWidthPopup.hxx>
#include <svx/svxdllapi.h>
-
+class ToolbarUnoDispatcher;
class XLineStyleItem;
class XLineDashItem;
class XLineStartItem;
@@ -40,15 +39,6 @@ class XLineJointItem;
class XLineCapItem;
class XLineTransparenceItem;
class XDashList;
-class ListBox;
-class ToolBox;
-class FloatingWindow;
-
-namespace sfx2 { namespace sidebar {
-
-class SidebarToolBox;
-
-} }
namespace svx
{
@@ -68,6 +58,8 @@ public:
void SetWidthIcon(int n);
void SetWidthIcon();
+ void EndLineWidthPopup();
+
// constructor/destructor
LinePropertyPanelBase(
vcl::Window* pParent,
@@ -108,23 +100,26 @@ protected:
protected:
- VclPtr<sfx2::sidebar::SidebarToolBox> mpTBColor;
+ std::unique_ptr<weld::Toolbar> mxTBColor;
+ std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
private:
//ui controls
- VclPtr<FixedText> mpFTWidth;
- VclPtr<ToolBox> mpTBWidth;
- VclPtr<ListBox> mpLBStyle;
- VclPtr<FixedText> mpFTTransparency;
- VclPtr<MetricField> mpMFTransparent;
- VclPtr<ListBox> mpLBStart;
- VclPtr<ListBox> mpLBEnd;
- VclPtr<FixedText> mpFTEdgeStyle;
- VclPtr<ListBox> mpLBEdgeStyle;
- VclPtr<FixedText> mpFTCapStyle;
- VclPtr<ListBox> mpLBCapStyle;
- VclPtr<VclGrid> mpGridLineProps;
- VclPtr<VclVBox> mpBoxArrowProps;
+ 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<SvxLineEndLB> mxLBStart;
+ std::unique_ptr<SvxLineEndLB> mxLBEnd;
+ std::unique_ptr<weld::Label> mxFTEdgeStyle;
+ std::unique_ptr<weld::ComboBox> mxLBEdgeStyle;
+ std::unique_ptr<weld::Label> mxFTCapStyle;
+ std::unique_ptr<weld::ComboBox> mxLBCapStyle;
+ std::unique_ptr<weld::Widget> mxGridLineProps;
+ std::unique_ptr<weld::Widget> mxBoxArrowProps;
+ //popup windows
+ std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
std::unique_ptr<XLineStyleItem> mpStyleItem;
std::unique_ptr<XLineDashItem> mpDashItem;
@@ -137,27 +132,24 @@ private:
std::unique_ptr<XLineStartItem> mpStartItem;
std::unique_ptr<XLineEndItem> mpEndItem;
- //popup windows
- VclPtr<LineWidthPopup> mxLineWidthPopup;
-
// images from resource
- Image const maIMGNone;
+ OUString maIMGNone;
// multi-images
- std::unique_ptr<Image[]> mpIMGWidthIcon;
+ OUString maIMGWidthIcon[8];
bool mbWidthValuable : 1;
bool mbArrowSupported;
void Initialize();
- DECL_LINK(ChangeLineStyleHdl, ListBox&, void);
- DECL_LINK(ToolboxWidthSelectHdl, ToolBox*, void);
- DECL_LINK(ChangeTransparentHdl, Edit&, void );
- DECL_LINK(ChangeStartHdl, ListBox&, void);
- DECL_LINK(ChangeEndHdl, ListBox&, void);
- DECL_LINK(ChangeEdgeStyleHdl, ListBox&, void);
- DECL_LINK(ChangeCapStyleHdl, ListBox&, void);
+ DECL_LINK(ChangeLineStyleHdl, weld::ComboBox&, void);
+ DECL_LINK(ToolboxWidthSelectHdl, const OString&, void);
+ DECL_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void );
+ DECL_LINK(ChangeStartHdl, weld::ComboBox&, void);
+ DECL_LINK(ChangeEndHdl, weld::ComboBox&, void);
+ DECL_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void);
+ DECL_LINK(ChangeCapStyleHdl, weld::ComboBox&, void);
};
} } // end of namespace svx::sidebar
diff --git a/include/svx/sidebar/LineWidthPopup.hxx b/include/svx/sidebar/LineWidthPopup.hxx
index fd36e5ea92a6..ce19baf92eb0 100644
--- a/include/svx/sidebar/LineWidthPopup.hxx
+++ b/include/svx/sidebar/LineWidthPopup.hxx
@@ -19,28 +19,29 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX
-#include <vcl/floatwin.hxx>
-#include <vcl/layout.hxx>
+#include <tools/mapunit.hxx>
+#include <vcl/customweld.hxx>
+#include <vcl/image.hxx>
+#include <vcl/weld.hxx>
#include <array>
-class Edit;
-class MetricField;
-class ValueSet;
+class SvtValueSet;
namespace svx { namespace sidebar {
class LinePropertyPanelBase;
class LineWidthValueSet;
-class LineWidthPopup final : public FloatingWindow
+class LineWidthPopup final
{
public:
- LineWidthPopup(LinePropertyPanelBase& rParent);
- virtual void dispose() override;
- virtual ~LineWidthPopup() override;
+ LineWidthPopup(weld::Widget* pParent, LinePropertyPanelBase& rParent);
+ ~LineWidthPopup();
void SetWidthSelect (long lValue, bool bValuable, MapUnit eMapUnit);
+ weld::Container* getTopLevel() const { return m_xTopLevel.get(); }
+
private:
LinePropertyPanelBase& m_rParent;
std::array<OUString,9> maStrUnits;
@@ -49,14 +50,18 @@ private:
bool m_bVSFocus;
bool m_bCustom;
long m_nCustomWidth;
- VclPtr<MetricField> m_xMFWidth;
- VclPtr<VclContainer> m_xBox;
- VclPtr<LineWidthValueSet> m_xVSWidth;
Image const m_aIMGCus;
Image const m_aIMGCusGray;
- DECL_LINK(VSSelectHdl, ValueSet*, void);
- DECL_LINK(MFModifyHdl, Edit&, void);
+ std::unique_ptr<weld::Builder> m_xBuilder;
+ std::unique_ptr<weld::Container> m_xTopLevel;
+ std::unique_ptr<weld::MetricSpinButton> m_xMFWidth;
+ std::unique_ptr<LineWidthValueSet> m_xVSWidth;
+ std::unique_ptr<weld::CustomWeld> m_xVSWidthWin;
+
+ DECL_LINK(VSSelectHdl, SvtValueSet*, void);
+ DECL_LINK(MFModifyHdl, weld::MetricSpinButton&, void);
+ DECL_LINK(FocusHdl, weld::Widget&, void);
};
} } // end of namespace svx::sidebar