[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
Jan Holesovsky
kendy at collabora.com
Fri Dec 13 09:04:52 PST 2013
include/sfx2/recentdocsview.hxx | 3 ++-
sfx2/source/control/recentdocsview.cxx | 23 ++++++++++++++++-------
sfx2/source/control/templateview.hrc | 5 +++--
sfx2/source/control/templateview.src | 9 +++++++--
4 files changed, 28 insertions(+), 12 deletions(-)
New commits:
commit 83b041f33d1ab84a8a152475b68dfa71deafce42
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Dec 13 18:03:19 2013 +0100
startcenter: The welcome text was too long, split it to 2 lines.
Change-Id: I23d6a4bf8d9c3b2531dd95e4ea293ce7225bf8f1
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index ac52e67..63a067d 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -72,7 +72,8 @@ protected:
long mnItemMaxTextLength;
Image maWelcomeImage;
- OUString maWelcomeText;
+ OUString maWelcomeLine1;
+ OUString maWelcomeLine2;
};
#endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index afadb04..1b63ba4 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -46,7 +46,8 @@ RecentDocsView::RecentDocsView( Window* pParent )
, mnItemPadding(5)
, mnItemMaxTextLength(30)
, maWelcomeImage(SfxResId(IMG_WELCOME))
- , maWelcomeText(SfxResId(STR_WELCOME))
+ , maWelcomeLine1(SfxResId(STR_WELCOME_LINE1))
+ , maWelcomeLine2(SfxResId(STR_WELCOME_LINE2))
{
SetStyle(GetStyle() | WB_VSCROLL);
setItemMaxTextLength( mnItemMaxTextLength );
@@ -254,17 +255,25 @@ void RecentDocsView::Paint( const Rectangle &aRect )
aNewFont.SetHeight(20);
SetFont(aNewFont);
- long nTextWidth = GetTextWidth(maWelcomeText);
long nTextHeight = GetTextHeight();
+
+ long nTextWidth1 = GetTextWidth(maWelcomeLine1);
+ long nTextWidth2 = GetTextWidth(maWelcomeLine2);
+
const Size & rImgSize = maWelcomeImage.GetSizePixel();
- const Size & rScreenSize = GetSizePixel();
- const int nX = (rScreenSize.Width() - rImgSize.Width())/2;
- const int nY = (rScreenSize.Height() - nTextHeight*1.5 - rImgSize.Height())/2;
+
+ const Size & rSize = GetSizePixel();
+
+ const int nX = (rSize.Width() - rImgSize.Width())/2;
+ const int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2;
+
Point aImgPoint(nX, nY);
- Point aStrPoint((rScreenSize.Width() - nTextWidth)/2, nY + rImgSize.Height() + nTextHeight/2);
+ Point aStr1Point((rSize.Width() - nTextWidth1)/2, nY + rImgSize.Height() + nTextHeight/2);
+ Point aStr2Point((rSize.Width() - nTextWidth2)/2, nY + rImgSize.Height() + nTextHeight + nTextHeight/2);
DrawImage(aImgPoint, rImgSize, maWelcomeImage, IMAGE_DRAW_SEMITRANSPARENT);
- DrawText(aStrPoint, maWelcomeText);
+ DrawText(aStr1Point, maWelcomeLine1);
+ DrawText(aStr2Point, maWelcomeLine2);
SetFont(aOldFont);
}
diff --git a/sfx2/source/control/templateview.hrc b/sfx2/source/control/templateview.hrc
index f0c4dae..e5608c9 100644
--- a/sfx2/source/control/templateview.hrc
+++ b/sfx2/source/control/templateview.hrc
@@ -10,7 +10,8 @@
#define BTN_ALL_TEMPLATES 256
#define CONTROL_BUTTONS 257
#define FT_NAME 258
-#define STR_WELCOME 259
-#define IMG_WELCOME 260
+#define STR_WELCOME_LINE1 259
+#define STR_WELCOME_LINE2 260
+#define IMG_WELCOME 261
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateview.src b/sfx2/source/control/templateview.src
index 3b866bd..49fe015 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -23,9 +23,14 @@ FixedText FT_NAME
Size = MAP_APPFONT( 238, 12 );
};
-String STR_WELCOME
+String STR_WELCOME_LINE1
{
- Text [ en-US ] = "Welcome to %PRODUCTNAME. Use the sidebar to open or create a file.";
+ Text [ en-US ] = "Welcome to %PRODUCTNAME.";
+};
+
+String STR_WELCOME_LINE2
+{
+ Text [ en-US ] = "Use the sidebar to open or create a file.";
};
Image IMG_WELCOME
More information about the Libreoffice-commits
mailing list