[Libreoffice-commits] core.git: include/svx svx/inc svx/source svx/uiconfig svx/UIConfig_svx.mk

Caolán McNamara caolanm at redhat.com
Mon Dec 16 07:54:51 PST 2013


 include/svx/fontworkgallery.hxx          |    7 -
 svx/UIConfig_svx.mk                      |    3 
 svx/inc/fontworkgallery.hrc              |    2 
 svx/source/tbxctrls/fontworkgallery.cxx  |   21 +----
 svx/source/tbxctrls/fontworkgallery.src  |   54 --------------
 svx/uiconfig/ui/fontworkspacingdialog.ui |  112 +++++++++++++++++++++++++++++++
 6 files changed, 119 insertions(+), 80 deletions(-)

New commits:
commit fc946896bae5091b539db8929706dd3971129139
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 16 15:51:40 2013 +0000

    convert fontwork spacing dialog to .ui
    
    Change-Id: I0cf7fb84974741a162addb6c1fc393d3328f21cb

diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx
index 3e1f7bf..1105bd6 100644
--- a/include/svx/fontworkgallery.hxx
+++ b/include/svx/fontworkgallery.hxx
@@ -66,15 +66,10 @@ public:
 
 class FontworkCharacterSpacingDialog : public ModalDialog
 {
-    FixedText           maFLScale;
-    MetricField         maMtrScale;
-    OKButton            maOKButton;
-    CancelButton        maCancelButton;
-    HelpButton          maHelpButton;
+    MetricField* m_pMtrScale;
 
 public:
     FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale );
-    ~FontworkCharacterSpacingDialog();
 
     sal_Int32 getScale() const;
 };
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index a031a2d..004cae2 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -19,8 +19,9 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/deleteheaderdialog \
 	svx/uiconfig/ui/deletefooterdialog \
 	svx/uiconfig/ui/extrustiondepthdialog \
-	svx/uiconfig/ui/headfootformatpage \
 	svx/uiconfig/ui/findreplacedialog \
+	svx/uiconfig/ui/fontworkspacingdialog \
+	svx/uiconfig/ui/headfootformatpage \
 	svx/uiconfig/ui/linkwarndialog \
 	svx/uiconfig/ui/optgridpage \
 	svx/uiconfig/ui/passwd \
diff --git a/svx/inc/fontworkgallery.hrc b/svx/inc/fontworkgallery.hrc
index de2665d..4946a8c 100644
--- a/svx/inc/fontworkgallery.hrc
+++ b/svx/inc/fontworkgallery.hrc
@@ -22,8 +22,6 @@
 #define CTL_FAVORITES   2
 #define BTN_OK          3
 #define BTN_CANCEL      4
-#define MF_VALUE        7
-#define FT_VALUE        8
 #define BTN_HELP        9
 
 #define STR_CLICK_TO_ADD_TEXT   1
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index db5131b..db81609 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -726,29 +726,16 @@ Sequence< OUString > SAL_CALL FontworkCharacterSpacingControl::getSupportedServi
     return FontworkCharacterSpacingControl_getSupportedServiceNames();
 }
 
-// ========================================================================
-// FontworkCharacterSpacingDialog
-// ========================================================================
-
 FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale )
-:   ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_CHARSPACING ) ),
-    maFLScale( this, SVX_RES( FT_VALUE ) ),
-    maMtrScale( this, SVX_RES( MF_VALUE ) ),
-    maOKButton( this, SVX_RES( BTN_OK ) ),
-    maCancelButton( this, SVX_RES( BTN_CANCEL ) ),
-    maHelpButton( this, SVX_RES( BTN_HELP ) )
-{
-    maMtrScale.SetValue( nScale );
-    FreeResource();
-}
-
-FontworkCharacterSpacingDialog::~FontworkCharacterSpacingDialog()
+:   ModalDialog( pParent, "FontworkSpacingDialog" , "svx/ui/fontworkspacingdialog.ui" )
 {
+    get(m_pMtrScale, "entry");
+    m_pMtrScale->SetValue( nScale );
 }
 
 sal_Int32 FontworkCharacterSpacingDialog::getScale() const
 {
-    return (sal_Int32)maMtrScale.GetValue();
+    return (sal_Int32)m_pMtrScale->GetValue();
 }
 
 }
diff --git a/svx/source/tbxctrls/fontworkgallery.src b/svx/source/tbxctrls/fontworkgallery.src
index 2e5f179..9e049a9 100644
--- a/svx/source/tbxctrls/fontworkgallery.src
+++ b/svx/source/tbxctrls/fontworkgallery.src
@@ -214,58 +214,4 @@ DockingWindow RID_SVXFLOAT_FONTWORK_CHARSPACING
     };
 };
 
-ModalDialog RID_SVX_MDLG_FONTWORK_CHARSPACING
-{
-    HelpID = "svx:ModalDialog:RID_SVX_MDLG_FONTWORK_CHARSPACING";
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 139 , 64 ) ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-
-    Text [ en-US ] = "Fontwork Character Spacing" ;
-
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 83 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 83 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 83 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText FT_VALUE
-    {
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 76 , 8 ) ;
-        Text[ en-US ] = "~Value";
-    };
-    MetricField MF_VALUE
-    {
-        HelpID = "svx:MetricField:RID_SVX_MDLG_FONTWORK_CHARSPACING:MF_VALUE";
-        Border = FALSE ;
-        Pos = MAP_APPFONT ( 6 , 17 ) ;
-        Size = MAP_APPFONT ( 32 , 12 ) ;
-        TabStop = TRUE ;
-        Repeat = TRUE ;
-        Spin = TRUE ;
-        Maximum = 500 ;
-        StrictFormat = TRUE ;
-        Unit = FUNIT_CUSTOM ;
-        CustomUnitText = "%" ;
-        Last = 100 ;
-        SpinSize = 5 ;
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/fontworkspacingdialog.ui b/svx/uiconfig/ui/fontworkspacingdialog.ui
new file mode 100644
index 0000000..58ab125
--- /dev/null
+++ b/svx/uiconfig/ui/fontworkspacingdialog.ui
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">500</property>
+    <property name="value">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkDialog" id="FontworkSpacingDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Fontwork Character Spacing</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="valign">start</property>
+            <property name="hexpand">True</property>
+            <property name="spacing">12</property>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">_Value</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">entry:0%</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSpinButton" id="entry:0%">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">●</property>
+                <property name="adjustment">adjustment1</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list