summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-10 16:18:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-10 21:06:36 +0100
commita9eab8cef6f241b453c1dba30b0ebf2f61853301 (patch)
treec13218fc8f996e082b3716eeb9f44c232d812fec
parentc44155d3f8bc2037a41d221463d460138b3ecdf9 (diff)
allow VclBuilder to set expander label attributes
Change-Id: I0b78db778d230509e6bbb59d965540a5f5d6f3de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105559 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/layout.hxx2
-rw-r--r--vcl/source/window/builder.cxx2
-rw-r--r--vcl/source/window/layout.cxx11
3 files changed, 15 insertions, 0 deletions
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index e91bb629ff1d..d2c5893ed516 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -484,6 +484,8 @@ public:
bool get_expanded() const;
void set_expanded(bool bExpanded);
void set_label(const OUString& rLabel);
+ vcl::Window *get_label_widget();
+ const vcl::Window *get_label_widget() const;
virtual void StateChanged(StateChangedType nType) override;
void SetExpandedHdl( const Link<VclExpander&,void>& rLink ) { maExpandedHdl = rLink; }
private:
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 930dbfaab600..d50444f1f3f4 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -782,6 +782,8 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
{
FixedText *pLabelWidget = static_cast<FixedText*>(pLabel);
elem->set_label(pLabelWidget->GetText());
+ if (pLabelWidget->IsControlFont())
+ elem->get_label_widget()->SetControlFont(pLabelWidget->GetControlFont());
delete_by_window(pLabel);
}
}
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 6cbc00e05e72..d4b89b7c51a0 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1773,6 +1773,17 @@ void VclExpander::StateChanged(StateChangedType nType)
}
}
+const vcl::Window *VclExpander::get_label_widget() const
+{
+ return m_pDisclosureButton;
+}
+
+vcl::Window *VclExpander::get_label_widget()
+{
+ return const_cast<vcl::Window*>(const_cast<const VclExpander*>(this)->get_label_widget());
+}
+
+
IMPL_LINK( VclExpander, ClickHdl, CheckBox&, rBtn, void )
{
vcl::Window *pChild = get_child();