Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi Astron,

sorry for the late reply...

On 28.05.2012 04:09, Stefan Knorr (Astron) wrote:
I know I am late with this suggestion, but just removing the (quite
ugly and pointless, too) 3D borders around the settigns page would
work miracles. Is that still possible? (Manipulated screenshot
attached.)

How about the attached patch (screenshot attached as well) ?

Ivan
From c6b6cf0568bd53bb203f83e8097511d69433d7eb Mon Sep 17 00:00:00 2001
From: Ivan Timofeev <timofeev.i.s@gmail.com>
Date: Thu, 31 May 2012 21:16:30 +0400
Subject: [PATCH] remove the border from the options dialog, use just a
 separator instead

Change-Id: Ie1ca686a6bc7aea223837ab4c1ec0dad82b43073
---
 cui/source/inc/treeopt.hxx     |    4 ++--
 cui/source/options/treeopt.cxx |   28 ++++++++++------------------
 cui/source/options/treeopt.hrc |   11 ++++++-----
 cui/source/options/treeopt.src |   19 +++++++++----------
 4 files changed, 27 insertions(+), 35 deletions(-)

diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index aa3af77..38700e6 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 #include <tools/resary.hxx>
-#include <vcl/fixbrd.hxx>
+#include <vcl/fixed.hxx>
 
 class SfxModule;
 class SfxShell;
@@ -155,7 +155,7 @@ private:
     HelpButton      aHelpPB;
     PushButton      aBackPB;
 
-    FixedBorder     aHiddenGB;
+    FixedLine       aSeparatorFL;
 
     SvTreeListBox   aTreeLB;
 
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 391f715..ee9ce09 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -501,7 +501,7 @@ struct OptionsGroupInfo
     aCancelPB           ( this, CUI_RES( PB_CANCEL ) ),\
     aHelpPB             ( this, CUI_RES( PB_HELP ) ),\
     aBackPB             ( this, CUI_RES( PB_BACK ) ),\
-    aHiddenGB           ( this, CUI_RES( FB_BORDER ) ),\
+    aSeparatorFL        ( this, CUI_RES( FL_SEPARATOR ) ),\
     aTreeLB             ( this, CUI_RES( TLB_PAGES ) ),\
     sTitle              ( GetText() ),\
     sNotLoadedError     (       CUI_RES( ST_LOAD_ERROR ) ),\
@@ -785,8 +785,6 @@ void OfaTreeOptionsDialog::InitTreeAndHandler()
     aTreeLB.SetSelectHdl( LINK( this, OfaTreeOptionsDialog, ShowPageHdl_Impl ) );
     aBackPB.SetClickHdl( LINK( this, OfaTreeOptionsDialog, BackHdl_Impl ) );
     aOkPB.SetClickHdl( LINK( this, OfaTreeOptionsDialog, OKHdl_Impl ) );
-
-    aHiddenGB.Show();
 }
 
 void OfaTreeOptionsDialog::ActivatePage( sal_uInt16 nResId )
@@ -1080,13 +1078,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
             SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pPageInfo->m_nPageId ) 
);
             pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) );
 
-            Point aTreePos(aTreeLB.GetPosPixel());
-            Size aTreeSize(aTreeLB.GetSizePixel());
-            Point aGBPos(aHiddenGB.GetPosPixel());
-            Size aPageSize(pPageInfo->m_pPage->GetSizePixel());
-            Size aGBSize(aHiddenGB.GetSizePixel());
-            Point aPagePos( aGBPos.X() + ( aGBSize.Width() - aPageSize.Width() ) / 2,
-                            aGBPos.Y() + ( aGBSize.Height() - aPageSize.Height() ) / 2 );
+            Point aPagePos( aSeparatorFL.GetPosPixel().X(), aTreeLB.GetPosPixel().Y());
             pPageInfo->m_pPage->SetPosPixel( aPagePos );
             if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
             {
@@ -1112,12 +1104,12 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
 
         pPageInfo->m_pExtPage = new ExtensionsTabPage(
             this, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
-        Size aSize = aHiddenGB.GetSizePixel();
-        aSize.Width() = aSize.Width() - 4;
-        aSize.Height() = aSize.Height() - 4;
-        Point aPos = aHiddenGB.GetPosPixel();
-        aPos.X() = aPos.X() + 2;
-        aPos.Y() = aPos.Y() + 2;
+        Size aSize;
+        aSize.Width() = aSeparatorFL.GetSizePixel().Width();
+        aSize.Height() = aSeparatorFL.GetSizePixel().Height() - aTreeLB.GetPosPixel().Y();
+        Point aPos;
+        aPos.X() = aSeparatorFL.GetPosPixel().X();
+        aPos.Y() = aTreeLB.GetPosPixel().Y();
         pPageInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
     }
 
@@ -1931,7 +1923,7 @@ namespace
 
 void OfaTreeOptionsDialog::ResizeTreeLB( void )
 {
-    const long  nMax = aHiddenGB.GetSizePixel().Width() * 42 / 100;
+    const long  nMax = aSeparatorFL.GetSizePixel().Width() * 42 / 100;
                                             // don't ask where 42 comes from... but it looks / 
feels ok ;-)
     long        nDelta = 50;                // min.
     sal_uInt16      nDepth = 0;
@@ -1974,7 +1966,7 @@ void OfaTreeOptionsDialog::ResizeTreeLB( void )
     MoveControl( aCancelPB, nDelta );
     MoveControl( aHelpPB, nDelta );
     MoveControl( aBackPB, nDelta );
-    MoveControl( aHiddenGB, nDelta );
+    MoveControl( aSeparatorFL, nDelta );
 }
 
 bool isNodeActive( OptionsNode* pNode, Module* pModule )
diff --git a/cui/source/options/treeopt.hrc b/cui/source/options/treeopt.hrc
index fc4e55f..3be1d6a 100644
--- a/cui/source/options/treeopt.hrc
+++ b/cui/source/options/treeopt.hrc
@@ -35,7 +35,7 @@
 #define PB_BACK                 4
 #define TLB_PAGES               5
 
-#define FB_BORDER               19
+#define FL_SEPARATOR            19
 
 #define FT_HINT                 21
 #define CB_DISABLE              22
@@ -57,8 +57,8 @@
 
 // metrics
 
-#define WIDTH_PAGEFRAME         (TP_WIDTH + 3)
-#define HEIGHT_PAGEFRAME        (TP_HEIGHT + 6)
+#define WIDTH_PAGEFRAME         TP_WIDTH
+#define HEIGHT_PAGEFRAME        TP_HEIGHT
 
 #define COL_1                   (RSC_SP_DLG_INNERBORDER_LEFT)
 #define COL_2                   (COL_1+0)
@@ -77,5 +77,6 @@
 #define ROW_1                   (RSC_SP_DLG_INNERBORDER_TOP)
 #define ROW_2                   (ROW_1+HEIGHT_PAGEFRAME)
 #define ROW_3                   (ROW_2+RSC_SP_CTRL_GROUP_Y)
-#define ROW_4                   (ROW_3+RSC_CD_PUSHBUTTON_HEIGHT)
-#define ROW_5                   (ROW_4+RSC_SP_DLG_INNERBORDER_BOTTOM)
+#define ROW_4                   (ROW_3+RSC_CD_FIXEDLINE_HEIGHT)
+#define ROW_5                   (ROW_4+RSC_CD_PUSHBUTTON_HEIGHT)
+#define ROW_6                   (ROW_5+RSC_SP_DLG_INNERBORDER_BOTTOM)
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index 68dbe89..f05f978 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -39,32 +39,32 @@ ModalDialog RID_OFADLG_OPTIONS_TREE
     OutputSize = TRUE ;
     SVLook = TRUE ;
 
-    Size = MAP_APPFONT ( COL_12 , ROW_5 ) ;
+    Size = MAP_APPFONT ( COL_12 , ROW_6 ) ;
     Text [ en-US ] = "Options";
 
     OKButton PB_OK
     {
-        Pos = MAP_APPFONT ( COL_4, ROW_3 ) ;
+        Pos = MAP_APPFONT ( COL_4, ROW_4 ) ;
         Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
         TabStop = TRUE ;
         DefButton = TRUE;
     };
     CancelButton PB_CANCEL
     {
-        Pos = MAP_APPFONT ( COL_6, ROW_3 ) ;
+        Pos = MAP_APPFONT ( COL_6, ROW_4 ) ;
         Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
         TabStop = TRUE ;
     };
     HelpButton PB_HELP
     {
-        Pos = MAP_APPFONT ( COL_8, ROW_3 ) ;
+        Pos = MAP_APPFONT ( COL_8, ROW_4 ) ;
         Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
         TabStop = TRUE ;
     };
     PushButton PB_BACK
     {
         HelpID = "cui:PushButton:RID_OFADLG_OPTIONS_TREE:PB_BACK";
-        Pos = MAP_APPFONT ( COL_10, ROW_3 ) ;
+        Pos = MAP_APPFONT ( COL_10, ROW_4 ) ;
         Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
         TabStop = TRUE ;
         Text [ en-US ] = "~Revert" ;
@@ -73,15 +73,14 @@ ModalDialog RID_OFADLG_OPTIONS_TREE
     Control TLB_PAGES
     {
         Pos = MAP_APPFONT ( COL_1, ROW_1 ) ;
-        Size = MAP_APPFONT ( (COL_2-COL_1), (ROW_4-ROW_1) );
+        Size = MAP_APPFONT ( (COL_2-COL_1), (ROW_5-ROW_1) );
         TabStop = TRUE ;
         Border = TRUE;
     };
-    Control FB_BORDER
+    FixedLine FL_SEPARATOR
     {
-        Pos = MAP_APPFONT ( COL_3, ROW_1 ) ;
-        Size = MAP_APPFONT ( WIDTH_PAGEFRAME, HEIGHT_PAGEFRAME ) ;
-        Hide = TRUE;
+        Pos = MAP_APPFONT ( COL_3, ROW_3 ) ;
+        Size = MAP_APPFONT ( WIDTH_PAGEFRAME, ROW_4-ROW_3 ) ;
     };
     String ST_LOAD_ERROR
     {
-- 
1.7.10

Attachment: patched-dialog.png
Description: PNG image


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.