[Libreoffice-commits] .: cui/source

Petr Mladek pmladek at kemper.freedesktop.org
Fri Feb 10 08:39:11 PST 2012


 cui/source/dialogs/about.cxx |   23 +++++++++++++++++++++--
 cui/source/dialogs/about.hrc |    2 ++
 cui/source/dialogs/about.src |   11 +++++++++++
 cui/source/inc/about.hxx     |    2 ++
 4 files changed, 36 insertions(+), 2 deletions(-)

New commits:
commit e0626ada2fce4879efc5ae79b0e751efaafe4c28
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Feb 10 17:33:42 2012 +0100

    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.

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 009bcfe..e0e04c5 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 9e480e9..07f1026 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 512d9eb..6cedf59 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 684ad66..a20b2a8 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;


More information about the Libreoffice-commits mailing list