[Libreoffice-commits] core.git: cui/source cui/uiconfig include/svx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 19 14:51:16 UTC 2018


 cui/source/dialogs/cuigrfflt.cxx |   30 ++++++++----------------------
 cui/source/factory/dlgfact.cxx   |    5 ++---
 cui/source/factory/dlgfact.hxx   |    2 +-
 cui/source/inc/cuigrfflt.hxx     |   12 +++++-------
 cui/uiconfig/ui/agingdialog.ui   |   33 ++++++++++++++++++++++++++++-----
 include/svx/svxdlg.hxx           |    2 +-
 6 files changed, 45 insertions(+), 39 deletions(-)

New commits:
commit b5f67308c6d19fd8bce1515312fb3fcd0eb28af4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 18 13:43:46 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 19 16:50:50 2018 +0200

    weld GraphicFilterSepia
    
    Change-Id: Id57f29f4694a8aaa395f5f166744d06e4adfb492
    Reviewed-on: https://gerrit.libreoffice.org/60708
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index c8268ac38f02..3fd751a953cf 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -505,38 +505,24 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
     return aRet;
 }
 
-GraphicFilterSepia::GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGraphic,
-                                        sal_uInt16 nSepiaPercent )
-    : GraphicFilterDialog(pParent, "AgingDialog",
-        "cui/ui/agingdialog.ui", rGraphic)
+GraphicFilterSepia::GraphicFilterSepia(weld::Window* pParent, const Graphic& rGraphic,
+                                       sal_uInt16 nSepiaPercent)
+    : GraphicFilterDialogController(pParent, "cui/ui/agingdialog.ui", "AgingDialog", rGraphic)
+    , mxMtrSepia(m_xBuilder->weld_metric_spin_button("value", FUNIT_PERCENT))
 {
-    get(mpMtrSepia, "value");
-
-    mpMtrSepia->SetValue( nSepiaPercent );
-    mpMtrSepia->SetModifyHdl( LINK(this, GraphicFilterSepia, EditModifyHdl) );
+    mxMtrSepia->set_value(nSepiaPercent, FUNIT_PERCENT);
+    mxMtrSepia->connect_value_changed(LINK(this, GraphicFilterSepia, EditModifyHdl));
 }
 
-IMPL_LINK_NOARG(GraphicFilterSepia, EditModifyHdl, Edit&, void)
+IMPL_LINK_NOARG(GraphicFilterSepia, EditModifyHdl, weld::MetricSpinButton&, void)
 {
     GetModifyHdl().Call(nullptr);
 }
 
-GraphicFilterSepia::~GraphicFilterSepia()
-{
-    disposeOnce();
-}
-
-void GraphicFilterSepia::dispose()
-{
-    mpMtrSepia.clear();
-    GraphicFilterDialog::dispose();
-}
-
-
 Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double, double )
 {
     Graphic         aRet;
-    sal_uInt16      nSepiaPct = sal::static_int_cast< sal_uInt16 >(mpMtrSepia->GetValue());
+    sal_uInt16      nSepiaPct = sal::static_int_cast< sal_uInt16 >(mxMtrSepia->get_value(FUNIT_PERCENT));
 
     if( rGraphic.IsAnimated() )
     {
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 0534e2e006f8..40863a65d543 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1292,11 +1292,10 @@ VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFil
     return VclPtr<AbstractGraphicFilterDialog_Impl>::Create( pDlg );
 }
 
-VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSepia (vcl::Window* pParent,
+VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSepia(weld::Window* pParent,
                                             const Graphic& rGraphic)
 {
-    VclPtrInstance<GraphicFilterSepia> pDlg( pParent, rGraphic, 10 );
-    return VclPtr<AbstractGraphicFilterDialog_Impl>::Create( pDlg );
+    return VclPtr<AbstractGraphicFilterDialogController_Impl>::Create(o3tl::make_unique<GraphicFilterSepia>(pParent, rGraphic, 10));
 }
 
 VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 968685e8994c..ec2a4285182e 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -757,7 +757,7 @@ public:
                                                 const Graphic& rGraphic) override;
     virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterPoster(vcl::Window* pParent,
                                                 const Graphic& rGraphic) override;
-    virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterSepia (vcl::Window* pParent,
+    virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterSepia(weld::Window* pParent,
                                                 const Graphic& rGraphic) override;
     virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterSmooth (vcl::Window* pParent,
                                                 const Graphic& rGraphic, double nRadius) override;
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 1d369d560fcd..9ff9c2b6a29a 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -199,16 +199,14 @@ public:
     bool            IsInvert() const { return mxCbxInvert->get_active(); }
 };
 
-class GraphicFilterSepia : public GraphicFilterDialog
+class GraphicFilterSepia : public GraphicFilterDialogController
 {
 private:
-    VclPtr<MetricField>    mpMtrSepia;
-    DECL_LINK(EditModifyHdl, Edit&, void);
+    std::unique_ptr<weld::MetricSpinButton> mxMtrSepia;
+    DECL_LINK(EditModifyHdl, weld::MetricSpinButton&, void);
 public:
-    GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGraphic,
-                        sal_uInt16 nSepiaPercent );
-    virtual ~GraphicFilterSepia() override;
-    virtual void dispose() override;
+    GraphicFilterSepia(weld::Window* pParent, const Graphic& rGraphic,
+                       sal_uInt16 nSepiaPercent);
     virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override;
 };
 
diff --git a/cui/uiconfig/ui/agingdialog.ui b/cui/uiconfig/ui/agingdialog.ui
index dd6c2d720fe2..8ed9f0912e5f 100644
--- a/cui/uiconfig/ui/agingdialog.ui
+++ b/cui/uiconfig/ui/agingdialog.ui
@@ -1,5 +1,5 @@
 <?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"/>
@@ -15,7 +15,13 @@
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="agingdialog|AgingDialog">Aging</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 +108,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>
@@ -119,7 +142,7 @@
                         <property name="can_focus">False</property>
                         <property name="row_spacing">6</property>
                         <child>
-                          <object class="GtkSpinButton" id="value:%">
+                          <object class="GtkSpinButton" id="value">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="adjustment">adjustment1</property>
@@ -133,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="agingdialog|label2">Aging degree:</property>
                             <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">value:%</property>
+                            <property name="mnemonic_widget">value</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 81e4fd933543..2fe3ff8c1ddf 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -416,7 +416,7 @@ public:
                                                 const Graphic& rGraphic)=0;
     virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterPoster(vcl::Window* pParent,
                                                 const Graphic& rGraphic)=0;
-    virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterSepia (vcl::Window* pParent,
+    virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterSepia(weld::Window* pParent,
                                                 const Graphic& rGraphic)=0;
     virtual VclPtr<AbstractGraphicFilterDialog>   CreateGraphicFilterSmooth (vcl::Window* pParent,
                                                 const Graphic& rGraphic,


More information about the Libreoffice-commits mailing list