Kaydet (Commit) a2e9836a authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Adolfo Jayme Barrientos

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/67943
Tested-by: Jenkins
Reviewed-by: 's avatarAdolfo Jayme Barrientos <fitojb@ubuntu.com>
üst 041bd04d
...@@ -107,7 +107,24 @@ namespace dbp ...@@ -107,7 +107,24 @@ namespace dbp
virtual void dispose() override; virtual void dispose() override;
protected: 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 // OWizardPage overridables
virtual void initializePage() override; virtual void initializePage() override;
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="max_width_chars">82</property>
<accessibility> <accessibility>
<role type="static"/> <role type="static"/>
</accessibility> </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