summaryrefslogtreecommitdiff
path: root/sfx2/source/control/recentdocsview.cxx
diff options
context:
space:
mode:
authorRodolfo Ribeiro Gomes <rodolforg@gmail.com>2013-11-09 22:57:34 -0200
committerJan Holesovsky <kendy@collabora.com>2013-11-11 19:49:56 +0100
commit10ea40afa3d6804a4a6f816f10f71a93412328fa (patch)
tree428881359796da7f0ad0e89ac1512c11810e92b0 /sfx2/source/control/recentdocsview.cxx
parent192d5afa33fc92ae832148312e16613df4b98b5a (diff)
startcenter: Start center shows a welcome text when recent doc list is empty
The image I got from TDF wiki. I tried to show the text semitransparent also, but set font color with any alpha degree (eg. setTransparency(254) ) made it invisible. Maybe just a gray shade? Change-Id: Iaf7efb8433e9db03862825148ed2013588a5468f Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg@gmail.com>
Diffstat (limited to 'sfx2/source/control/recentdocsview.cxx')
-rw-r--r--sfx2/source/control/recentdocsview.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 14e8f655ca72..155c11ea5f03 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <templateview.hrc>
using namespace ::com::sun::star;
using namespace com::sun::star::uno;
@@ -241,6 +242,32 @@ void RecentDocsView::OpenItem( const ThumbnailViewItem *pItem )
}
}
+void RecentDocsView::Paint( const Rectangle &aRect )
+{
+ if ( mItemList.size() == 0 )
+ {
+ // No recent files to be shown yet. Show a welcome screen.
+ Image aImg(SfxResId(IMG_WELCOME));
+ OUString aStr(SfxResId(STR_WELCOME));
+ Font aOldFont(GetFont());
+ Font aNewFont(aOldFont);
+ aNewFont.SetHeight(20);
+ SetFont(aNewFont);
+ long nTextWidth = GetTextWidth(aStr);
+ long nTextHeight = GetTextHeight();
+ const Size & rImgSize = aImg.GetSizePixel();
+ const Size & rScreenSize = GetSizePixel();
+ const int nX = (rScreenSize.Width() - rImgSize.Width())/2;
+ const int nY = (rScreenSize.Height() - nTextHeight*1.5 - rImgSize.Height())/2;
+ Point aImgPoint(nX, nY);
+ DrawImage(aImgPoint, rImgSize, aImg, IMAGE_DRAW_SEMITRANSPARENT);
+ Point aStrPoint((rScreenSize.Width() - nTextWidth)/2, nY + rImgSize.Height() + nTextHeight/2);
+ DrawText(aStrPoint, aStr);
+ SetFont(aOldFont);
+ }
+ ThumbnailView::Paint(aRect);
+}
+
void RecentDocsView::SetThumbnailSize(long thumbnailSize)
{
mnItemMaxSize = thumbnailSize;