summaryrefslogtreecommitdiff
path: root/vcl/source/treelist
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-24 20:26:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-25 20:17:01 +0200
commitc9c361c8cf16bfd68a7d6ac4d6dceecfce72ee17 (patch)
treee1b02bf7fce5210d2fd6625d93fcbc4b05dcb9e2 /vcl/source/treelist
parentd073cca5f7c04de3e1bcedda334d864e98ac7835 (diff)
support activate-on-single-click
Change-Id: Iac0231b3bd84d664b1ab59023ef8242f3bd08940 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94773 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/treelist')
-rw-r--r--vcl/source/treelist/svimpbox.cxx9
-rw-r--r--vcl/source/treelist/treelistbox.cxx6
2 files changed, 11 insertions, 4 deletions
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index 4385c1ae8f9d..b2d4b0dc5c42 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -585,8 +585,6 @@ void SvImpLBox::RecalcFocusRect()
// Sets cursor. When using SingleSelection, the selection is adjusted.
-
-
void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
{
SvViewDataEntry* pViewDataNewCur = nullptr;
@@ -2006,7 +2004,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
}
- if( (rMEvt.GetClicks() % 2) == 0 )
+ if( (rMEvt.GetClicks() % 2) == 0)
{
m_nFlags &= ~LBoxFlags::StartEditTimer;
m_pView->pHdlEntry = pEntry;
@@ -2067,6 +2065,9 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
m_aEditClickPos = rMEvt.GetPosPixel();
m_aEditIdle.Start();
}
+
+ if (m_pView->mbActivateOnSingleClick)
+ m_pView->DoubleClickHdl();
}
void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
@@ -2367,6 +2368,8 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
break;
case KEY_RETURN:
+ if (m_pView->mbActivateOnSingleClick)
+ m_pView->DoubleClickHdl();
bKeyUsed = false;
break;
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index 5638268e6691..d8bc727766b6 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -402,6 +402,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) :
mbAlternatingRowColors(false),
mbUpdateAlternatingRows(false),
mbQuickSearch(false),
+ mbActivateOnSingleClick(false),
eSelMode(SelectionMode::NONE),
nMinWidthInChars(0),
mnDragAction(DND_ACTION_COPYMOVE | DND_ACTION_LINK),
@@ -488,7 +489,6 @@ bool SvTreeListBox::DoubleClickHdl()
return !aDoubleClickHdl.IsSet() || aDoubleClickHdl.Call(this);
}
-
bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox const * pSource, sal_Int8 nAction )
{
if ( pSource == this )
@@ -3576,6 +3576,10 @@ 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 == "reorderable")
{
if (toBool(rValue))