summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltextbase.cpp9
-rw-r--r--indra/llui/lltextbase.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 4c9c2781f2..7cee9f5b46 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -46,6 +46,7 @@
const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds
const S32 CURSOR_THICKNESS = 2;
+const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click.
LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num)
: mDocIndexStart(index_start),
@@ -1004,6 +1005,13 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert)
BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask)
{
+ // handle triple click
+ if (!mTripleClickTimer.hasExpired())
+ {
+ selectAll();
+ return TRUE;
+ }
+
LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y);
if (cur_segment && cur_segment->handleMouseDown(x, y, mask))
{
@@ -1078,6 +1086,7 @@ BOOL LLTextBase::handleRightMouseUp(S32 x, S32 y, MASK mask)
BOOL LLTextBase::handleDoubleClick(S32 x, S32 y, MASK mask)
{
+ mTripleClickTimer.setTimerExpirySec(TRIPLE_CLICK_INTERVAL);
LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y);
if (cur_segment && cur_segment->handleDoubleClick(x, y, mask))
{
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 629b304b25..ad566a36d3 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -598,7 +598,8 @@ protected:
// selection
S32 mSelectionStart;
S32 mSelectionEnd;
-
+ LLTimer mTripleClickTimer;
+
BOOL mIsSelecting; // Are we in the middle of a drag-select?
// spell checking