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

Caolán McNamara caolanm at redhat.com
Mon Sep 9 03:59:30 PDT 2013


 cui/uiconfig/ui/charnamepage.ui     |    1 
 cui/uiconfig/ui/effectspage.ui      |    1 
 cui/uiconfig/ui/positionpage.ui     |    1 
 cui/uiconfig/ui/textanimtabpage.ui  |   73 ++++++++++++++++++------------------
 cui/uiconfig/ui/textattrtabpage.ui  |    5 +-
 cui/uiconfig/ui/twolinespage.ui     |    1 
 include/sfx2/dialoghelper.hxx       |    2 
 include/svx/dlgctrl.hxx             |    1 
 include/svx/fntctrl.hxx             |    2 
 include/svx/measctrl.hxx            |    1 
 sfx2/source/dialog/dialoghelper.cxx |    5 ++
 svx/source/dialog/dlgctrl.cxx       |    9 +++-
 svx/source/dialog/fntctrl.cxx       |    5 --
 svx/source/dialog/measctrl.cxx      |    8 ++-
 14 files changed, 64 insertions(+), 51 deletions(-)

New commits:
commit 7560f765b32bf9969b89b28c6733faa8098f1809
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 9 11:58:29 2013 +0100

    unify strip previews optimal size in one place
    
    Change-Id: I6ae1073d013c9d9bbca39c505955436cd4950d1b

diff --git a/cui/uiconfig/ui/charnamepage.ui b/cui/uiconfig/ui/charnamepage.ui
index d89402d..25c67f1 100644
--- a/cui/uiconfig/ui/charnamepage.ui
+++ b/cui/uiconfig/ui/charnamepage.ui
@@ -748,7 +748,6 @@
         <property name="right_padding">12</property>
         <child>
           <object class="svxlo-SvxFontPrevWindow" id="preview:border">
-            <property name="height_request">100</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child internal-child="accessible">
diff --git a/cui/uiconfig/ui/effectspage.ui b/cui/uiconfig/ui/effectspage.ui
index 592984f..12676c2 100644
--- a/cui/uiconfig/ui/effectspage.ui
+++ b/cui/uiconfig/ui/effectspage.ui
@@ -646,7 +646,6 @@
         <property name="right_padding">12</property>
         <child>
           <object class="svxlo-SvxFontPrevWindow" id="preview:border">
-            <property name="height_request">100</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child internal-child="accessible">
diff --git a/cui/uiconfig/ui/positionpage.ui b/cui/uiconfig/ui/positionpage.ui
index 20927c8..c44bee6 100644
--- a/cui/uiconfig/ui/positionpage.ui
+++ b/cui/uiconfig/ui/positionpage.ui
@@ -516,7 +516,6 @@
         <property name="right_padding">12</property>
         <child>
           <object class="svxlo-SvxFontPrevWindow" id="preview:border">
-            <property name="height_request">100</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="hexpand">True</property>
diff --git a/cui/uiconfig/ui/textanimtabpage.ui b/cui/uiconfig/ui/textanimtabpage.ui
index dc74c15..8f0c9f9 100644
--- a/cui/uiconfig/ui/textanimtabpage.ui
+++ b/cui/uiconfig/ui/textanimtabpage.ui
@@ -1,6 +1,41 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkAdjustment" id="adjustmentAMOUNT">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustmentCOUNT">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustmentDELAY">
+    <property name="upper">300</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">50</property>
+  </object>
+  <object class="GtkImage" id="imageDOWN">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-go-down</property>
+  </object>
+  <object class="GtkImage" id="imageLEFT">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-go-back</property>
+  </object>
+  <object class="GtkImage" id="imageRIGHT">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-go-forward</property>
+  </object>
+  <object class="GtkImage" id="imageUP">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-go-up</property>
+  </object>
   <object class="GtkBox" id="TextAnimation">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -25,6 +60,7 @@
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
                 <property name="spacing">18</property>
+                <property name="homogeneous">True</property>
                 <child>
                   <object class="GtkBox" id="box1">
                     <property name="visible">True</property>
@@ -68,7 +104,7 @@
                   <object class="GtkBox" id="boxDIRECTION">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="halign">end</property>
+                    <property name="halign">start</property>
                     <property name="hexpand">True</property>
                     <property name="spacing">12</property>
                     <child>
@@ -505,41 +541,6 @@
       </packing>
     </child>
   </object>
-  <object class="GtkAdjustment" id="adjustmentAMOUNT">
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustmentCOUNT">
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustmentDELAY">
-    <property name="upper">300</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">50</property>
-  </object>
-  <object class="GtkImage" id="imageDOWN">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-go-down</property>
-  </object>
-  <object class="GtkImage" id="imageLEFT">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-go-back</property>
-  </object>
-  <object class="GtkImage" id="imageRIGHT">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-go-forward</property>
-  </object>
-  <object class="GtkImage" id="imageUP">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-go-up</property>
-  </object>
   <object class="GtkListStore" id="liststoreEFFECT">
     <columns>
       <!-- column-name gchararray1 -->
diff --git a/cui/uiconfig/ui/textattrtabpage.ui b/cui/uiconfig/ui/textattrtabpage.ui
index da272cf..b5a18ec 100644
--- a/cui/uiconfig/ui/textattrtabpage.ui
+++ b/cui/uiconfig/ui/textattrtabpage.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires LibreOffice 1.0 -->
   <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">-100</property>
     <property name="upper">100</property>
@@ -364,7 +364,8 @@
                       <object class="svxlo-SvxRectCtl" id="CTL_POSITION">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="vexpand">True</property>
+                        <property name="halign">start</property>
+                        <property name="valign">center</property>
                       </object>
                       <packing>
                         <property name="expand">True</property>
diff --git a/cui/uiconfig/ui/twolinespage.ui b/cui/uiconfig/ui/twolinespage.ui
index c931b90..232062c 100644
--- a/cui/uiconfig/ui/twolinespage.ui
+++ b/cui/uiconfig/ui/twolinespage.ui
@@ -226,7 +226,6 @@
         <property name="right_padding">12</property>
         <child>
           <object class="svxlo-SvxFontPrevWindow" id="preview:border">
-            <property name="height_request">100</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child internal-child="accessible">
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
index d31a094..5b09eb5 100644
--- a/include/sfx2/dialoghelper.hxx
+++ b/include/sfx2/dialoghelper.hxx
@@ -34,6 +34,8 @@ Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const Window *pReference);
 
 Size SFX2_DLLPUBLIC getDrawListBoxOptimalSize(const Window *pReference);
 
+Size SFX2_DLLPUBLIC getPreviewStripSize(const Window *pReference);
+
 OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper);
 
 OUString SFX2_DLLPUBLIC formatTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper);
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index c34d154..64b92ae 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -397,6 +397,7 @@ public:
 
     virtual void Paint( const Rectangle& rRect );
     virtual void Resize();
+    virtual Size GetOptimalSize() const;
 };
 
 /*************************************************************************
diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx
index 93edc0d..f4c6262 100644
--- a/include/svx/fntctrl.hxx
+++ b/include/svx/fntctrl.hxx
@@ -45,8 +45,6 @@ private:
     SVX_DLLPRIVATE void SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
     SVX_DLLPRIVATE void SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
 
-    Size m_aInitialSize;
-
 public:
                         SvxFontPrevWindow( Window* pParent, const ResId& rId );
                         SvxFontPrevWindow(Window* pParent, WinBits nStyle);
diff --git a/include/svx/measctrl.hxx b/include/svx/measctrl.hxx
index f17190a..fde082f 100644
--- a/include/svx/measctrl.hxx
+++ b/include/svx/measctrl.hxx
@@ -48,6 +48,7 @@ public:
     virtual void Paint(const Rectangle& rRect);
     virtual void Resize();
     virtual void MouseButtonDown( const MouseEvent& rMEvt );
+    virtual Size GetOptimalSize() const;
 
     void         SetAttributes( const SfxItemSet& rInAttrs );
 
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index c3440e6..cd80500 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -67,6 +67,11 @@ Size getDrawListBoxOptimalSize(const Window *pReference)
     return pReference->LogicToPixel(Size(88, 110), MAP_APPFONT);
 }
 
+Size SFX2_DLLPUBLIC getPreviewStripSize(const Window *pReference)
+{
+    return pReference->LogicToPixel(Size(70 , 40), MapMode(MAP_APPFONT));
+}
+
 OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper)
 {
     Date aDate(22, 12, 2000);
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index d730ea9..14bf9cb 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -20,7 +20,7 @@
 #include <tools/shl.hxx>
 #include <vcl/builder.hxx>
 #include <vcl/svapp.hxx>
-
+#include <sfx2/dialoghelper.hxx>
 #include <svx/xtable.hxx>
 #include <svx/xpool.hxx>
 #include <svx/dialogs.hrc>
@@ -107,7 +107,7 @@ void SvxRectCtl::SetControlSettings(RECT_POINT eRpt, sal_uInt16 nBorder, sal_uIn
 
 Size SvxRectCtl::GetOptimalSize() const
 {
-    return LogicToPixel(Size(39, 39), MAP_APPFONT);
+    return LogicToPixel(Size(78, 39), MAP_APPFONT);
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxRectCtl(Window *pParent, VclBuilder::stringmap &)
@@ -1838,6 +1838,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXLinePreview(Window *pPa
     return new SvxXLinePreview(pParent);
 }
 
+Size SvxXLinePreview::GetOptimalSize() const
+{
+    return getPreviewStripSize(this);
+}
+
 SvxXLinePreview::~SvxXLinePreview()
 {
     SdrObject *pFoo = mpLineObjA;
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 04d175b..fc0e096 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sfx2/dialoghelper.hxx>
 #include <sfx2/viewsh.hxx>      // SfxViewShell
 #include <sfx2/printer.hxx>     // Printer
 #include <vcl/builder.hxx>
@@ -502,14 +503,12 @@ void SvxFontPrevWindow::Init()
 SvxFontPrevWindow::SvxFontPrevWindow( Window* pParent, const ResId& rId ) :
     Window( pParent, rId )
 {
-    m_aInitialSize = GetSizePixel();
     Init();
 }
 
 SvxFontPrevWindow::SvxFontPrevWindow(Window* pParent, WinBits nStyle)
     : Window(pParent, nStyle)
 {
-    m_aInitialSize = LogicToPixel(Size(70 , 27), MapMode(MAP_APPFONT));
     Init();
 }
 
@@ -1499,7 +1498,7 @@ void SvxFontPrevWindow::SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp,
 
 Size SvxFontPrevWindow::GetOptimalSize() const
 {
-    return m_aInitialSize;
+    return getPreviewStripSize(this);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index 646decb..1a630ee 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -17,13 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sfx2/dialoghelper.hxx>
 #include <svx/svdomeas.hxx>
 #include <svx/svdmodel.hxx>
-#include <vcl/builder.hxx>
-
 #include "svx/measctrl.hxx"
 #include <svx/dialmgr.hxx>
 #include "svx/dlgutil.hxx"
+#include <vcl/builder.hxx>
 
 SvxXMeasurePreview::SvxXMeasurePreview( Window* pParent,const ResId& rResId,const SfxItemSet& rInAttrs)
 :    Control ( pParent, rResId )
@@ -98,6 +98,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXMeasurePreview(Window *
     return new SvxXMeasurePreview(pParent, nWinStyle);
 }
 
+Size SvxXMeasurePreview::GetOptimalSize() const
+{
+    return getPreviewStripSize(this);
+}
 
 SvxXMeasurePreview::~SvxXMeasurePreview()
 {


More information about the Libreoffice-commits mailing list