summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-01-17 20:10:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-01-21 15:42:57 +0000
commit840e7f004354ebe1239b9271dd758839c477ca7c (patch)
tree2d65b9eeb1d894bbdeceb91486684178b9c57bb3
parent1d621d363cf966648fc5ed551dbc95de3e70e89c (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>
-rw-r--r--sfx2/source/control/recentdocsview.cxx8
-rw-r--r--sfx2/source/dialog/backingcomp.cxx14
-rw-r--r--sfx2/source/dialog/backingwindow.cxx4
3 files changed, 25 insertions, 1 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index e1b1c0c07db9..69b605954e2f 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -54,6 +54,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 fa5cfa81a94e..cadf4c3e41ae 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -448,6 +448,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 988a4a349fb9..bf128f0cd6fd 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -265,6 +265,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 )
@@ -555,5 +558,4 @@ void BackingWindow::clearRecentFileList()
{
mpAllRecentThumbnails->Clear();
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab:*/