From 0025012cbff19f01678119cfaeed7a76446edefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 2 Sep 2013 12:36:01 +0100 Subject: [PATCH] we can ditch the manual button sizing now its .ui converted Change-Id: I2c4b95ef170509d2adb4ebab3d7b3ed2d8362a26 --- cui/source/options/optjava.cxx | 33 ++++---------------------- cui/uiconfig/ui/javaclasspathdialog.ui | 21 +++++++--------- 2 files changed, 12 insertions(+), 42 deletions(-) diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index aa1837c3a3be..4dfc7a5a6e5b 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 a1c0716e04b8..56c984987291 100644 --- a/cui/uiconfig/ui/javaclasspathdialog.ui +++ b/cui/uiconfig/ui/javaclasspathdialog.ui @@ -18,13 +18,11 @@ gtk-ok - False True True True True True - False True @@ -36,11 +34,9 @@ gtk-cancel - False True True True - False True @@ -52,11 +48,9 @@ gtk-help - False True True True - False True @@ -77,13 +71,17 @@ True False + True + True 6 True False + True + True vertical - 12 + 6 True @@ -91,6 +89,7 @@ 0 A_ssigned folders and archives True + paths:border False @@ -103,6 +102,8 @@ 1 True True + True + True in @@ -138,11 +139,9 @@ _Add Archive... - False True True True - False True @@ -154,11 +153,9 @@ Add _Folder - False True True True - False True @@ -170,11 +167,9 @@ _Remove - False True True True - False True