summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-09 11:58:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-09 11:58:54 +0100
commit7560f765b32bf9969b89b28c6733faa8098f1809 (patch)
tree36c24f5ed6c1a5446179f72d07f03edfdd642a1d
parenta8dd49b9fc59371ff8edb31082bbd4f1b6179b1c (diff)
unify strip previews optimal size in one place
Change-Id: I6ae1073d013c9d9bbca39c505955436cd4950d1b
-rw-r--r--cui/uiconfig/ui/charnamepage.ui1
-rw-r--r--cui/uiconfig/ui/effectspage.ui1
-rw-r--r--cui/uiconfig/ui/positionpage.ui1
-rw-r--r--cui/uiconfig/ui/textanimtabpage.ui73
-rw-r--r--cui/uiconfig/ui/textattrtabpage.ui5
-rw-r--r--cui/uiconfig/ui/twolinespage.ui1
-rw-r--r--include/sfx2/dialoghelper.hxx2
-rw-r--r--include/svx/dlgctrl.hxx1
-rw-r--r--include/svx/fntctrl.hxx2
-rw-r--r--include/svx/measctrl.hxx1
-rw-r--r--sfx2/source/dialog/dialoghelper.cxx5
-rw-r--r--svx/source/dialog/dlgctrl.cxx9
-rw-r--r--svx/source/dialog/fntctrl.cxx5
-rw-r--r--svx/source/dialog/measctrl.cxx8
14 files changed, 64 insertions, 51 deletions
diff --git a/cui/uiconfig/ui/charnamepage.ui b/cui/uiconfig/ui/charnamepage.ui
index d89402daa8ad..25c67f1a2526 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 592984fdaa9c..12676c2dc1ae 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 20927c8f7890..c44bee666417 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 dc74c15ce912..8f0c9f9459f0 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 da272cf8ae7f..b5a18ecdc1c0 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 c931b90d279e..232062c523ca 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 d31a09492ecc..5b09eb56b73c 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 c34d1543cb27..64b92ae9531a 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 93edc0d04b13..f4c62621f673 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 f17190a3edc1..fde082fbb7e7 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 c3440e6bf5be..cd805006de10 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 d730ea99c640..14bf9cb505f2 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 04d175b59c7c..fc0e096048be 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 646decbf06d5..1a630eeb3236 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()
{