[Libreoffice-commits] core.git: sfx2/source
Zolnai Tamás
tamas.zolnai at collabora.com
Tue Jan 21 07:43:19 PST 2014
sfx2/source/control/recentdocsview.cxx | 8 ++++++++
sfx2/source/dialog/backingcomp.cxx | 14 ++++++++++++++
sfx2/source/dialog/backingwindow.cxx | 4 +++-
3 files changed, 25 insertions(+), 1 deletion(-)
New commits:
commit 840e7f004354ebe1239b9271dd758839c477ca7c
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Fri Jan 17 20:10:06 2014 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index e1b1c0c..69b6059 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 fa5cfa8..cadf4c3 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 988a4a3..bf128f0 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:*/
More information about the Libreoffice-commits
mailing list