we can ditch the manual button sizing now its .ui converted
Change-Id: I2c4b95ef170509d2adb4ebab3d7b3ed2d8362a26
This commit is contained in:
@@ -52,7 +52,6 @@
|
|||||||
// define ----------------------------------------------------------------
|
// define ----------------------------------------------------------------
|
||||||
|
|
||||||
#define CLASSPATH_DELIMITER SAL_PATHSEPARATOR
|
#define CLASSPATH_DELIMITER SAL_PATHSEPARATOR
|
||||||
#define BUTTON_BORDER 2
|
|
||||||
#define RESET_TIMEOUT 300
|
#define RESET_TIMEOUT 300
|
||||||
|
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
@@ -919,12 +918,12 @@ void SvxJavaParameterDlg::SetParameters( Sequence< OUString >& rParams )
|
|||||||
|
|
||||||
// class SvxJavaClassPathDlg ---------------------------------------------
|
// class SvxJavaClassPathDlg ---------------------------------------------
|
||||||
|
|
||||||
SvxJavaClassPathDlg::SvxJavaClassPathDlg( Window* pParent ) :
|
SvxJavaClassPathDlg::SvxJavaClassPathDlg(Window* pParent)
|
||||||
|
: ModalDialog(pParent, "JavaClassPath", "cui/ui/javaclasspathdialog.ui")
|
||||||
ModalDialog( pParent, "JavaClassPath", "cui/ui/javaclasspathdialog.ui" )
|
|
||||||
{
|
{
|
||||||
|
|
||||||
get( m_pPathList, "paths");
|
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_pAddArchiveBtn, "archive");
|
||||||
get( m_pAddPathBtn, "folder");
|
get( m_pAddPathBtn, "folder");
|
||||||
get( m_pRemoveBtn, "remove");
|
get( m_pRemoveBtn, "remove");
|
||||||
@@ -934,30 +933,6 @@ SvxJavaClassPathDlg::SvxJavaClassPathDlg( Window* pParent ) :
|
|||||||
m_pRemoveBtn->SetClickHdl( LINK( this, SvxJavaClassPathDlg, RemoveHdl_Impl ) );
|
m_pRemoveBtn->SetClickHdl( LINK( this, SvxJavaClassPathDlg, RemoveHdl_Impl ) );
|
||||||
m_pPathList->SetSelectHdl( LINK( this, SvxJavaClassPathDlg, SelectHdl_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
|
// set initial focus to path list
|
||||||
m_pPathList->GrabFocus();
|
m_pPathList->GrabFocus();
|
||||||
}
|
}
|
||||||
|
@@ -18,13 +18,11 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="ok">
|
<object class="GtkButton" id="ok">
|
||||||
<property name="label">gtk-ok</property>
|
<property name="label">gtk-ok</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="can_default">True</property>
|
<property name="can_default">True</property>
|
||||||
<property name="has_default">True</property>
|
<property name="has_default">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -36,11 +34,9 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="cancel">
|
<object class="GtkButton" id="cancel">
|
||||||
<property name="label">gtk-cancel</property>
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -52,11 +48,9 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="help">
|
<object class="GtkButton" id="help">
|
||||||
<property name="label">gtk-help</property>
|
<property name="label">gtk-help</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -77,13 +71,17 @@
|
|||||||
<object class="GtkBox" id="box1">
|
<object class="GtkBox" id="box1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box3">
|
<object class="GtkBox" id="box3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">12</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="label1">
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -91,6 +89,7 @@
|
|||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">A_ssigned folders and archives</property>
|
<property name="label" translatable="yes">A_ssigned folders and archives</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
<property name="mnemonic_widget">paths:border</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@@ -103,6 +102,8 @@
|
|||||||
<property name="width_request">1</property>
|
<property name="width_request">1</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeView" id="paths:border">
|
<object class="GtkTreeView" id="paths:border">
|
||||||
@@ -138,11 +139,9 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="archive">
|
<object class="GtkButton" id="archive">
|
||||||
<property name="label" translatable="yes">_Add Archive...</property>
|
<property name="label" translatable="yes">_Add Archive...</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -154,11 +153,9 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="folder">
|
<object class="GtkButton" id="folder">
|
||||||
<property name="label" translatable="yes">Add _Folder</property>
|
<property name="label" translatable="yes">Add _Folder</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -170,11 +167,9 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="remove">
|
<object class="GtkButton" id="remove">
|
||||||
<property name="label" translatable="yes">_Remove</property>
|
<property name="label" translatable="yes">_Remove</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
Reference in New Issue
Block a user