summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2012-02-10 17:33:42 +0100
committerPetr Mladek <pmladek@suse.cz>2012-02-10 17:38:48 +0100
commite0626ada2fce4879efc5ae79b0e751efaafe4c28 (patch)
tree4d9c25ecee63313a4f53264319db23daadcc3cf0
parent43aa1115c88f1300c73337a3622c2c03faa699f7 (diff)
add back close button to the about dialog
Some windowmanagers on small devides do not have the close window button, so all dialogs should have its own way how to diappear. It is now done like in other application. They use "Close" button instead of "OK". They put it into the right side and delimit it by a line, so it looks like another dialog in the application.
-rw-r--r--cui/source/dialogs/about.cxx23
-rw-r--r--cui/source/dialogs/about.hrc2
-rw-r--r--cui/source/dialogs/about.src11
-rw-r--r--cui/source/inc/about.hxx2
4 files changed, 36 insertions, 2 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 009bcfeca92d..e0e04c5fab04 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -105,6 +105,8 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
aInfoLink ( this, ResId( ABOUT_FTXT_LINK, *rId.GetResMgr() ) ),
aTdfLink ( this, ResId( ABOUT_TDFSTR_LINK, *rId.GetResMgr() ) ),
aFeaturesLink ( this, ResId( ABOUT_FEATURES_LINK, *rId.GetResMgr() ) ),
+ aButtonsLine ( this, ResId( ABOUT_BUTTONS_LINE, *rId.GetResMgr() ) ),
+ aCancelButton ( this, ResId( ABOUT_BTN_CANCEL, *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())),
@@ -254,9 +256,26 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
aLTPnt.Y() = aLTPnt.Y() + aLTSize.Height() + nLineSpace;
aInfoLink.SetPosSizePixel( aLTPnt, aLTSize );
- nY += aLTSize.Height() + nLineSpace;
+ nY += aLTSize.Height();
+
+ // buttons delimiter line
+ Size aBDSize = aButtonsLine.GetSizePixel();
+ aBDSize.Width() = aOutSiz.Width();
+ Point aBDPnt;
+ aBDPnt.X() = 0;
+ aBDPnt.Y() = nY + nCtrlMargin / 2 + aBDSize.Height() / 2;
+ aButtonsLine.SetPosSizePixel( aBDPnt, aBDSize );
+
+ nY += nCtrlMargin + aBDSize.Height();
+
+ // Cancel-Button-Position (at the bottom and in the right)
+ Size aCancelSiz = aCancelButton.GetSizePixel();
+ Point aCancelPnt;
+ aCancelPnt.X() = aOutSiz.Width() - aCancelSiz.Width() - nDlgMargin / 2;
+ aCancelPnt.Y() = nY;
+ aCancelButton.SetPosPixel( aCancelPnt );
- nY += nCtrlMargin;
+ nY += aCancelSiz.Height() + nCtrlMargin / 2;
aOutSiz.Height() = nY;
diff --git a/cui/source/dialogs/about.hrc b/cui/source/dialogs/about.hrc
index 9e480e9b7111..07f10268ec23 100644
--- a/cui/source/dialogs/about.hrc
+++ b/cui/source/dialogs/about.hrc
@@ -42,3 +42,5 @@
#define ABOUT_STR_LINK 13
#define ABOUT_TDF_LINK 14
#define ABOUT_FEATURESSTR_LINK 15
+#define ABOUT_BUTTONS_LINE 16
+#define ABOUT_BTN_CANCEL 17
diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src
index 512d9eb3eea7..6cedf59beb9a 100644
--- a/cui/source/dialogs/about.src
+++ b/cui/source/dialogs/about.src
@@ -121,4 +121,15 @@ ModalDialog RID_DEFAULTABOUT
{
Text[ en-US ] = "http://www.libreoffice.org/features/";
};
+ FixedLine ABOUT_BUTTONS_LINE
+ {
+ Pos = MAP_APPFONT ( 0 , 245 ) ;
+ Size = MAP_APPFONT ( 170 , 2 ) ;
+ };
+ CancelButton ABOUT_BTN_CANCEL
+ {
+ DefButton = TRUE ;
+ Pos = MAP_APPFONT ( 174 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
};
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 684ad66e5310..a20b2a8bec8c 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -52,6 +52,8 @@ private:
svt::FixedHyperlink aInfoLink;
svt::FixedHyperlink aTdfLink;
svt::FixedHyperlink aFeaturesLink;
+ FixedLine aButtonsLine;
+ CancelButton aCancelButton;
String aVersionData;
String aVersionTextStr;