cui/source/options/optaboutconfig.cxx |   26 ++++++++++++--------------
 cui/source/options/optaboutconfig.hxx |   12 ++++--------
 2 files changed, 16 insertions(+), 22 deletions(-)

New commits:
commit 458e7220b08886b4072b1093e9ebdbfef3fe9ee7
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Jul 9 13:46:00 2014 +0100

    Resolves: fdo#73806 reduce the size-request of the expert config dialog
    
    the optimal size was set to be 1024x800, reduce this down to
    effectively the same size as the options dialog itself.
    
    This dialog just isn't ever going to be right given the huge
    length of the strings and the number of strings. We need
    something more like a file picker dialog view here
    
    Change-Id: I019e951601c3df769a609b8b439b535b6d5e254f
    (cherry picked from commit 877aa0e1e879b057027029c1ceed07f90b00b0d3)
    Reviewed-on: https://gerrit.libreoffice.org/10182
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/cui/source/options/optaboutconfig.cxx 
b/cui/source/options/optaboutconfig.cxx
index ff39661..8bc67e8 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -124,21 +124,16 @@ Size CuiCustomMultilineEdit::GetOptimalSize() const
     return LogicToPixel(Size(150, GetTextHeight()), MAP_APPFONT);
 }
 
-Size CuiAboutConfigTabPage::GetOptimalSize() const
-{
-    return LogicToPixel(Size(1024,800),MAP_APPFONT);
-}
-
 CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent/*, const 
SfxItemSet& rItemSet*/ ) :
     ModalDialog( pParent, "AboutConfig", "cui/ui/aboutconfigdialog.ui"),
     m_pPrefCtrl( get<SvSimpleTableContainer>("preferences") ),
     m_pResetBtn( get<PushButton>("reset") ),
     m_pEditBtn( get<PushButton>("edit") ),
     m_vectorOfModified(),
-    m_pPrefBox( new OptHeaderTabListBox( *m_pPrefCtrl,
-                                         WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) 
)
+    m_pPrefBox( new SvSimpleTable(*m_pPrefCtrl,
+                                  WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
 {
-    Size aControlSize(200,200);
+    Size aControlSize(LogicToPixel(Size(385, 230), MAP_APPFONT));
     m_pPrefCtrl->set_width_request(aControlSize.Width());
     m_pPrefCtrl->set_height_request(aControlSize.Height());
 
@@ -152,11 +147,14 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* 
pParent/*, const SfxItemSe
     rBar.InsertItem( ITEMID_TYPE, get<FixedText>("type")->GetText(), 0,  
HIB_LEFT | HIB_VCENTER );
     rBar.InsertItem( ITEMID_VALUE, get<FixedText>("value")->GetText(), 0,  
HIB_LEFT | HIB_VCENTER );
 
-    long aTabs[] = {4,900,50,50,50};//TODO: Not works correctly hardcoded for 
now.
+    long aTabs[] = {4,0,0,0,0};
+
+    float fWidth = approximate_char_width();
 
-    aTabs[2] += aTabs[1] + rBar.GetTextWidth(rBar.GetItemText(1));
-    aTabs[3] += aTabs[2] + 160; //rBar.GetTextWidth(rBar.GetItemText(2));
-    aTabs[4] += aTabs[3] + 40; //rBar.GetTextWidth(rBar.GetItemText(3));
+    aTabs[1] = 0;
+    aTabs[2] = aTabs[1] + fWidth * 65;
+    aTabs[3] = aTabs[2] + fWidth * 20;
+    aTabs[4] = aTabs[3] + fWidth * 8;
 
     m_pPrefBox->SetTabs(aTabs, MAP_PIXEL);
 }
@@ -174,7 +172,7 @@ void CuiAboutConfigTabPage::InsertEntry(const OUString& 
rProp, const OUString& r
     m_pPrefBox->Insert( pEntry );
 }
 
-void CuiAboutConfigTabPage::Reset(/* const SfxItemSet&*/ )
+void CuiAboutConfigTabPage::Reset()
 {
     m_pPrefBox->Clear();
 
@@ -187,7 +185,7 @@ void CuiAboutConfigTabPage::Reset(/* const SfxItemSet&*/ )
     m_pPrefBox->SetUpdateMode(true);
 }
 
-bool CuiAboutConfigTabPage::FillItemSet(/* SfxItemSet&*/ )
+bool CuiAboutConfigTabPage::FillItemSet()
 {
     bool bModified = false;
 
diff --git a/cui/source/options/optaboutconfig.hxx 
b/cui/source/options/optaboutconfig.hxx
index 6761e3c..72ce9d9 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -37,7 +37,6 @@ public:
 
     virtual void KeyInput( const KeyEvent& rKeyEvent ) SAL_OVERRIDE;
     virtual Size GetOptimalSize() const SAL_OVERRIDE;
-    //void setBehaviour( bool bNumeric, int nLengthLimit);
 };
 
 class CuiAboutConfigTabPage : public ModalDialog
@@ -48,7 +47,7 @@ private:
     PushButton* m_pEditBtn;
 
     std::vector< boost::shared_ptr< Prop_Impl > > m_vectorOfModified;
-    boost::scoped_ptr< svx::OptHeaderTabListBox > m_pPrefBox;
+    boost::scoped_ptr< SvSimpleTable > m_pPrefBox;
 
     void AddToModifiedVector( const boost::shared_ptr< Prop_Impl >& rProp );
     std::vector< OUString > commaStringToSequence( const OUString& 
rCommaSepString );
@@ -57,15 +56,12 @@ private:
     DECL_LINK( ResetBtnHdl_Impl, void * );
 
 public:
-   //static ModalDialog* Create( Window* pParent, const SfxItemSet& rItemset );
-   CuiAboutConfigTabPage( Window* pParent/*, const SfxItemSet& rItemSet*/ );
+   CuiAboutConfigTabPage(Window* pParent);
    void     InsertEntry(const OUString& rProp, const OUString& rStatus, const 
OUString& rType, const OUString& rValue);
-   void     Reset(/* const SfxItemSet&*/ );
+   void     Reset();
    void     FillItems(const 
com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& 
xNameAccess);
    com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > 
getConfigAccess( const OUString& sNodePath, bool bUpdate );
-   virtual bool FillItemSet( /* SfxItemSet& rSet*/ );
-
-   virtual Size GetOptimalSize() const SAL_OVERRIDE;
+   bool FillItemSet();
 };
 
 class CuiAboutConfigValueDialog : public ModalDialog
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to