[Libreoffice-commits] core.git: cui/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 5 14:17:44 UTC 2019


 cui/source/inc/treeopt.hxx     |    1 +
 cui/source/options/treeopt.cxx |    9 +++++++++
 2 files changed, 10 insertions(+)

New commits:
commit 623c0cff7589e3f2298c16c7402cf160b99fabe2
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Oct 3 15:28:46 2019 -0800
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 5 16:16:48 2019 +0200

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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 ) );


More information about the Libreoffice-commits mailing list