summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/layout.hxx1
-rw-r--r--vcl/source/window/layout.cxx19
2 files changed, 20 insertions, 0 deletions
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index ede844e7d8df..f72b93a1cd37 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -516,6 +516,7 @@ public:
virtual Window *get_child();
virtual const Window *get_child() const;
virtual bool set_property(const OString &rKey, const OString &rValue);
+ virtual void StateChanged(StateChangedType nType);
protected:
virtual Size calculateRequisition() const;
virtual void setAllocation(const Size &rAllocation);
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 2f1d404c7da2..179467137c38 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1468,6 +1468,25 @@ bool VclExpander::set_property(const OString &rKey, const OString &rValue)
return true;
}
+void VclExpander::StateChanged(StateChangedType nType)
+{
+ VclBin::StateChanged( nType );
+
+ if (nType == STATE_CHANGE_INITSHOW)
+ {
+ //The label widget is the last (of two) children
+ Window *pChild = get_child();
+ WindowImpl* pWindowImpl = ImplGetWindowImpl();
+ Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild : NULL;
+ if (pLabel && pLabel->GetType() == WINDOW_FIXEDTEXT)
+ {
+ FixedText *pLabelWidget = static_cast<FixedText*>(pLabel);
+ if (!pLabelWidget->get_mnemonic_widget())
+ pLabelWidget->set_mnemonic_widget(&m_aDisclosureButton);
+ }
+ }
+}
+
IMPL_LINK( VclExpander, ClickHdl, DisclosureButton*, pBtn )
{
Window *pChild = get_child();