summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-23 15:46:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-24 10:05:22 +0100
commitf89ea2f4def2020f7c7b0782e21d701013dcc669 (patch)
tree64d4a0e8f75a65d28959ca801ec03a566b784420 /cui
parent80bf2654d72995f6b13c5addcd7c5e89ec76b0d9 (diff)
strip SetPosSizeCtrls down to min required
Change-Id: I8c198f9d1b318b35e0dc6221291bb4a57805e3ae
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/iconcdlg.cxx89
-rw-r--r--cui/source/inc/iconcdlg.hxx1
-rw-r--r--cui/uiconfig/ui/hyperlinkdialog.ui15
3 files changed, 11 insertions, 94 deletions
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 0d47c7bb7164..bbd8a529427b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -250,7 +250,7 @@ IconChoiceDialog::IconChoiceDialog ( Window* pParent, const OString& rID,
m_pHelpBtn->Show();
m_pResetBtn->Show();
- SetPosSizeCtrls ( true );
+ m_pIconCtrl->ArrangeIcons();
}
@@ -361,7 +361,7 @@ void IconChoiceDialog::SetCtrlPos()
aWinBits |= WB_ALIGN_LEFT | WB_NOHSCROLL;
m_pIconCtrl->SetStyle ( aWinBits );
- SetPosSizeCtrls();
+ m_pIconCtrl->ArrangeIcons();
}
/**********************************************************************
@@ -405,97 +405,14 @@ void IconChoiceDialog::ShowPage( sal_uInt16 nId )
| Resize Dialog
|
\**********************************************************************/
-
-#define ICONCTRL_WIDTH_PIXEL 110
-
void IconChoiceDialog::Resize()
{
Dialog::Resize ();
if ( IsReallyVisible() )
{
- SetPosSizeCtrls ();
- }
-}
-
-void IconChoiceDialog::SetPosSizeCtrls ( bool bInit )
-{
- const Point aCtrlOffset ( LogicToPixel( Point( CTRLS_OFFSET, CTRLS_OFFSET ), MAP_APPFONT ) );
- Size aOutSize ( GetOutputSizePixel() );
-
-
- // Button-Defaults
-
- Size aDefaultButtonSize = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
-
- // Reset-Button
- Size aResetButtonSize ( bInit ? aDefaultButtonSize :
- m_pResetBtn->GetSizePixel () );
-
-
- // IconChoiceCtrl resizen & positionieren
-
- SvtTabAppearanceCfg aCfg;
- const long nDefaultWidth = (aCfg.GetScaleFactor() * ICONCTRL_WIDTH_PIXEL) / 100;
-
- Point aIconCtrlPos(aCtrlOffset);
- Size aNewIconCtrlSize( nDefaultWidth,
- aOutSize.Height()-(2*aCtrlOffset.X()) );
- m_pIconCtrl->SetPosSizePixel ( aIconCtrlPos, aNewIconCtrlSize );
- m_pIconCtrl->ArrangeIcons();
-
-
- // resize & position the pages
-
- for ( size_t i = 0; i < maPageList.size(); i++ )
- {
- IconChoicePageData* pData = maPageList[ i ];
-
- Point aNewPagePos( aNewIconCtrlSize.Width() + (2*CTRLS_OFFSET),
- CTRLS_OFFSET );
- Size aNewPageSize( aOutSize.Width() - aNewIconCtrlSize.Width() -
- (3*CTRLS_OFFSET),
- aOutSize.Height() - m_pOKBtn->GetSizePixel().Height() -
- (3*CTRLS_OFFSET) );
-
- if ( pData->pPage )
- pData->pPage->SetPosSizePixel ( aNewPagePos, aNewPageSize );
+ m_pIconCtrl->ArrangeIcons();
}
-
-
- // position the buttons
- m_pResetBtn->SetPosSizePixel ( Point( aOutSize.Width() -
- aResetButtonSize.Width()-aCtrlOffset.X(),
- aOutSize.Height()-aResetButtonSize.Height()-
- aCtrlOffset.X() ),
- aResetButtonSize );
- // Help-Button
- Size aHelpButtonSize ( bInit ? aDefaultButtonSize :
- m_pHelpBtn->GetSizePixel () );
- m_pHelpBtn->SetPosSizePixel ( Point( aOutSize.Width()-aResetButtonSize.Width()-
- aHelpButtonSize.Width() -
- (2*aCtrlOffset.X()),
- aOutSize.Height()-aHelpButtonSize.Height()-
- aCtrlOffset.X() ),
- aHelpButtonSize );
- // Cancel-Button
- Size aCancelButtonSize ( bInit ? aDefaultButtonSize :
- m_pCancelBtn->GetSizePixel () );
- m_pCancelBtn->SetPosSizePixel ( Point( aOutSize.Width()-aCancelButtonSize.Width()-
- aResetButtonSize.Width()-aHelpButtonSize.Width()-
- (3*aCtrlOffset.X()),
- aOutSize.Height()-aCancelButtonSize.Height()-
- aCtrlOffset.X() ),
- aCancelButtonSize );
- // OK-Button
- Size aOKButtonSize ( bInit ? aDefaultButtonSize : m_pOKBtn->GetSizePixel () );
- m_pOKBtn->SetPosSizePixel ( Point( aOutSize.Width()-aOKButtonSize.Width()-
- aCancelButtonSize.Width()-aResetButtonSize.Width()-
- aHelpButtonSize.Width()-(4*aCtrlOffset.X()),
- aOutSize.Height()-aOKButtonSize.Height()-aCtrlOffset.X() ),
- aOKButtonSize );
-
- Invalidate();
}
void IconChoiceDialog::SetPosSizePages ( sal_uInt16 nId )
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 30effcc27bc3..b0e6408f2025 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -161,7 +161,6 @@ private :
void Start_Impl();
bool OK_Impl();
- void SetPosSizeCtrls ( bool bInit = false );
void SetPosSizePages ( sal_uInt16 nId );
void FocusOnIcon ( sal_uInt16 nId );
diff --git a/cui/uiconfig/ui/hyperlinkdialog.ui b/cui/uiconfig/ui/hyperlinkdialog.ui
index b2757e43a17f..d547d6e84640 100644
--- a/cui/uiconfig/ui/hyperlinkdialog.ui
+++ b/cui/uiconfig/ui/hyperlinkdialog.ui
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
+ <!-- interface-requires LibreOffice 1.0 -->
<object class="GtkDialog" id="HyperlinkDialog">
<property name="width_request">550</property>
<property name="height_request">400</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">5</property>
+ <property name="border_width">6</property>
<property name="title" translatable="yes">Hyperlink</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
@@ -27,8 +29,9 @@
<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>
@@ -44,7 +47,6 @@
<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>
@@ -60,7 +62,6 @@
<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>
@@ -76,7 +77,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -101,9 +101,10 @@
<property name="spacing">6</property>
<child>
<object class="cuilo-SvtIconChoiceCtrl" id="icon_control">
+ <property name="width_request">110</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
+ <property name="margin">0</property>
<property name="vexpand">True</property>
</object>
<packing>