diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-08 17:21:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-09 09:59:41 +0100 |
commit | 0120dfb12bcc8f86f256f8f56410215c1828e578 (patch) | |
tree | 3a6af29bdd5c73ca3b8af68cdad054ee639e0c3f /vcl | |
parent | a75b8e11664b14884fafac32f1dba678537cd3dc (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>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/messagedialog.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 14 |
2 files changed, 16 insertions, 0 deletions
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)) |