From f89ea2f4def2020f7c7b0782e21d701013dcc669 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 23 Jun 2014 15:46:46 +0100 Subject: strip SetPosSizeCtrls down to min required Change-Id: I8c198f9d1b318b35e0dc6221291bb4a57805e3ae --- cui/source/dialogs/iconcdlg.cxx | 89 ++------------------------------------ cui/source/inc/iconcdlg.hxx | 1 - cui/uiconfig/ui/hyperlinkdialog.ui | 15 ++++--- 3 files changed, 11 insertions(+), 94 deletions(-) (limited to 'cui') 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 @@ + - + + 550 400 False True True - 5 + 6 Hyperlink dialog @@ -27,8 +29,9 @@ False True True + True + True True - False True @@ -44,7 +47,6 @@ True True True - False True @@ -60,7 +62,6 @@ True True True - False True @@ -76,7 +77,6 @@ True True True - False False @@ -101,9 +101,10 @@ 6 + 110 True False - True + 0 True -- cgit