summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2019-10-03 15:28:46 -0800
committerCaolán McNamara <caolanm@redhat.com>2019-10-05 16:16:48 +0200
commit623c0cff7589e3f2298c16c7402cf160b99fabe2 (patch)
treef452f9d1033572cc306d423669163af1525baefe /cui
parent588dceaa3858ce96172d968be21ee5c7ad401e44 (diff)
tdf#127935 Make double click expand/collapse entry in option tree
Also makes keyboard use to expand/collapse work Change-Id: I5b9d065ebe4a612ebe9658feb9ff71c504de7982 Reviewed-on: https://gerrit.libreoffice.org/80173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/treeopt.hxx1
-rw-r--r--cui/source/options/treeopt.cxx9
2 files changed, 10 insertions, 0 deletions
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index aa6f7f5b0a02..1042b68877e3 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -159,6 +159,7 @@ private:
void ApplyOptions( bool deactivate );
+ DECL_STATIC_LINK(OfaTreeOptionsDialog, ExpandCollapseHdl_Impl, weld::TreeView&, void);
DECL_LINK(ShowPageHdl_Impl, weld::TreeView&, void);
DECL_LINK(BackHdl_Impl, weld::Button&, void);
DECL_LINK(ApplyHdl_Impl, weld::Button&, void);
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 845e7651ad68..ab802ecaa63b 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -608,6 +608,14 @@ sal_uInt16 OfaTreeOptionsDialog::AddGroup(const OUString& rGroupName,
return nRet - 1;
}
+IMPL_STATIC_LINK(OfaTreeOptionsDialog, ExpandCollapseHdl_Impl, weld::TreeView&, xTreeView, void)
+{
+ std::unique_ptr<weld::TreeIter> xEntry(xTreeView.make_iterator());
+ xTreeView.get_selected(xEntry.get());
+ if (xTreeView.iter_has_child(*xEntry))
+ xTreeView.get_row_expanded(*xEntry) ? xTreeView.collapse_row(*xEntry) : xTreeView.expand_row(*xEntry);
+}
+
IMPL_LINK_NOARG(OfaTreeOptionsDialog, ShowPageHdl_Impl, weld::TreeView&, void)
{
SelectHdl_Impl();
@@ -741,6 +749,7 @@ void OfaTreeOptionsDialog::ApplyItemSets()
void OfaTreeOptionsDialog::InitTreeAndHandler()
{
xTreeLB->set_help_id(HID_OFADLG_TREELISTBOX);
+ xTreeLB->connect_row_activated( LINK( this, OfaTreeOptionsDialog, ExpandCollapseHdl_Impl ) );
xTreeLB->connect_changed( LINK( this, OfaTreeOptionsDialog, ShowPageHdl_Impl ) );
xBackPB->connect_clicked( LINK( this, OfaTreeOptionsDialog, BackHdl_Impl ) );
xApplyPB->connect_clicked( LINK( this, OfaTreeOptionsDialog, ApplyHdl_Impl ) );