diff options
author | Richard Linden <none@none> | 2011-03-24 19:37:00 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2011-03-24 19:37:00 -0700 |
commit | a5572505d843778b7f5395e25f9b9d15178bb423 (patch) | |
tree | 4bd6108a9ac44fbe3343f9bba29745e7c8905496 | |
parent | 4af93641973c4ee8805e948ad04d7be306a38835 (diff) |
SOCIAL-509 FIX There is no way to copy a user name from web profile with the mouse
-rw-r--r-- | indra/llui/llmenugl.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llmediactrl.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 2 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 105 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewermediafocus.cpp | 12 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_media_ctrl.xml | 34 |
7 files changed, 117 insertions, 70 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 32d7be377a..e60fae6ff5 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3099,9 +3099,6 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2); menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect, FALSE ); menu->getParent()->sendChildToFront(menu); - - - } ///============================================================================ diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index b8c61068c4..0199958c62 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -44,6 +44,7 @@ #include "llslurl.h" #include "lluictrlfactory.h" // LLDefaultChildRegistry #include "llkeyboard.h" +#include "llviewermenu.h" // linden library includes #include "llfocusmgr.h" @@ -106,7 +107,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mErrorPageURL(p.error_page_url), mTrusted(p.trusted_content), mWindowShade(NULL), - mHoverTextChanged(false) + mHoverTextChanged(false), + mContextMenu(NULL) { { LLColor4 color = p.caret_color().get(); @@ -151,6 +153,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : LLMediaCtrl::~LLMediaCtrl() { + delete mContextMenu; if (mMediaSource) { @@ -318,6 +321,12 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) setFocus( TRUE ); } + if (mContextMenu) + { + mContextMenu->show(x, y); + LLMenuGL::showPopup(this, mContextMenu, x, y); + } + return TRUE; } @@ -380,6 +389,8 @@ void LLMediaCtrl::onFocusLost() // BOOL LLMediaCtrl::postBuild () { + mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
+ "menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2)); return TRUE; } diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 53b98b7ec8..28666e620f 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -34,6 +34,7 @@ class LLViewBorder; class LLUICtrlFactory; +class LLContextMenu; //////////////////////////////////////////////////////////////////////////////// // @@ -195,6 +196,7 @@ public: bool mClearCache; class LLWindowShade* mWindowShade; bool mHoverTextChanged; + LLContextMenu* mContextMenu; }; #endif // LL_LLMediaCtrl_H diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index a84346ab84..a8243a989e 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -528,42 +528,17 @@ void LLToolPie::selectionPropertiesReceived() BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { - if (!mMouseOutsideSlop - && mMouseButtonDown - && gSavedSettings.getBOOL("ClickToWalk")) - { - S32 delta_x = x - mMouseDownX; - S32 delta_y = y - mMouseDownY; - S32 threshold = gSavedSettings.getS32("DragAndDropDistanceThreshold"); - if (delta_x * delta_x + delta_y * delta_y > threshold * threshold) - { - startCameraSteering(); - } - } - mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); - - if (inCameraSteerMode()) - { - steerCameraWithMouse(x, y); - gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); - return TRUE; - } - - // perform a separate pick that detects transparent objects since they respond to 1-click actions - LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE); - - // Show screen-space highlight glow effect - bool show_highlight = false; LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); - if (object) { parent = object->getRootEdit(); } - LLViewerObject* click_action_object = click_action_pick.getObject(); + // Show screen-space highlight glow effect + bool show_highlight = false; + if (handleMediaHover(mHoverPick)) { // *NOTE: If you think the hover glow conflicts with the media outline, you @@ -572,37 +547,68 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) // cursor set by media object lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } - else if (click_action_object && useClickAction(mask, click_action_object, click_action_object->getRootEdit())) + else if (!mMouseOutsideSlop + && mMouseButtonDown + && gSavedSettings.getBOOL("ClickToWalk")) { - show_highlight = true; - ECursorType cursor = cursorFromObject(click_action_object); - gViewerWindow->setCursor(cursor); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + S32 delta_x = x - mMouseDownX; + S32 delta_y = y - mMouseDownY; + S32 threshold = gSavedSettings.getS32("DragAndDropDistanceThreshold"); + if (delta_x * delta_x + delta_y * delta_y > threshold * threshold) + { + startCameraSteering(); + steerCameraWithMouse(x, y); + gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); + } + else + { + gViewerWindow->setCursor(UI_CURSOR_ARROW); + } } - - else if ((object && !object->isAvatar() && object->usePhysics()) - || (parent && !parent->isAvatar() && parent->usePhysics())) + else if (inCameraSteerMode()) { - show_highlight = true; + steerCameraWithMouse(x, y); gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; - } - else if ( (object && object->flagHandleTouch()) - || (parent && parent->flagHandleTouch())) - { - show_highlight = true; - gViewerWindow->setCursor(UI_CURSOR_HAND); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } else { - gViewerWindow->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + // perform a separate pick that detects transparent objects since they respond to 1-click actions + LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE); - if(!object) + LLViewerObject* click_action_object = click_action_pick.getObject(); + + if (click_action_object && useClickAction(mask, click_action_object, click_action_object->getRootEdit())) + { + show_highlight = true; + ECursorType cursor = cursorFromObject(click_action_object); + gViewerWindow->setCursor(cursor); + lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + } + + else if ((object && !object->isAvatar() && object->usePhysics()) + || (parent && !parent->isAvatar() && parent->usePhysics())) + { + show_highlight = true; + gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); + lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + } + else if ( (object && object->flagHandleTouch()) + || (parent && parent->flagHandleTouch())) { - LLViewerMediaFocus::getInstance()->clearHover(); + show_highlight = true; + gViewerWindow->setCursor(UI_CURSOR_HAND); + lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } + else + { + gViewerWindow->setCursor(UI_CURSOR_ARROW); + lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + } + } + + if(!object) + { + LLViewerMediaFocus::getInstance()->clearHover(); } static LLCachedControl<bool> enable_highlight( @@ -1430,6 +1436,7 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) { // Make sure keyboard focus is set to the media focus object. gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance()); + LLEditMenuHandler::gEditMenuHandler = LLViewerMediaFocus::instance().getFocusedMediaImpl(); media_impl->mouseDown(pick.mUVCoords, gKeyboard->currentMask(TRUE)); mMediaMouseCaptureID = mep->getMediaID(); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 499165135a..c2d630ece2 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2543,23 +2543,7 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask) // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it... if( MASK_CONTROL & mask ) { - if( 'C' == key ) - { - mMediaSource->copy(); - result = true; - } - else - if( 'V' == key ) - { - mMediaSource->paste(); - result = true; - } - else - if( 'X' == key ) - { - mMediaSource->cut(); - result = true; - } + result = true; } if(!result) diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index de52aa17d1..4543a1ba9a 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -113,6 +113,11 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac media_impl->focus(true); gFocusMgr.setKeyboardFocus(this); + LLViewerMediaImpl* impl = getFocusedMediaImpl(); + if (impl) + { + LLEditMenuHandler::gEditMenuHandler = impl; + } // We must do this before processing the media HUD zoom, or it may zoom to the wrong face. update(); @@ -139,6 +144,13 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac { gFocusMgr.setKeyboardFocus(NULL); } + + LLViewerMediaImpl* impl = getFocusedMediaImpl(); + if (LLEditMenuHandler::gEditMenuHandler == impl) + { + LLEditMenuHandler::gEditMenuHandler = NULL; + } + mFocusedImplID = LLUUID::null; if (objectp.notNull()) diff --git a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml new file mode 100644 index 0000000000..ed1e1b0fae --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<context_menu + name="media ctrl context menu"> + <menu_item_call + label="Cut" + layout="topleft" + name="Cut" + shortcut="control|X"> + <menu_item_call.on_click + function="Edit.Cut" /> + <menu_item_call.on_enable + function="Edit.EnableCut" /> + </menu_item_call> + <menu_item_call + label="Copy" + layout="topleft" + name="Copy" + shortcut="control|C"> + <menu_item_call.on_click + function="Edit.Copy" /> + <menu_item_call.on_enable + function="Edit.EnableCopy" /> + </menu_item_call> + <menu_item_call + label="Paste" + layout="topleft" + name="Paste" + shortcut="control|V"> + <menu_item_call.on_click + function="Edit.Paste" /> + <menu_item_call.on_enable + function="Edit.EnablePaste" /> + </menu_item_call> +</context_menu> |