vcl/source/treelist/svimpbox.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
New commits: commit b1a6c0355a5a8fc6f9cca0bbaa32f9fdd2b84495 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Jun 11 20:03:36 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Nov 30 18:22:05 2020 +0100 allow hover-select to unselect when mouse outside treeview Change-Id: Id991d4c3cdbb6a97c0024430bbff9ccbb29a2d52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96165 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106879 Tested-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index 75b482ecaa0b..e56932047df0 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -2091,9 +2091,19 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt) void SvImpLBox::MouseMove( const MouseEvent& rMEvt) { - SvTreeListEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() ); + Point aPos = rMEvt.GetPosPixel(); + SvTreeListEntry* pEntry = GetClickedEntry(aPos); if ( !MouseMoveCheckCtrl( rMEvt, pEntry ) && ( m_aSelEng.GetSelectionMode() != SelectionMode::NONE ) ) - m_aSelEng.SelMouseMove( rMEvt ); + { + m_aSelEng.SelMouseMove(rMEvt); + if (m_pView->mbHoverSelection) + { + if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height()) + m_pView->SelectAll(false); + else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry)) + m_pView->Select(pEntry); + } + } } void SvImpLBox::ExpandAll() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits