[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - vcl/inc vcl/source vcl/uiconfig
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 15 19:39:15 UTC 2019
vcl/inc/printdlg.hxx | 1 +
vcl/source/window/printdlg.cxx | 7 +++++++
vcl/uiconfig/ui/printdialog.ui | 2 --
3 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit e2e7bd4fdf6a6312791318f0687e8d1cfcbb1cbb
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 15 13:25:02 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Nov 15 20:36:40 2019 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 33f9a7be94f4..5e8289d6b4d1 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -74,6 +74,7 @@ namespace vcl
PrintPreviewWindow(PrintDialog* pDialog);
virtual ~PrintPreviewWindow() override;
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
virtual bool Command( const CommandEvent& ) override;
virtual void Resize() override;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 7750baf5039d..4a7105a777c9 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -145,6 +145,13 @@ void PrintDialog::PrintPreviewWindow::Resize()
preparePreviewBitmap();
}
+void PrintDialog::PrintPreviewWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 55,
+ pDrawingArea->get_text_height() * 40);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
+}
+
void PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
rRenderContext.Push();
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index d346bee170e9..1822f688a1c9 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -166,8 +166,6 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkDrawingArea" 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>
<property name="events">GDK_STRUCTURE_MASK | GDK_SCROLL_MASK</property>
More information about the Libreoffice-commits
mailing list