diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-17 20:10:06 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-02-03 19:28:16 +0100 |
commit | b010e8911cb2c72c57b76ff44892db67b30f2b5b (patch) | |
tree | c854ca753b800fdf205440d3a7c9e204055dddae /sfx2 | |
parent | 17593b3e00c4d73a1985dfc1fae976d211aee007 (diff) |
fdo#65826 and fdo#73605: set a minimum size to start center
This minimum size calculated like this:
width: sidebar optimal width + width of text appearing in
the thumbnail view when no recent document is available.
height: menu width + optimal width of GtkBox containing
buttons.
Change-Id: Ic1fd6e33a1ec93e61318af02c09ee88909a76cf4
Reviewed-on: https://gerrit.libreoffice.org/7505
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/backingcomp.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 4 |
3 files changed, 25 insertions, 1 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index 78733feafcd9..e815b9741e0b 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -53,6 +53,14 @@ RecentDocsView::RecentDocsView( Window* pParent ) SetStyle(GetStyle() | WB_VSCROLL); setItemMaxTextLength( mnItemMaxTextLength ); setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding ); + + // Set prefered width so text lines will not be cut off + Font aOldFont(GetFont()); + Font aNewFont(aOldFont); + aNewFont.SetHeight(20); + SetFont(aNewFont); + set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2))); + SetFont(aOldFont); } extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeRecentDocsView(Window *pParent, VclBuilder::stringmap &) diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 4a144981c6d0..023d426cd355 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -490,6 +490,20 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f if( pBack ) pBack->setOwningFrame( m_xFrame ); + // Set a minimum size for Start Center + if( pParent && pBack ) + { + long nMenuHeight = 0; + Window* pMenu = pParent->GetWindow(WINDOW_NEXT); + if( pMenu ) + nMenuHeight = pMenu->GetSizePixel().Height(); + + pParent->SetMinOutputSizePixel( + Size( + pBack->get_width_request(), + pBack->get_height_request() + nMenuHeight)); + } + /* } SAFE */ } diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 60ce65f25354..b02f3e3eb95b 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -258,6 +258,9 @@ void BackingWindow::initControls() mpThinBox2->SetBackground(aButtonsText); Resize(); + + set_width_request(mpAllRecentThumbnails->get_width_request() + mpAllButtonsBox->GetOptimalSize().Width()); + set_height_request(mpAllButtonsBox->GetOptimalSize().Height()); } void BackingWindow::setupButton( PushButton* pButton ) @@ -548,5 +551,4 @@ void BackingWindow::clearRecentFileList() { mpAllRecentThumbnails->Clear(); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab:*/ |