Hi, everyone. This is my first trial of sending a patch for LibreOffice. I worked on this bug: https://bugs.freedesktop.org/show_bug.cgi?id=31022 My design is not as good as the design by Andrew, but I think it looks better than previous one. -Changed the width of the about dialog to look better. -added the definition of LibreOffice. "LibreOffice is a free and open source office suite developed by The Document Foundation." -Added the Document Foundation and Features links. -Removed the OK button, just like Firefox. I want to remove the build information and place only the major version info (like 3.5) but i wasn't sure. Maybe, it is a neccessary information. By the way, is it possible to make a text bold, italic, heading or different color? Where can i find more info about it?
Attachment:
aboutdialog.png
Description: PNG image
From be0ded0cff65938e922714c21f954e0e3544f0d6 Mon Sep 17 00:00:00 2001 From: dbarisakkurt <dbarisakkurt@gmail.com> Date: Wed, 1 Feb 2012 20:20:28 +0200 Subject: [PATCH] I added some links and changed the width of the about dialog --- cui/source/dialogs/about.cxx | 38 ++++++++++++++++++++++++++------------ cui/source/dialogs/about.hrc | 27 +++++++++++++++------------ cui/source/dialogs/about.src | 34 ++++++++++++++++++++++++++-------- cui/source/inc/about.hxx | 5 ++++- 4 files changed, 71 insertions(+), 33 deletions(-) diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 70648a0..46e1762 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -101,18 +101,21 @@ GetBuildId() AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : SfxModalDialog ( pParent, rId ), - - aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ), aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), aInfoLink ( this, ResId( ABOUT_FTXT_LINK, *rId.GetResMgr() ) ), + aTdfLink ( this, ResId( ABOUT_TDFSTR_LINK, *rId.GetResMgr() ) ), + aFeaturesLink ( this, ResId( ABOUT_FEATURES_LINK, *rId.GetResMgr() ) ), aVersionTextStr(ResId(ABOUT_STR_VERSION, *rId.GetResMgr())), m_aVendorTextStr(ResId(ABOUT_STR_VENDOR, *rId.GetResMgr())), m_aOracleCopyrightTextStr(ResId(ABOUT_STR_COPYRIGHT_ORACLE_DERIVED, *rId.GetResMgr())), m_aAcknowledgementTextStr(ResId(ABOUT_STR_ACKNOWLEDGEMENT, *rId.GetResMgr())), m_aLinkStr(ResId( ABOUT_STR_LINK, *rId.GetResMgr())), + m_aTdfLinkStr(ResId( ABOUT_TDF_LINK, *rId.GetResMgr())), + m_aFeaturesLinkStr(ResId( ABOUT_FEATURESSTR_LINK, *rId.GetResMgr())), m_sBuildStr(ResId(ABOUT_STR_BUILD, *rId.GetResMgr())) { + int lastLine; // load image from module path aAppLogo = SfxApplication::GetApplicationLogo(); @@ -152,12 +155,19 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : aInfoLink.SetBackground(); aInfoLink.SetClickHdl( LINK( this, AboutDialog, HandleHyperlink ) ); + aTdfLink.SetURL(m_aTdfLinkStr); + aTdfLink.SetBackground(); + aTdfLink.SetClickHdl( LINK( this, AboutDialog, HandleHyperlink ) ); + + aFeaturesLink.SetURL(m_aFeaturesLinkStr); + aFeaturesLink.SetBackground(); + aFeaturesLink.SetClickHdl( LINK( this, AboutDialog, HandleHyperlink ) ); + Color aTextColor( rSettings.GetWindowTextColor() ); aVersionText.SetControlForeground( aTextColor ); aCopyrightText.SetControlForeground( aTextColor ); rtl::OUStringBuffer sText(m_aVendorTextStr); - sText.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n\n")); sal_uInt32 nCopyrightId = utl::ConfigManager::getProductName().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("LibreOffice")) @@ -186,7 +196,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : aVersionTextSize.Width() += nDlgMargin; Size aOutSiz = GetOutputSizePixel(); - aOutSiz.Width() = aAppLogoSiz.Width(); + aOutSiz.Width() = 600; // size of the dialog windows is 600 if (aOutSiz.Width() < aVersionTextSize.Width()) aOutSiz.Width() = aVersionTextSize.Width(); @@ -227,19 +237,23 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : Size aLTSize = aInfoLink.CalcMinimumSize(); Point aLTPnt; aLTPnt.X() = ( aOutSiz.Width() - aLTSize.Width() ) / 2; + lastLine=nY; aLTPnt.Y() = nY; aInfoLink.SetPosSizePixel( aLTPnt, aLTSize ); nY += aLTSize.Height() + nCtrlMargin; - // OK-Button-Position (at the bottom and centered) - Size aOKSiz = aOKButton.GetSizePixel(); - Point aOKPnt; - aOKPnt.X() = ( aOutSiz.Width() - aOKSiz.Width() ) / 2; - aOKPnt.Y() = nY; - aOKButton.SetPosPixel( aOKPnt ); + Size aTDFSize = aTdfLink.CalcMinimumSize(); + Point aTDFPnt; + aTDFPnt.X() = 20; + aTDFPnt.Y() = lastLine; + aTdfLink.SetPosSizePixel( aTDFPnt, aTDFSize ); - nY += aOKSiz.Height() + nCtrlMargin; + Size aFeaturesSize = aFeaturesLink.CalcMinimumSize(); + Point aFeaturesPnt; + aFeaturesPnt.X() = (( aOutSiz.Width() - aTDFSize.Width() ) / 2) + 250; + aFeaturesPnt.Y() = lastLine; + aFeaturesLink.SetPosSizePixel( aFeaturesPnt, aFeaturesSize ); aOutSiz.Height() = nY; @@ -284,7 +298,7 @@ IMPL_LINK( AboutDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink ) void AboutDialog::Paint( const Rectangle& rRect ) { SetClipRegion( rRect ); - Point aPos( 0, 0 ); + Point aPos( 100, 0 ); DrawImage( aPos, aAppLogo ); } diff --git a/cui/source/dialogs/about.hrc b/cui/source/dialogs/about.hrc index fe31423..9e480e9 100644 --- a/cui/source/dialogs/about.hrc +++ b/cui/source/dialogs/about.hrc @@ -27,15 +27,18 @@ #include <sfx2/sfx.hrc> -#define ABOUT_BTN_OK 1 -#define ABOUT_FTXT_VERSION 2 -#define ABOUT_FTXT_COPYRIGHT 3 -#define ABOUT_FTXT_LINK 4 -#define ABOUT_STR_BUILD 5 -#define ABOUT_STR_VERSION 6 -#define ABOUT_STR_VENDOR 7 -#define ABOUT_STR_COPYRIGHT 8 -#define ABOUT_STR_COPYRIGHT_DERIVED 9 -#define ABOUT_STR_COPYRIGHT_ORACLE_DERIVED 10 -#define ABOUT_STR_ACKNOWLEDGEMENT 11 -#define ABOUT_STR_LINK 12 +#define ABOUT_FTXT_VERSION 1 +#define ABOUT_FTXT_COPYRIGHT 2 +#define ABOUT_FTXT_LINK 3 +#define ABOUT_TDFSTR_LINK 4 +#define ABOUT_FEATURES_LINK 5 +#define ABOUT_STR_BUILD 6 +#define ABOUT_STR_VERSION 7 +#define ABOUT_STR_VENDOR 8 +#define ABOUT_STR_COPYRIGHT 9 +#define ABOUT_STR_COPYRIGHT_DERIVED 10 +#define ABOUT_STR_COPYRIGHT_ORACLE_DERIVED 11 +#define ABOUT_STR_ACKNOWLEDGEMENT 12 +#define ABOUT_STR_LINK 13 +#define ABOUT_TDF_LINK 14 +#define ABOUT_FEATURESSTR_LINK 15 diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src index 37e5f4d..ddbd25e 100644 --- a/cui/source/dialogs/about.src +++ b/cui/source/dialogs/about.src @@ -33,12 +33,6 @@ ModalDialog RID_DEFAULTABOUT Size = MAP_APPFONT ( 245 , 280 ) ; Moveable = TRUE ; SVLook = TRUE ; - OKButton ABOUT_BTN_OK - { - DefButton = TRUE ; - Pos = MAP_APPFONT ( 174 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; MultiLineEdit ABOUT_FTXT_VERSION { Border = FALSE ; @@ -68,13 +62,29 @@ ModalDialog RID_DEFAULTABOUT Pos = MAP_APPFONT ( 54 , 100 ) ; Size = MAP_APPFONT ( 168 , 10 ) ; }; + FixedText ABOUT_TDFSTR_LINK + { + NoLabel = TRUE; + TabStop = TRUE; + Text [ en-US ] = "The Document Foundation"; + Pos = MAP_APPFONT ( 54 , 100 ) ; + Size = MAP_APPFONT ( 168 , 10 ) ; + }; + FixedText ABOUT_FEATURES_LINK + { + NoLabel = TRUE; + TabStop = TRUE; + Text [ en-US ] = "Features"; + Pos = MAP_APPFONT ( 54 , 100 ) ; + Size = MAP_APPFONT ( 168 , 10 ) ; + }; String ABOUT_STR_VERSION { Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX %PRODUCTEXTENSION"; }; String ABOUT_STR_VENDOR { - Text[ en-US ] = "This product was supplied by %OOOVENDOR."; + Text[ en-US ] = "%PRODUCTNAME is a free and open source office suite developed by %OOOVENDOR. "; }; String ABOUT_STR_COPYRIGHT { @@ -90,7 +100,7 @@ ModalDialog RID_DEFAULTABOUT }; String ABOUT_STR_ACKNOWLEDGEMENT { - Text[ en-US ] = "%OOOVENDOR acknowledges all community members, please find more info at the link below:"; + Text[ en-US ] = "%OOOVENDOR acknowledges all community members, please find more information at the links below:"; }; String ABOUT_STR_LINK { @@ -100,4 +110,12 @@ ModalDialog RID_DEFAULTABOUT { Text[ en-US ] = "Build ID:"; }; + String ABOUT_TDF_LINK + { + Text[ en-US ] = "http://http://www.documentfoundation.org/"; + }; + String ABOUT_FEATURESSTR_LINK + { + Text[ en-US ] = "http://www.libreoffice.org/features/"; + }; }; diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx index e7e5227..684ad66 100644 --- a/cui/source/inc/about.hxx +++ b/cui/source/inc/about.hxx @@ -45,12 +45,13 @@ typedef ::std::vector< Accelerator* > AccelList; class AboutDialog : public SfxModalDialog { private: - OKButton aOKButton; Image aAppLogo; MultiLineEdit aVersionText; MultiLineEdit aCopyrightText; svt::FixedHyperlink aInfoLink; + svt::FixedHyperlink aTdfLink; + svt::FixedHyperlink aFeaturesLink; String aVersionData; String aVersionTextStr; @@ -58,6 +59,8 @@ private: String m_aOracleCopyrightTextStr; String m_aAcknowledgementTextStr; String m_aLinkStr; + String m_aTdfLinkStr; + String m_aFeaturesLinkStr; String m_sBuildStr; protected: -- 1.7.5.4