summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-08 17:21:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-09 09:59:41 +0100
commit0120dfb12bcc8f86f256f8f56410215c1828e578 (patch)
tree3a6af29bdd5c73ca3b8af68cdad054ee639e0c3f
parenta75b8e11664b14884fafac32f1dba678537cd3dc (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/inc/messagedialog.hxx2
-rw-r--r--vcl/source/window/layout.cxx14
3 files changed, 18 insertions, 0 deletions
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))