diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-26 16:37:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-26 20:23:34 +0200 |
commit | ef9ac1b9874ccd1f1df16e9eeb53f9453311337e (patch) | |
tree | b65ffd0f849c9a22bba887ab9f62c40c3c86f3bf /vcl | |
parent | 7bd3f4a0724b11c18d45937078e8c2968e2b6d7f (diff) |
make highlight of get_dest_row_at_pos optional
Change-Id: I280e1a49e938f45402f373896669fd6f7e8a66fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94876
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/treeglue.hxx | 9 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/vcl/inc/treeglue.hxx b/vcl/inc/treeglue.hxx index da4cc1ffeaf9..11c61944f5e1 100644 --- a/vcl/inc/treeglue.hxx +++ b/vcl/inc/treeglue.hxx @@ -127,7 +127,7 @@ public: m_aModelChangedHdl.Call(this); } - virtual SvTreeListEntry* GetDropTarget(const Point& rPos) override + SvTreeListEntry* GetTargetAtPoint(const Point& rPos, bool bHighLightTarget) { SvTreeListEntry* pOldTargetEntry = pTargetEntry; pTargetEntry = pImpl->GetEntry(rPos); @@ -150,11 +150,16 @@ public: } } - if (pTargetEntry) + if (pTargetEntry && bHighLightTarget) ImplShowTargetEmphasis(pTargetEntry, true); return pTargetEntry; } + virtual SvTreeListEntry* GetDropTarget(const Point& rPos) override + { + return GetTargetAtPoint(rPos, true); + } + virtual bool EditingEntry(SvTreeListEntry* pEntry, Selection&) override { return m_aEditingEntryHdl.Call(pEntry); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 67cb4fad45e1..985503444597 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -4502,9 +4502,10 @@ public: SvTabListBox& getTreeView() { return *m_xTreeView; } - virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult) override + virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult, bool bHighLightTarget) override { - SvTreeListEntry* pTarget = m_xTreeView->GetDropTarget(rPos); + LclTabListBox* pTreeView = !bHighLightTarget ? dynamic_cast<LclTabListBox*>(m_xTreeView.get()) : nullptr; + SvTreeListEntry* pTarget = pTreeView ? pTreeView->GetTargetAtPoint(rPos, false) : m_xTreeView->GetDropTarget(rPos); if (pTarget && pResult) { diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 16b2a1ae1d7c..f38c79f91a63 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -11134,7 +11134,7 @@ public: weld::TreeView::connect_popup_menu(rLink); } - virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter* pResult) override + virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter* pResult, bool bHighLightTarget) override { const bool bAsTree = gtk_tree_view_get_enable_tree_lines(m_pTreeView); @@ -11184,7 +11184,7 @@ public: gtk_tree_model_get_iter(pModel, &rGtkIter.iter, path); } - if (m_bInDrag) + if (m_bInDrag && bHighLightTarget) // bHighLightTarget alone might be sufficient { // highlight the row gtk_tree_view_set_drag_dest_row(m_pTreeView, path, pos); |