diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-05 18:36:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-06 22:14:17 +0200 |
commit | 48595c805dd5b917e9bd01ad1c2deb4a047c5f7b (patch) | |
tree | f1dd7b638b78694cd5ac635e0de6be3ca1d13042 /include | |
parent | 4b28b77eddfe48e709180f1ab81ac0d996796471 (diff) |
Related: tdf#127935 set default activate handler to toggle row expansion
Change-Id: I2bbfb1445b8d2e748f642cdf4723d41b7f072e2b
Reviewed-on: https://gerrit.libreoffice.org/80305
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/new.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/newstyle.hxx | 2 | ||||
-rw-r--r-- | include/svx/ClassificationDialog.hxx | 6 | ||||
-rw-r--r-- | include/svx/txencbox.hxx | 2 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 15 |
5 files changed, 17 insertions, 10 deletions
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx index 9792fc503ee8..54e66528e470 100644 --- a/include/sfx2/new.hxx +++ b/include/sfx2/new.hxx @@ -85,7 +85,7 @@ private: DECL_LINK(RegionSelect, weld::TreeView&, void); DECL_LINK(TemplateSelect, weld::TreeView&, void); - DECL_LINK(DoubleClick, weld::TreeView&, void); + DECL_LINK(DoubleClick, weld::TreeView&, bool); DECL_LINK(Expand, weld::Expander&, void); sal_uInt16 GetSelectedTemplatePos() const; diff --git a/include/sfx2/newstyle.hxx b/include/sfx2/newstyle.hxx index 8e7489881c47..72569f4b45fd 100644 --- a/include/sfx2/newstyle.hxx +++ b/include/sfx2/newstyle.hxx @@ -36,7 +36,7 @@ private: std::unique_ptr<weld::MessageDialog> m_xQueryOverwriteBox; - DECL_DLLPRIVATE_LINK(OKHdl, weld::TreeView&, void); + DECL_DLLPRIVATE_LINK(OKHdl, weld::TreeView&, bool); DECL_DLLPRIVATE_LINK(OKClickHdl, weld::Button&, void); DECL_DLLPRIVATE_LINK(ModifyHdl, weld::ComboBox&, void); diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx index edc21e14e50d..b9ca3f36d403 100644 --- a/include/svx/ClassificationDialog.hxx +++ b/include/svx/ClassificationDialog.hxx @@ -56,10 +56,10 @@ private: DECL_LINK(ButtonClicked, weld::Button&, void); DECL_LINK(SelectToolboxHdl, weld::ToggleButton&, void); DECL_LINK(SelectClassificationHdl, weld::ComboBox&, void); - DECL_LINK(SelectMarkingHdl, weld::TreeView&, void); - DECL_LINK(SelectIPPartNumbersHdl, weld::TreeView&, void); + DECL_LINK(SelectMarkingHdl, weld::TreeView&, bool); + DECL_LINK(SelectIPPartNumbersHdl, weld::TreeView&, bool); DECL_LINK(SelectRecentlyUsedHdl, weld::ComboBox&, void); - DECL_LINK(SelectIPPartHdl, weld::TreeView&, void); + DECL_LINK(SelectIPPartHdl, weld::TreeView&, bool); DECL_LINK(EditWindowModifiedHdl, LinkParamNone*, void); DECL_STATIC_LINK(ClassificationDialog, ExpandedHdl, weld::Expander&, void); DECL_STATIC_LINK(ClassificationDialog, KeyInput, const KeyEvent&, bool); diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx index b341994dc997..2ed7ffa6bad9 100644 --- a/include/svx/txencbox.hxx +++ b/include/svx/txencbox.hxx @@ -197,7 +197,7 @@ public: rtl_TextEncoding GetSelectTextEncoding() const; void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xControl->connect_changed(rLink); } - void connect_row_activated(const Link<weld::TreeView&, void>& rLink) { m_xControl->connect_row_activated(rLink); } + void connect_row_activated(const Link<weld::TreeView&, bool>& rLink) { m_xControl->connect_row_activated(rLink); } void grab_focus() { m_xControl->grab_focus(); } void show() { m_xControl->show(); } void hide() { m_xControl->hide(); } diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 327e3762cf3d..197eaaca79b7 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -642,7 +642,7 @@ private: protected: Link<TreeView&, void> m_aChangeHdl; - Link<TreeView&, void> m_aRowActivatedHdl; + Link<TreeView&, bool> m_aRowActivatedHdl; Link<int, void> m_aColumnClickedHdl; Link<const std::pair<int, int>&, void> m_aRadioToggleHdl; Link<const TreeIter&, bool> m_aEditingStartedHdl; @@ -657,7 +657,7 @@ protected: std::vector<int> m_aRadioIndexes; void signal_changed() { m_aChangeHdl.Call(*this); } - void signal_row_activated() { m_aRowActivatedHdl.Call(*this); } + bool signal_row_activated() { return m_aRowActivatedHdl.Call(*this); } void signal_column_clicked(int nColumn) { m_aColumnClickedHdl.Call(nColumn); } bool signal_expanding(const TreeIter& rIter) { @@ -725,7 +725,14 @@ public: } void connect_changed(const Link<TreeView&, void>& rLink) { m_aChangeHdl = rLink; } - void connect_row_activated(const Link<TreeView&, void>& rLink) { m_aRowActivatedHdl = rLink; } + + /* A row is "activated" when the user double clicks a treeview row. It may + also be emitted when a row is selected and Space or Enter is pressed. + + a return of "true" means the activation has been handled, a "false" propogates + the activation to the default handler which expands/collapses the row, if possible. + */ + void connect_row_activated(const Link<TreeView&, bool>& rLink) { m_aRowActivatedHdl = rLink; } // Argument is a pair of row, col describing the node in non-tree mode. // If in tree mode, then retrieve the toggled node with get_cursor @@ -1400,7 +1407,7 @@ public: { return m_xEntry->get_selection_bounds(rStartPos, rEndPos); } - void connect_row_activated(const Link<TreeView&, void>& rLink) + void connect_row_activated(const Link<TreeView&, bool>& rLink) { m_xTreeView->connect_row_activated(rLink); } |