diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-06-03 00:32:13 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-06-03 01:38:46 +0300 |
| commit | 3e4502cbfa5b9b1b749ea52ca0168f90ee7a5e98 (patch) | |
| tree | 7751aa9ac621a57a36e5d780da08d11333634c56 /indra/newview/llviewertexteditor.cpp | |
| parent | e8e4c5f6cc4f250cc5bc01d26ae0c2207a6554c4 (diff) | |
#3342 Fix "Cut" and "Copy" options for objects in notecards
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
| -rw-r--r-- | indra/newview/llviewertexteditor.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 95e34b4df1..a58d7546ce 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -249,6 +249,25 @@ public: /*virtual*/ bool canEdit() const { return false; } + /*virtual*/ bool handleRightMouseDown(S32 x, S32 y, MASK mask) + { + bool show_menu = !mEditor.hasSelection() + || (mEditor.mSelectionStart == mStart && mEditor.mSelectionEnd == mStart + 1); + if (show_menu && mEditor.getShowContextMenu()) + { + // User clicked an item, user expects the menu to be + // in 'context' for the item. Change selection to match. + // Todo: Might be better to 'smartly' deselect here + // and to have an object specific menu. + mEditor.setCursorPos(mStart + 1); + mEditor.mSelectionStart = mStart; + mEditor.mSelectionEnd = mStart + 1; + + mEditor.showContextMenu(x, y); + return true; + } + return false; + } /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask) { |
