[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/inc vcl/source vcl/uiconfig

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 11 10:41:24 UTC 2020


 vcl/inc/printdlg.hxx           |    1 +
 vcl/source/window/printdlg.cxx |    6 ++++++
 vcl/uiconfig/ui/printdialog.ui |    2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 22d83f0e2ce15f95675e2022c45c36e6d892c076
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Nov 10 17:33:20 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Nov 11 11:40:43 2020 +0100

    lock print dialog height so expanders don't expand the dialog
    
    but instead can make use of the scrolledwindow
    
    Change-Id: I9a820e077dce8090e6c5d876874dc1babbbd6808
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105565
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit c44155d3f8bc2037a41d221463d460138b3ecdf9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105534

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 7c6c1005fd12..c313e8fc4856 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -131,6 +131,7 @@ namespace vcl
         std::unique_ptr<MoreOptionsDialog>      mxMoreOptionsDlg;
 
         std::unique_ptr<weld::Notebook>         mxTabCtrl;
+        std::unique_ptr<weld::ScrolledWindow>   mxScrolledWindow;
         std::unique_ptr<weld::Frame>            mxPageLayoutFrame;
         std::unique_ptr<weld::ComboBox>         mxPrinters;
         std::unique_ptr<weld::Label>            mxStatusTxt;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 820d9f9ee7e8..d0f3c67a6c7f 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -520,6 +520,7 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptr<PrinterC
     : GenericDialogController(i_pWindow, "vcl/ui/printdialog.ui", "PrintDialog")
     , maPController( i_rController )
     , mxTabCtrl(m_xBuilder->weld_notebook("tabcontrol"))
+    , mxScrolledWindow(m_xBuilder->weld_scrolled_window("scrolledwindow"))
     , mxPageLayoutFrame(m_xBuilder->weld_frame("layoutframe"))
     , mxPrinters(m_xBuilder->weld_combo_box("printersbox"))
     , mxStatusTxt(m_xBuilder->weld_label("status"))
@@ -700,6 +701,11 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptr<PrinterC
     mxLayoutExpander->connect_expanded(LINK( this, PrintDialog, ExpandHdl));
 
     updateNupFromPages();
+
+    // lock the dialog height, regardless of later expander state
+    mxScrolledWindow->set_size_request(
+        mxScrolledWindow->get_preferred_size().Width() + mxScrolledWindow->get_vscroll_width(),
+        mxScrolledWindow->get_preferred_size().Height());
 }
 
 IMPL_LINK_NOARG(PrintDialog, ExpandHdl, weld::Expander&, void)
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index 1b7316d8fd2c..e78d88d4e036 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -341,7 +341,7 @@
                 <property name="margin_left">6</property>
                 <property name="vexpand">True</property>
                 <child>
-                  <object class="GtkScrolledWindow">
+                  <object class="GtkScrolledWindow" id="scrolledwindow">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="hscrollbar_policy">never</property>


More information about the Libreoffice-commits mailing list