summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-31 19:13:54 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-11-30 18:22:27 +0100
commit6dd1bc1049cc027145d003dd89ff11f9e229154b (patch)
tree65fcbd833a3a01893d75185046cad9aa6f92e37c /vcl
parentb1a6c0355a5a8fc6f9cca0bbaa32f9fdd2b84495 (diff)
support hover-selection in SvTreeListBox
Change-Id: I5ad124d7c9e5219a557069bc7283208124c734af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95269 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106880 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/treelist/svimpbox.cxx4
-rw-r--r--vcl/source/treelist/treelistbox.cxx11
2 files changed, 14 insertions, 1 deletions
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index e56932047df0..7ccbb5856f01 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -2099,6 +2099,10 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
if (m_pView->mbHoverSelection)
{
if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height())
+ pEntry = nullptr;
+ else
+ pEntry = GetEntry(aPos);
+ if (!pEntry)
m_pView->SelectAll(false);
else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry))
m_pView->Select(pEntry);
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index aa56db5b718f..6e3c612093d8 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -369,6 +369,8 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) :
mbAlternatingRowColors(false),
mbUpdateAlternatingRows(false),
mbQuickSearch(false),
+ mbActivateOnSingleClick(false),
+ mbHoverSelection(false),
eSelMode(SelectionMode::NONE),
nMinWidthInChars(0),
mbCenterAndClipText(false)
@@ -2327,7 +2329,6 @@ void SvTreeListBox::MouseMove( const MouseEvent& rMEvt )
pImpl->MouseMove( rMEvt );
}
-
void SvTreeListBox::SetUpdateMode( bool bUpdate )
{
pImpl->SetUpdateMode( bUpdate );
@@ -3645,6 +3646,14 @@ bool SvTreeListBox::set_property(const OString &rKey, const OUString &rValue)
{
SetQuickSearch(toBool(rValue));
}
+ else if (rKey == "activate-on-single-click")
+ {
+ SetActivateOnSingleClick(toBool(rValue));
+ }
+ else if (rKey == "hover-selection")
+ {
+ SetHoverSelection(toBool(rValue));
+ }
else if (rKey == "reorderable")
{
if (toBool(rValue))