summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-12 11:40:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-12 11:40:55 +0100
commit479bba2cdcda8dbd86861ea62c8c25bfef633148 (patch)
treefa7293dfce2db9b08f12abdbb8a3e6ef78c80685
parent6c88ebe9aaf32b5c7c6e22270ee90091c019f567 (diff)
Related: fdo#66817 ensure VclExpander label is mnemonic for disclosure button
Change-Id: I11c9a35e3d50a827127e4542a40f6f29580d4e8b
-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();