summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-09 13:46:00 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-07-11 08:37:11 +0000
commit458e7220b08886b4072b1093e9ebdbfef3fe9ee7 (patch)
tree198ae20660d90680ddaa4035a8964ed9648493e4
parentff91dd51e2d1db1039e54617d99a11fe27ccd1c9 (diff)
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.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--cui/source/options/optaboutconfig.cxx26
-rw-r--r--cui/source/options/optaboutconfig.hxx12
2 files changed, 16 insertions, 22 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index ff396615faef..8bc67e8d263c 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 6761e3c1ddfb..72ce9d9c4d07 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