[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Jan Holesovsky
kendy at collabora.com
Fri Aug 1 06:25:46 PDT 2014
include/sfx2/recentdocsview.hxx | 3 +++
sfx2/source/control/recentdocsview.cxx | 25 +++++++++++++------------
2 files changed, 16 insertions(+), 12 deletions(-)
New commits:
commit 2568a0bb72c404366ba1665f7ce005c4d3d36ec6
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Aug 1 15:13:34 2014 +0200
hidpi, startcenter: Don't set fixed font heigt in the startcenter.
Change-Id: I68efbd08d21b514ab1659cd6bddfc2c4788c4a74
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index 5563559..c728067 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -73,6 +73,9 @@ protected:
bool isAcceptedFile(const OUString &rURL) const;
+ /// Set (larger) font for the Welcome message.
+ void SetMessageFont();
+
long mnItemMaxSize;
long mnTextHeight;
long mnItemPadding;
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 2ac8549..af1469c 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -117,6 +117,13 @@ bool RecentDocsView::isAcceptedFile(const OUString &rURL) const
(mnFileTypes & TYPE_OTHER && typeMatchesExtension(TYPE_OTHER, aExt));
}
+void RecentDocsView::SetMessageFont()
+{
+ Font aFont(GetFont());
+ aFont.SetHeight(aFont.GetHeight()*1.3);
+ SetFont(aFont);
+}
+
BitmapEx RecentDocsView::getDefaultThumbnail(const OUString &rURL)
{
BitmapEx aImg;
@@ -195,13 +202,11 @@ void RecentDocsView::Reload()
Invalidate();
// Set preferred width
- if( mFilteredItemList.empty() )
+ if (mFilteredItemList.empty())
{
Font aOldFont(GetFont());
- Font aNewFont(aOldFont);
- aNewFont.SetHeight(20);
- SetFont(aNewFont);
- set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
+ SetMessageFont();
+ set_width_request(std::max(GetTextWidth(maWelcomeLine1), GetTextWidth(maWelcomeLine2)));
SetFont(aOldFont);
}
else
@@ -257,9 +262,7 @@ void RecentDocsView::Paint( const Rectangle &aRect )
{
// No recent files to be shown yet. Show a welcome screen.
Font aOldFont(GetFont());
- Font aNewFont(aOldFont);
- aNewFont.SetHeight(20);
- SetFont(aNewFont);
+ SetMessageFont();
long nTextHeight = GetTextHeight();
@@ -297,10 +300,8 @@ void RecentDocsView::LoseFocus()
void RecentDocsView::Clear()
{
Font aOldFont(GetFont());
- Font aNewFont(aOldFont);
- aNewFont.SetHeight(20);
- SetFont(aNewFont);
- set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
+ SetMessageFont();
+ set_width_request(std::max(GetTextWidth(maWelcomeLine1), GetTextWidth(maWelcomeLine2)));
SetFont(aOldFont);
ThumbnailView::Clear();
More information about the Libreoffice-commits
mailing list