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

Caolán McNamara caolanm at redhat.com
Fri Jul 26 09:12:16 PDT 2013


 cui/source/tabpages/backgrnd.cxx    |    5 +++--
 cui/source/tabpages/tpgradnt.cxx    |    4 ++--
 cui/source/tabpages/tphatch.cxx     |    8 ++++----
 cui/uiconfig/ui/shadowtabpage.ui    |   24 +++++++++---------------
 include/sfx2/dialoghelper.hxx       |    4 ++++
 include/svx/dlgctrl.hxx             |    1 +
 sfx2/source/dialog/dialoghelper.cxx |   10 ++++++++++
 svx/source/dialog/dlgctrl.cxx       |    4 ++++
 8 files changed, 37 insertions(+), 23 deletions(-)

New commits:
commit 902276557566bbcbcef7e8de4d119196fdcfa345
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 26 17:09:20 2013 +0100

    stash rather arbitrary widget sizes in one place
    
    Change-Id: I26cc3185d6abbce516f7c7d9243962b873587859

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index ea37ea5..2b80d10 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -21,6 +21,7 @@
 #include <vcl/builder.hxx>
 #include <vcl/msgbox.hxx>
 #include <tools/urlobj.hxx>
+#include <sfx2/dialoghelper.hxx>
 #include <sfx2/objsh.hxx>
 #include <sfx2/docfile.hxx>
 #include <svl/cntwall.hxx>
@@ -370,11 +371,11 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(Window* pParent, const SfxItemSet& rC
     // Initialize gradient controls
     get(m_pBackGroundGradientFrame, "backgroundgradientframe");
     get(m_pLbGradients, "gradientslb");
-    Size aSize = LogicToPixel(Size(88, 110), MAP_APPFONT);
+    Size aSize = getDrawListBoxOptimalSize(this);
     m_pLbGradients->set_width_request(aSize.Width());
     m_pLbGradients->set_height_request(aSize.Height());
     get(m_pCtlPreview, "previewctl");
-    aSize = LogicToPixel(Size(88, 42), MAP_APPFONT);
+    aSize = getDrawPreviewOptimalSize(this);
     m_pCtlPreview->set_width_request(aSize.Width());
     m_pCtlPreview->set_height_request(aSize.Height());
 
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index fc3e04b..31bb345 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -78,11 +78,11 @@ SvxGradientTabPage::SvxGradientTabPage
     get(m_pLbColorTo,      "colortolb");
     get(m_pMtrColorTo,     "colortomtr");
     get(m_pLbGradients,    "gradientslb");
-    Size aSize = LogicToPixel(Size(88, 110), MAP_APPFONT);
+    Size aSize = getDrawListBoxOptimalSize(this);
     m_pLbGradients->set_width_request(aSize.Width());
     m_pLbGradients->set_height_request(aSize.Height());
     get(m_pCtlPreview,     "previewctl");
-    aSize = LogicToPixel(Size(88, 42), MAP_APPFONT);
+    aSize = getDrawPreviewOptimalSize(this);
     m_pCtlPreview->set_width_request(aSize.Width());
     m_pCtlPreview->set_height_request(aSize.Height());
     get(m_pBtnAdd,         "add");
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 2305c65..b429820 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -72,16 +72,16 @@ SvxHatchTabPage::SvxHatchTabPage
     get(m_pMtrAngle, "anglemtr");
     get(m_pCtlAngle, "anglectl");
     m_pCtlAngle->SetCS(CS_ANGLE);
-    Size aSize = LogicToPixel(Size(39, 39), MAP_APPFONT);
-    m_pCtlAngle->set_width_request(aSize.Width());
-    m_pCtlAngle->set_height_request(aSize.Height());
     get(m_pLbLineType, "linetypelb");
     get(m_pLbLineColor, "linecolorlb");
     get(m_pLbHatchings, "hatchingslb");
-    aSize = LogicToPixel(Size(88, 110), MAP_APPFONT);
+    Size aSize = getDrawListBoxOptimalSize(this);
     m_pLbHatchings->set_width_request(aSize.Width());
     m_pLbHatchings->set_height_request(aSize.Height());
     get(m_pCtlPreview, "previewctl");
+    aSize = getDrawPreviewOptimalSize(this);
+    m_pCtlPreview->set_width_request(aSize.Width());
+    m_pCtlPreview->set_height_request(aSize.Height());
     get(m_pBtnAdd, "add");
     get(m_pBtnModify, "modify");
     get(m_pBtnDelete, "delete");
diff --git a/cui/uiconfig/ui/shadowtabpage.ui b/cui/uiconfig/ui/shadowtabpage.ui
index 421e4fb..4110a8c 100644
--- a/cui/uiconfig/ui/shadowtabpage.ui
+++ b/cui/uiconfig/ui/shadowtabpage.ui
@@ -2,11 +2,6 @@
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-requires LibreOffice 1.0 -->
-  <object class="GtkAdjustment" id="adjustmentDistance">
-    <property name="upper">999</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
   <object class="GtkAdjustment" id="adjustmentPercent">
     <property name="upper">100</property>
     <property name="step_increment">5</property>
@@ -33,9 +28,10 @@
             <property name="spacing">12</property>
             <property name="homogeneous">True</property>
             <child>
-              <object class="GtkBox" id="box2">
+              <object class="GtkBox" id="maingrid">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="vexpand">True</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
@@ -59,6 +55,7 @@
                   <object class="GtkGrid" id="gridSHADOW">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="vexpand">True</property>
                     <property name="row_spacing">6</property>
                     <property name="column_spacing">12</property>
                     <child>
@@ -93,8 +90,6 @@
                       <object class="svxlo-SvxRectCtl" id="CTL_POSITION">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="vexpand">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -146,13 +141,7 @@
                         <property name="halign">start</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="GtkLabel" id="FT_POSITION">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">_Position</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">CTL_POSITION</property>
-                          </object>
+                          <placeholder/>
                         </child>
                       </object>
                       <packing>
@@ -271,6 +260,11 @@
       </object>
     </child>
   </object>
+  <object class="GtkAdjustment" id="adjustmentDistance">
+    <property name="upper">999</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <widgets>
       <widget name="MTR_SHADOW_TRANSPARENT:0%"/>
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
index 37cd6bb..d31a094 100644
--- a/include/sfx2/dialoghelper.hxx
+++ b/include/sfx2/dialoghelper.hxx
@@ -30,6 +30,10 @@ void SFX2_DLLPUBLIC setPreviewsToSamePlace(Window *pParent, VclBuilderContainer
 
 Size SFX2_DLLPUBLIC getParagraphPreviewOptimalSize(const Window *pReference);
 
+Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const Window *pReference);
+
+Size SFX2_DLLPUBLIC getDrawListBoxOptimalSize(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 76f9d2c6..210a0e4 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -110,6 +110,7 @@ public:
     virtual void        StateChanged( StateChangedType nStateChange );
     virtual void        DataChanged( const DataChangedEvent& rDCEvt );
     virtual void        Resize();
+    virtual Size        GetOptimalSize() const;
 
     void                Reset();
     RECT_POINT          GetActualRP() const;
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index e0ac931..c3440e6 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -57,6 +57,16 @@ Size getParagraphPreviewOptimalSize(const Window *pReference)
     return pReference->LogicToPixel(Size(68 , 112), MAP_APPFONT);
 }
 
+Size getDrawPreviewOptimalSize(const Window *pReference)
+{
+    return pReference->LogicToPixel(Size(88, 42), MAP_APPFONT);
+}
+
+Size getDrawListBoxOptimalSize(const Window *pReference)
+{
+    return pReference->LogicToPixel(Size(88, 110), 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 cc88c15..00c0b50 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -96,6 +96,10 @@ SvxRectCtl::SvxRectCtl(Window* pParent, RECT_POINT eRpt,
     Resize_Impl();
 }
 
+Size SvxRectCtl::GetOptimalSize() const
+{
+    return LogicToPixel(Size(39, 39), MAP_APPFONT);
+}
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxRectCtl(Window *pParent, VclBuilder::stringmap &)
 {


More information about the Libreoffice-commits mailing list