[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 9 09:01:33 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 0120dfb12bcc8f86f256f8f56410215c1828e578
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: Fri Nov 9 09:59:41 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/63117
Tested-by: Jenkins
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 7975bd252df8..6557c45434d1 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 5b4fda5a231c..756409ef8a3f 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 10f28daa6a6f..9c5a8c89dc0e 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2479,6 +2479,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