[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - include/vcl vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 12 12:09:36 UTC 2018


 include/vcl/window.hxx       |    2 ++
 vcl/inc/messagedialog.hxx    |    2 ++
 vcl/source/window/layout.cxx |   14 ++++++++++++++
 3 files changed, 18 insertions(+)

New commits:
commit 8ef6623c71317448acc74d5dc8648211673dce76
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 8 17:21:30 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Nov 12 13:09:14 2018 +0100

    Resolves: tdf#121181 expand message boxes to show full title
    
    as MsgBox used to do
    
    Change-Id: I03d459b8c18f60a19ea5b0034a8d98f6aa4f5ce4
    Reviewed-on: https://gerrit.libreoffice.org/63159
    Tested-by: Jenkins
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8ba941422514..3a3ea99d2c0f 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -443,6 +443,7 @@ class SystemWindow;
 class WorkWindow;
 class Dialog;
 class MessBox;
+class MessageDialog;
 class DockingWindow;
 class FloatingWindow;
 class GroupBox;
@@ -505,6 +506,7 @@ class VCL_DLLPUBLIC Window : public ::OutputDevice
     friend class ::WorkWindow;
     friend class ::Dialog;
     friend class ::MessBox;
+    friend class ::MessageDialog;
     friend class ::DockingWindow;
     friend class ::FloatingWindow;
     friend class ::GroupBox;
diff --git a/vcl/inc/messagedialog.hxx b/vcl/inc/messagedialog.hxx
index cf1df6ed68aa..7b191e538704 100644
--- a/vcl/inc/messagedialog.hxx
+++ b/vcl/inc/messagedialog.hxx
@@ -35,6 +35,8 @@ private:
     friend class VclPtr<MessageDialog>;
     MessageDialog(vcl::Window* pParent, WinBits nStyle);
 
+    virtual void StateChanged(StateChangedType nType) override;
+
 public:
     MessageDialog(vcl::Window* pParent, const OUString& rMessage, VclMessageType eMessageType,
                   VclButtonsType eButtonsType);
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 44b8777dba78..6b7e13b63e00 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2492,6 +2492,20 @@ void MessageDialog::set_secondary_text(const OUString &rSecondaryString)
     }
 }
 
+void MessageDialog::StateChanged(StateChangedType nType)
+{
+    if (nType == StateChangedType::InitShow)
+    {
+        // MessageBox should be at least as wide as to see the title
+        auto nTitleWidth = CalcTitleWidth();
+        // Extra-Width for Close button
+        nTitleWidth += mpWindowImpl->mnTopBorder;
+        if (get_preferred_size().Width() < nTitleWidth)
+            set_width_request(nTitleWidth);
+    }
+    Dialog::StateChanged(nType);
+}
+
 VclVPaned::VclVPaned(vcl::Window *pParent)
     : VclContainer(pParent, WB_HIDE | WB_CLIPCHILDREN)
     , m_pSplitter(VclPtr<Splitter>::Create(this, WB_VSCROLL))


More information about the Libreoffice-commits mailing list