From fa412876add97cab38d404723c49d35775f8efea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 10 Jan 2020 17:27:04 +0000 Subject: Related: tdf#127782 resize the print dialog to its optimum size... after expander is activated Change-Id: I3f87243f0502829e048173987c8998898d351adf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86575 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- vcl/inc/printdlg.hxx | 4 ++++ vcl/source/window/printdlg.cxx | 9 +++++++++ vcl/uiconfig/ui/printdialog.ui | 2 -- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 9facdcf9e620..4b6772a17eb8 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -186,6 +186,8 @@ namespace vcl std::unique_ptr mxNupOrderWin; /// border around each page std::unique_ptr mxBorderCB; + std::unique_ptr mxRangeExpander; + std::unique_ptr mxLayoutExpander; std::unique_ptr mxCustom; OUString const maPrintToFileText; @@ -234,6 +236,8 @@ namespace vcl DECL_LINK( UIOption_SpinModifyHdl, weld::SpinButton&, void ); DECL_LINK( UIOption_EntryModifyHdl, weld::Entry&, void ); + DECL_LINK( ExpandHdl, weld::Expander&, void ); + css::beans::PropertyValue* getValueForWindow(weld::Widget*) const; void preparePreview( bool i_bMayUseCache ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index b42a1ce41213..cbba1ac3f562 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -566,6 +566,8 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptrweld_check_button("bordercb")) + , mxRangeExpander(m_xBuilder->weld_expander("exRangeExpander")) + , mxLayoutExpander(m_xBuilder->weld_expander("exLayoutExpander")) , mxCustom(m_xBuilder->weld_widget("customcontents")) , maPrintToFileText( VclResId( SV_PRINT_TOFILE_TXT ) ) , maDefPrtText( VclResId( SV_PRINT_DEFPRT_TXT ) ) @@ -695,9 +697,16 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptrconnect_value_changed( LINK( this, PrintDialog, MetricSpinModifyHdl ) ); mxSheetMarginEdt->connect_value_changed( LINK( this, PrintDialog, MetricSpinModifyHdl ) ); + mxRangeExpander->connect_expanded(LINK( this, PrintDialog, ExpandHdl)); + mxLayoutExpander->connect_expanded(LINK( this, PrintDialog, ExpandHdl)); + updateNupFromPages(); } +IMPL_LINK_NOARG(PrintDialog, ExpandHdl, weld::Expander&, void) +{ + m_xDialog->resize_to_request(); +} PrintDialog::~PrintDialog() { diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui index fc98a18a89a9..d4de5956f3cc 100644 --- a/vcl/uiconfig/ui/printdialog.ui +++ b/vcl/uiconfig/ui/printdialog.ui @@ -596,7 +596,6 @@ True True True - True True @@ -875,7 +874,6 @@ True True True - True True -- cgit