diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-09 13:46:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-09 13:56:00 +0100 |
commit | 877aa0e1e879b057027029c1ceed07f90b00b0d3 (patch) | |
tree | f21e2e25627866244f9a2e25e6b01e4baf24c55b /cui | |
parent | 4fd1c9781fb2042eced9ea1b51c8e0b83c603e3a (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
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optaboutconfig.cxx | 26 | ||||
-rw-r--r-- | cui/source/options/optaboutconfig.hxx | 12 |
2 files changed, 16 insertions, 22 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 98256455e8a6..e918c8a6b702 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*/ ) : ModelessDialog( 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 ee42492c2199..e848cc427bff 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 ModelessDialog @@ -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 |