Kaydet (Commit) 3bb5e0c6 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#122305 tdf#122307 wrap label based on current wizard width

rather than wrap on 82 characters, which is still too large for
the width we are given

Change-Id: I8bbb2d06d974f78d442cf59faebd29a8e22d7750
Reviewed-on: https://gerrit.libreoffice.org/67942
Tested-by: Jenkins
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
Tested-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
üst d9bde38c
......@@ -107,7 +107,24 @@ namespace dbp
virtual void dispose() override;
protected:
void setDescriptionText(const OUString& _rDesc) { m_pDescription->SetText(_rDesc); }
void setDescriptionText(const OUString& rDesc)
{
m_pDescription->set_width_request(-1);
m_pDescription->set_height_request(-1);
auto nWidthAvail = GetParent()->GetSizePixel().Width();
m_pDescription->SetText(rDesc);
//tdf#122307 wrap based on current wizard width
Size aPrefSize(m_pDescription->get_preferred_size());
Size aSize(m_pDescription->CalcMinimumSize(nWidthAvail));
if (aSize.Height() > aPrefSize.Height())
{
m_pDescription->set_width_request(aSize.Width());
m_pDescription->set_height_request(aSize.Height());
}
}
// OWizardPage overridables
virtual void initializePage() override;
......
......@@ -19,7 +19,6 @@
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="wrap">True</property>
<property name="max_width_chars">82</property>
<accessibility>
<role type="static"/>
</accessibility>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment