summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-15 13:25:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-18 18:01:56 +0100
commit4cf00f070fa5771bf5e6382cffe933beb65ca4b8 (patch)
tree19ac0c954be65480240c3b6d097986add4531e0e
parent9a21a3295c57f5692c5cf9b14f7342138a38e3db (diff)
tdf#128495 measure preferred size of print preview relative to UI font
Change-Id: If04f50818fc94dd62263daaebc1c386b2d85c987 Reviewed-on: https://gerrit.libreoffice.org/82791 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/83068
-rw-r--r--vcl/source/window/printdlg.cxx3
-rw-r--r--vcl/uiconfig/ui/printdialog.ui2
2 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index c1365e887526..d0448f797927 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -124,6 +124,9 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( vcl::Window* i_pParent )
, maHorzDim(VclPtr<FixedLine>::Create(this, WB_HORZ | WB_CENTER))
, maVertDim(VclPtr<FixedLine>::Create(this, WB_VERT | WB_VCENTER))
{
+ set_width_request(approximate_digit_width() * 55);
+ set_height_request(GetTextHeight() * 40);
+
SetPaintTransparent( true );
SetBackground();
maHorzDim->Show();
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index bdcf861f83bd..e20005bfc353 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -225,8 +225,6 @@
<property name="orientation">vertical</property>
<child>
<object class="vcllo-PrintPreviewWindow" id="preview">
- <property name="width_request">500</property>
- <property name="height_request">700</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>