summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-18 14:31:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-19 16:51:58 +0200
commitd6cee8ad86ded54004f0dc87b390e43b20560390 (patch)
tree0eb55ae4d5c5a69b5f4b82b18e9ee815a5b556d5 /cui
parent65b5fc8f66eb2facaed5d35b61a2836b3390fb01 (diff)
weld GraphicFilterSmooth
Change-Id: I9f92b49bff105965c13e5977ef39788c6684da29 Reviewed-on: https://gerrit.libreoffice.org/60711 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx34
-rw-r--r--cui/source/factory/dlgfact.cxx5
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/inc/cuigrfflt.hxx11
-rw-r--r--cui/uiconfig/ui/smoothdialog.ui30
5 files changed, 41 insertions, 41 deletions
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 0a0c9f718dce..f489112798c4 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -370,42 +370,24 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
return aRet;
}
-
-GraphicFilterSmooth::GraphicFilterSmooth( vcl::Window* pParent, const Graphic& rGraphic, double nRadius)
- : GraphicFilterDialog(pParent, "SmoothDialog",
- "cui/ui/smoothdialog.ui", rGraphic)
+GraphicFilterSmooth::GraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius)
+ : GraphicFilterDialogController(pParent, "cui/ui/smoothdialog.ui", "SmoothDialog", rGraphic)
+ , mxMtrRadius(m_xBuilder->weld_spin_button("radius"))
{
- get(mpMtrRadius, "radius");
-
- mpMtrRadius->SetValue( nRadius* 10 );
- mpMtrRadius->SetModifyHdl( LINK(this, GraphicFilterSmooth, EditModifyHdl) );
- mpMtrRadius->GrabFocus();
+ mxMtrRadius->set_value(nRadius * 10);
+ mxMtrRadius->connect_value_changed(LINK(this, GraphicFilterSmooth, EditModifyHdl));
+ mxMtrRadius->grab_focus();
}
-
-IMPL_LINK_NOARG(GraphicFilterSmooth, EditModifyHdl, Edit&, void)
+IMPL_LINK_NOARG(GraphicFilterSmooth, EditModifyHdl, weld::SpinButton&, void)
{
GetModifyHdl().Call(nullptr);
}
-
-GraphicFilterSmooth::~GraphicFilterSmooth()
-{
- disposeOnce();
-}
-
-
-void GraphicFilterSmooth::dispose()
-{
- mpMtrRadius.clear();
- GraphicFilterDialog::dispose();
-}
-
-
Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double, double )
{
Graphic aRet;
- double nRadius = mpMtrRadius->GetValue() / 10.0;
+ double nRadius = mxMtrRadius->get_value() / 10.0;
if( rGraphic.IsAnimated() )
{
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index d8240ce678e9..c6cc366e97a1 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1297,11 +1297,10 @@ VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFil
return VclPtr<AbstractGraphicFilterDialogController_Impl>::Create(o3tl::make_unique<GraphicFilterSepia>(pParent, rGraphic, 10));
}
-VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(vcl::Window* pParent,
+VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(weld::Window* pParent,
const Graphic& rGraphic, double nRadius)
{
- VclPtrInstance<GraphicFilterSmooth> pDlg( pParent, rGraphic, nRadius );
- return VclPtr<AbstractGraphicFilterDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractGraphicFilterDialogController_Impl>::Create(o3tl::make_unique<GraphicFilterSmooth>(pParent, rGraphic, nRadius));
}
VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSolarize(weld::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 753b12bd150d..59b9dd574de8 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -759,7 +759,7 @@ public:
const Graphic& rGraphic) override;
virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSepia(weld::Window* pParent,
const Graphic& rGraphic) override;
- virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSmooth (vcl::Window* pParent,
+ virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSmooth(weld::Window* pParent,
const Graphic& rGraphic, double nRadius) override;
virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSolarize(weld::Window* pParent,
const Graphic& rGraphic) override;
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index c202a189a95c..48ee3f3b25de 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -151,18 +151,15 @@ public:
virtual Graphic GetFilteredGraphic(const Graphic& rGraphic, double fScaleX, double fScaleY) = 0;
};
-class GraphicFilterSmooth : public GraphicFilterDialog
+class GraphicFilterSmooth : public GraphicFilterDialogController
{
private:
- VclPtr<NumericField> mpMtrRadius;
- DECL_LINK(EditModifyHdl, Edit&, void);
+ std::unique_ptr<weld::SpinButton> mxMtrRadius;
+ DECL_LINK(EditModifyHdl, weld::SpinButton&, void);
public:
- GraphicFilterSmooth( vcl::Window* pParent, const Graphic& rGraphic, double nRadius);
- virtual ~GraphicFilterSmooth() override;
- virtual void dispose() override;
-
+ GraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius);
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override;
};
diff --git a/cui/uiconfig/ui/smoothdialog.ui b/cui/uiconfig/ui/smoothdialog.ui
index 50eef4351c08..c96e76821ddf 100644
--- a/cui/uiconfig/ui/smoothdialog.ui
+++ b/cui/uiconfig/ui/smoothdialog.ui
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">0.10000000000000001</property>
<property name="upper">100</property>
@@ -15,7 +14,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="smoothdialog|SmoothDialog">Smooth</property>
<property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -102,11 +107,28 @@
<property name="vexpand">True</property>
<property name="column_spacing">24</property>
<child>
- <object class="cuilo-GraphicPreviewWindow" id="preview">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="preview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -134,10 +156,10 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="smoothdialog|label2">_Smooth radius:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">radius</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>