[Libreoffice-commits] core.git: cui/source cui/uiconfig

Caolán McNamara caolanm at redhat.com
Mon Sep 2 04:39:41 PDT 2013


 cui/source/options/optjava.cxx         |   33 ++++-----------------------------
 cui/uiconfig/ui/javaclasspathdialog.ui |   21 ++++++++-------------
 2 files changed, 12 insertions(+), 42 deletions(-)

New commits:
commit 0025012cbff19f01678119cfaeed7a76446edefa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 2 12:36:01 2013 +0100

    we can ditch the manual button sizing now its .ui converted
    
    Change-Id: I2c4b95ef170509d2adb4ebab3d7b3ed2d8362a26

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index aa1837c..4dfc7a5 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -52,7 +52,6 @@
 // define ----------------------------------------------------------------
 
 #define CLASSPATH_DELIMITER SAL_PATHSEPARATOR
-#define BUTTON_BORDER       2
 #define RESET_TIMEOUT       300
 
 using namespace ::com::sun::star::lang;
@@ -919,12 +918,12 @@ void SvxJavaParameterDlg::SetParameters( Sequence< OUString >& rParams )
 
 // class SvxJavaClassPathDlg ---------------------------------------------
 
-SvxJavaClassPathDlg::SvxJavaClassPathDlg( Window* pParent ) :
-
-    ModalDialog( pParent, "JavaClassPath", "cui/ui/javaclasspathdialog.ui" )
+SvxJavaClassPathDlg::SvxJavaClassPathDlg(Window* pParent)
+    : ModalDialog(pParent, "JavaClassPath", "cui/ui/javaclasspathdialog.ui")
 {
-
     get( m_pPathList, "paths");
+    m_pPathList->SetDropDownLineCount(8);
+    m_pPathList->set_width_request(m_pPathList->approximate_char_width() * 54);
     get( m_pAddArchiveBtn, "archive");
     get( m_pAddPathBtn, "folder");
     get( m_pRemoveBtn, "remove");
@@ -934,30 +933,6 @@ SvxJavaClassPathDlg::SvxJavaClassPathDlg( Window* pParent ) :
     m_pRemoveBtn->SetClickHdl( LINK( this, SvxJavaClassPathDlg, RemoveHdl_Impl ) );
     m_pPathList->SetSelectHdl( LINK( this, SvxJavaClassPathDlg, SelectHdl_Impl ) );
 
-    // check if the buttons text are not too wide otherwise we have to stretch the buttons
-    // and shrink the listbox
-    long nTxtWidth1 = m_pAddArchiveBtn->GetTextWidth( m_pAddArchiveBtn->GetText() );
-    long nTxtWidth2 = m_pAddPathBtn->GetTextWidth( m_pAddPathBtn->GetText() );
-    Size aBtnSz = m_pAddArchiveBtn->GetSizePixel();
-    if ( nTxtWidth1 > aBtnSz.Width() || nTxtWidth2 > aBtnSz.Width() )
-    {
-        long nW = ( nTxtWidth1 > aBtnSz.Width() ) ? nTxtWidth1 : nTxtWidth2;
-        long nDelta = nW - aBtnSz.Width() + 2 * BUTTON_BORDER;
-        aBtnSz.Width() += nDelta;
-        Point aBtnPnt = m_pAddArchiveBtn->GetPosPixel();
-        aBtnPnt.X() -= nDelta;
-        m_pAddArchiveBtn->SetPosSizePixel( aBtnPnt, aBtnSz );
-        aBtnPnt = m_pAddPathBtn->GetPosPixel();
-        aBtnPnt.X() -= nDelta;
-        m_pAddPathBtn->SetPosSizePixel( aBtnPnt, aBtnSz );
-        aBtnPnt = m_pRemoveBtn->GetPosPixel();
-        aBtnPnt.X() -= nDelta;
-        m_pRemoveBtn->SetPosSizePixel( aBtnPnt, aBtnSz );
-        Size aBoxSz = m_pPathList->GetSizePixel();
-        aBoxSz.Width() -= nDelta;
-        m_pPathList->SetSizePixel( aBoxSz );
-    }
-
     // set initial focus to path list
     m_pPathList->GrabFocus();
 }
diff --git a/cui/uiconfig/ui/javaclasspathdialog.ui b/cui/uiconfig/ui/javaclasspathdialog.ui
index a1c0716..56c9849 100644
--- a/cui/uiconfig/ui/javaclasspathdialog.ui
+++ b/cui/uiconfig/ui/javaclasspathdialog.ui
@@ -18,13 +18,11 @@
             <child>
               <object class="GtkButton" id="ok">
                 <property name="label">gtk-ok</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="has_default">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -36,11 +34,9 @@
             <child>
               <object class="GtkButton" id="cancel">
                 <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -52,11 +48,9 @@
             <child>
               <object class="GtkButton" id="help">
                 <property name="label">gtk-help</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -77,13 +71,17 @@
           <object class="GtkBox" id="box1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkBox" id="box3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
                 <property name="orientation">vertical</property>
-                <property name="spacing">12</property>
+                <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
@@ -91,6 +89,7 @@
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">A_ssigned folders and archives</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">paths:border</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -103,6 +102,8 @@
                     <property name="width_request">1</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
                     <property name="shadow_type">in</property>
                     <child>
                       <object class="GtkTreeView" id="paths:border">
@@ -138,11 +139,9 @@
                 <child>
                   <object class="GtkButton" id="archive">
                     <property name="label" translatable="yes">_Add Archive...</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="use_underline">True</property>
                   </object>
                   <packing>
@@ -154,11 +153,9 @@
                 <child>
                   <object class="GtkButton" id="folder">
                     <property name="label" translatable="yes">Add _Folder</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="use_underline">True</property>
                   </object>
                   <packing>
@@ -170,11 +167,9 @@
                 <child>
                   <object class="GtkButton" id="remove">
                     <property name="label" translatable="yes">_Remove</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="use_underline">True</property>
                   </object>
                   <packing>


More information about the Libreoffice-commits mailing list