summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icon-themes/galaxy/sfx2/res/logo.pngbin0 -> 12355 bytes
-rw-r--r--include/sfx2/recentdocsview.hxx1
-rw-r--r--sfx2/source/control/recentdocsview.cxx27
-rw-r--r--sfx2/source/control/templateview.hrc2
-rw-r--r--sfx2/source/control/templateview.src10
5 files changed, 40 insertions, 0 deletions
diff --git a/icon-themes/galaxy/sfx2/res/logo.png b/icon-themes/galaxy/sfx2/res/logo.png
new file mode 100644
index 000000000000..003e188831a9
--- /dev/null
+++ b/icon-themes/galaxy/sfx2/res/logo.png
Binary files differ
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index 2edace52c774..8aceeef1bb4b 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -61,6 +61,7 @@ protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void OnItemDblClicked(ThumbnailViewItem *pItem);
void OpenItem( const ThumbnailViewItem *pItem );
+ virtual void Paint( const Rectangle& rRect );
bool isAcceptedFile(const OUString &rURL) const;
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;
diff --git a/sfx2/source/control/templateview.hrc b/sfx2/source/control/templateview.hrc
index f3eccee04603..f0c4daeb08b3 100644
--- a/sfx2/source/control/templateview.hrc
+++ b/sfx2/source/control/templateview.hrc
@@ -10,5 +10,7 @@
#define BTN_ALL_TEMPLATES 256
#define CONTROL_BUTTONS 257
#define FT_NAME 258
+#define STR_WELCOME 259
+#define IMG_WELCOME 260
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateview.src b/sfx2/source/control/templateview.src
index d242b032c463..ef2eedec14bf 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -23,4 +23,14 @@ FixedText FT_NAME
Size = MAP_APPFONT( 238, 12 );
};
+String STR_WELCOME
+{
+ Text [ en-US ] = "Welcome! You can open or create a new document!";
+};
+
+Image IMG_WELCOME
+{
+ ImageBitmap = Bitmap { File = "logo.png" ; };
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */