diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-23 15:46:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-24 10:05:22 +0100 |
commit | f89ea2f4def2020f7c7b0782e21d701013dcc669 (patch) | |
tree | 64d4a0e8f75a65d28959ca801ec03a566b784420 /cui/source/dialogs | |
parent | 80bf2654d72995f6b13c5addcd7c5e89ec76b0d9 (diff) |
strip SetPosSizeCtrls down to min required
Change-Id: I8c198f9d1b318b35e0dc6221291bb4a57805e3ae
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r-- | cui/source/dialogs/iconcdlg.cxx | 89 |
1 files changed, 3 insertions, 86 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 ) |