svn merge -r 56560:56599 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance

master
Josh Bell 2007-01-09 20:19:31 +00:00
parent 8534623734
commit 8c344f4da0
22 changed files with 705 additions and 333 deletions

View File

@ -405,5 +405,14 @@ inline BOOL are_parallel(const LLVector3d &a, const LLVector3d &b, const F64 eps
return TRUE;
}
return FALSE;
}
inline LLVector3d projected_vec(const LLVector3d &a, const LLVector3d &b)
{
LLVector3d project_axis = b;
project_axis.normVec();
return project_axis * (a * project_axis);
}
#endif // LL_V3DMATH_H

View File

@ -274,8 +274,6 @@ LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
LLString label("");
node->getAttributeString("label", label);
BOOL initial_value = FALSE;
LLFontGL* font = LLView::selectFont(node);
BOOL radio_style = FALSE;
@ -297,9 +295,12 @@ LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
font,
callback,
NULL,
initial_value,
FALSE,
radio_style); // if true, draw radio button style icons
BOOL initial_value = checkbox->getValue().asBoolean();
node->getAttributeBOOL("initial_value", initial_value);
LLColor4 color;
color = LLUI::sColorsGroup->getColor( "LabelTextColor" );
LLUICtrlFactory::getAttributeColor(node,"text_enabled_color", color);
@ -309,6 +310,8 @@ LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
LLUICtrlFactory::getAttributeColor(node,"text_disabled_color", color);
checkbox->setDisabledColor(color);
checkbox->setValue(initial_value);
checkbox->initFromXML(node, parent);
return checkbox;

View File

@ -72,6 +72,7 @@ public:
ed->mSelectionStart = mSelectionStart;
ed->mSelectionEnd = mSelectionEnd;
ed->mText = mText;
ed->mPrevText = mText;
}
LLString getText() { return mText; }
@ -110,6 +111,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect,
mBorderLeft(0),
mBorderRight(0),
mCommitOnFocusLost( TRUE ),
mRevertOnEsc( TRUE ),
mKeystrokeCallback( keystroke_callback ),
mFocusLostCallback( focus_lost_callback ),
mIsSelecting( FALSE ),
@ -151,7 +153,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect,
mScrollTimer.reset();
setText(default_text);
setCursor(mText.length());
// Scalable UI somehow made these rectangles off-by-one.
@ -195,7 +197,7 @@ void LLLineEditor::onFocusLost()
mFocusLostCallback( this, mCallbackUserData );
}
if( mCommitOnFocusLost )
if( mCommitOnFocusLost && mText.getString() != mPrevText)
{
onCommit();
}
@ -281,6 +283,7 @@ void LLLineEditor::setText(const LLString &new_text)
deselect();
}
setCursor(llmin((S32)mText.length(), getCursor()));
mPrevText = mText;
}
@ -1064,6 +1067,14 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
}
break;
case KEY_ESCAPE:
if (mRevertOnEsc && mText.getString() != mPrevText)
{
setText(mPrevText);
// Note, don't set handled, still want to loose focus (won't commit becase text is now unchanged)
}
break;
default:
break;
}

View File

@ -127,9 +127,10 @@ public:
void setSelection(S32 start, S32 end);
void setCommitOnFocusLost( BOOL b ) { mCommitOnFocusLost = b; }
void setRevertOnEsc( BOOL b ) { mRevertOnEsc = b; }
void setCursorColor(const LLColor4& c) { mCursorColor = c; }
const LLColor4& getCursorColor() const { return mCursorColor; }
const LLColor4& getCursorColor() const { return mCursorColor; }
void setFgColor( const LLColor4& c ) { mFgColor = c; }
void setReadOnlyFgColor( const LLColor4& c ) { mReadOnlyFgColor = c; }
@ -202,6 +203,7 @@ protected:
protected:
LLUIString mText; // The string being edited.
LLString mPrevText; // Saved string for 'ESC' revert
LLUIString mLabel; // text label that is visible when no user text provided
LLViewBorder* mBorder;
@ -217,6 +219,7 @@ protected:
S32 mBorderRight;
BOOL mCommitOnFocusLost;
BOOL mRevertOnEsc;
void (*mKeystrokeCallback)( LLLineEditor* caller, void* userdata );
void (*mFocusLostCallback)( LLLineEditor* caller, void* userdata );

File diff suppressed because it is too large Load Diff

View File

@ -129,14 +129,17 @@ public:
virtual void updateBranchParent( LLView* parentp ){};
// doIt() - do the primary funcationality of the menu item.
virtual void doIt( void ) = 0;
virtual void doIt( void );
// set the hover status (called by it's menu)
virtual void setHighlight( BOOL highlight );
// determine if this object is active
// determine if this represents an active sub-menu
virtual BOOL isActive( void ) const;
// determine if this represents an open sub-menu
virtual BOOL isOpen( void ) const;
virtual void setEnabledSubMenus(BOOL enable){};
// LLView Functionality
@ -144,6 +147,8 @@ public:
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
virtual void draw( void );
BOOL getHover() { return mGotHover; }
BOOL getDrawTextDisabled() const { return mDrawTextDisabled; }
protected:
@ -398,9 +403,9 @@ public:
// LLView Functionality
virtual BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent );
virtual BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent );
//virtual BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent );
virtual BOOL handleUnicodeCharHere( llwchar uni_char, BOOL called_from_parent );
virtual BOOL handleHover( S32 x, S32 y, MASK mask );
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
virtual void draw( void );
virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color);
virtual void setVisible(BOOL visible);
@ -409,7 +414,7 @@ public:
LLMenuGL* getChildMenuByName(const LLString& name, BOOL recurse) const;
BOOL clearHoverItem(BOOL include_active = TRUE);
BOOL clearHoverItem();
// return the name label
const LLString& getLabel( void ) const { return mLabel.getString(); }
@ -445,7 +450,11 @@ public:
// sets the left,bottom corner of menu, useful for popups
void setLeftAndBottom(S32 left, S32 bottom);
virtual void handleJumpKey(KEY key);
virtual BOOL handleJumpKey(KEY key);
virtual BOOL jumpKeysActive();
virtual BOOL isOpen();
// Shape this menu to fit the current state of the children, and
// adjust the child rects to fit. This is called automatically
@ -491,8 +500,10 @@ public:
KEY getJumpKey() { return mJumpKey; }
void setJumpKey(KEY key) { mJumpKey = key; }
static void onFocusLost(LLView* old_focus);
static void setKeyboardMode(BOOL mode) { sKeyboardMode = mode; }
static BOOL getKeyboardMode() { return sKeyboardMode; }
static void onFocusLost(LLView* old_focus);
static LLView *sDefaultMenuContainer;
protected:
@ -501,6 +512,7 @@ protected:
protected:
static LLColor4 sDefaultBackgroundColor;
static BOOL sKeyboardMode;
LLColor4 mBackgroundColor;
BOOL mBgVisible;
@ -602,7 +614,8 @@ private:
class LLMenuBarGL : public LLMenuGL
{
protected:
std::list <LLKeyBinding*> mAccelerators;
std::list <LLKeyBinding*> mAccelerators;
BOOL mAltKeyTrigger;
public:
LLMenuBarGL( const LLString& name );
@ -613,10 +626,15 @@ public:
virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_BAR; }
virtual LLString getWidgetTag() const { return LL_MENU_BAR_GL_TAG; }
virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
virtual BOOL handleJumpKey(KEY key);
// rearrange the child rects so they fit the shape of the menu
// bar.
virtual void handleJumpKey(KEY key);
virtual void arrange( void );
virtual void draw();
virtual BOOL jumpKeysActive();
// add a vertical separator to this menu
virtual BOOL appendSeparator( const LLString &separator_name = "separator" );
@ -629,6 +647,12 @@ public:
// Returns x position of rightmost child, usually Help menu
S32 getRightmostMenuEdge();
void resetMenuTrigger() { mAltKeyTrigger = FALSE; }
protected:
void checkMenuTrigger();
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -679,6 +703,9 @@ public:
virtual void draw(void);
virtual void onFocusReceived();
virtual void onFocusLost();
virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
virtual void translate(S32 x, S32 y);
protected:
LLTearOffMenu(LLMenuGL* menup);

View File

@ -894,7 +894,6 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre
return handled;
}
BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
{
BOOL handled = FALSE;
@ -908,17 +907,14 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
}
}
if( !handled )
// JC: Must pass to disabled views, since they could have
// keyboard focus, which requires the escape key to exit.
if (!handled && getVisible())
{
// JC: Must pass to disabled views, since they could have
// keyboard focus, which requires the escape key to exit.
if (getVisible())
handled = handleKeyHere( key, mask, called_from_parent );
if (handled && LLView::sDebugKeys)
{
handled = handleKeyHere( key, mask, called_from_parent );
if (handled && LLView::sDebugKeys)
{
llinfos << "Key handled by " << getName() << llendl;
}
llinfos << "Key handled by " << getName() << llendl;
}
}
@ -945,25 +941,20 @@ BOOL LLView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent)
return FALSE;
}
BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
{
BOOL handled = FALSE;
/*
if( called_from_parent )
{
// Downward traversal
if (getVisible() && mEnabled)
{
handled = childrenHandleKey( key, mask ) != NULL;
handled = childrenHandleUnicodeChar( uni_char ) != NULL;
}
}
*/
// JC: Must pass to disabled views, since they could have
// keyboard focus, which requires the escape key to exit.
if (getVisible())
if (!handled && getVisible())
{
handled = handleUnicodeCharHere(uni_char, called_from_parent);
if (handled && LLView::sDebugKeys)
@ -1215,6 +1206,30 @@ LLView* LLView::childrenHandleKey(KEY key, MASK mask)
return handled_view;
}
// Called during downward traversal
LLView* LLView::childrenHandleUnicodeChar(llwchar uni_char)
{
LLView* handled_view = NULL;
if ( getVisible() && mEnabled )
{
for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
{
LLView* viewp = *child_it;
if (viewp->handleUnicodeChar(uni_char, TRUE))
{
if (LLView::sDebugKeys)
{
llinfos << "Unicode character handled by " << viewp->getName() << llendl;
}
handled_view = viewp;
break;
}
}
}
return handled_view;
}
LLView* LLView::childrenHandleMouseDown(S32 x, S32 y, MASK mask)
{

View File

@ -448,6 +448,7 @@ protected:
virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent);
LLView* childrenHandleKey(KEY key, MASK mask);
LLView* childrenHandleUnicodeChar(llwchar uni_char);
LLView* childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop,
EDragAndDropType type,

View File

@ -205,6 +205,8 @@ BOOL LLKeyboard::handleTranslatedKeyDown(KEY translated_key, U32 translated_mask
{
mKeyLevel[translated_key] = TRUE;
mKeyLevelTimer[translated_key].reset();
mKeyLevelFrameCount[translated_key] = 0;
mKeyRepeated[translated_key] = FALSE;
}
else
{
@ -226,7 +228,6 @@ BOOL LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask)
if( mKeyLevel[translated_key] )
{
mKeyLevel[translated_key] = FALSE;
mKeyLevelFrameCount[translated_key] = 0;
// Only generate key up events if the key is thought to
// be down. This allows you to call resetKeys() in the
@ -234,7 +235,6 @@ BOOL LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask)
// messages in the same frame. This was causing the
// sequence W<return> in chat to move agents forward. JC
mKeyUp[translated_key] = TRUE;
mKeyRepeated[translated_key] = FALSE;
handled = mCallbacks->handleTranslatedKeyUp(translated_key, translated_mask);
}
@ -260,27 +260,13 @@ void LLKeyboard::toggleInsertMode()
// Returns time in seconds since key was pressed.
F32 LLKeyboard::getKeyElapsedTime(KEY key)
{
if( mKeyLevel[key] )
{
return mKeyLevelTimer[key].getElapsedTimeF32();
}
else
{
return 0.f;
}
return mKeyLevelTimer[key].getElapsedTimeF32();
}
// Returns time in frames since key was pressed.
S32 LLKeyboard::getKeyElapsedFrameCount(KEY key)
{
if( mKeyLevel[key] )
{
return mKeyLevelFrameCount[key];
}
else
{
return 0;
}
return mKeyLevelFrameCount[key];
}
// static

View File

@ -58,8 +58,8 @@ public:
void resetKeys();
F32 getCurKeyElapsedTime() { return getKeyElapsedTime( mCurScanKey ); }
F32 getCurKeyElapsedFrameCount() { return (F32)getKeyElapsedFrameCount( mCurScanKey ); }
F32 getCurKeyElapsedTime() { return getKeyDown(mCurScanKey) ? getKeyElapsedTime( mCurScanKey ) : 0.f; }
F32 getCurKeyElapsedFrameCount() { return getKeyDown(mCurScanKey) ? (F32)getKeyElapsedFrameCount( mCurScanKey ) : 0.f; }
BOOL getKeyDown(const KEY key) { return mKeyLevel[key]; }
BOOL getKeyRepeated(const KEY key) { return mKeyRepeated[key]; }
@ -92,9 +92,10 @@ public:
void setNumpadDistinct(e_numpad_distinct val) { mNumpadDistinct = val; }
void setCallbacks(LLWindowCallbacks *cbs) { mCallbacks = cbs; }
protected:
F32 getKeyElapsedTime( KEY key ); // Returns time in seconds since key was pressed.
S32 getKeyElapsedFrameCount( KEY key ); // Returns time in frames since key was pressed.
protected:
void addKeyName(KEY key, const LLString& name);
protected:

View File

@ -146,29 +146,32 @@ void LLKeyboardWin32::resetMaskKeys()
}
void LLKeyboardWin32::setModifierKeyLevel( KEY key, BOOL new_state )
{
if( mKeyLevel[key] != new_state )
{
mKeyLevelFrameCount[key] = 0;
if( new_state )
{
mKeyLevelTimer[key].reset();
}
mKeyLevel[key] = new_state;
}
}
//void LLKeyboardWin32::setModifierKeyLevel( KEY key, BOOL new_state )
//{
// if( mKeyLevel[key] != new_state )
// {
// mKeyLevelFrameCount[key] = 0;
//
// if( new_state )
// {
// mKeyLevelTimer[key].reset();
// }
// mKeyLevel[key] = new_state;
// }
//}
MASK LLKeyboardWin32::updateModifiers()
{
//RN: this seems redundant, as we should have already received the appropriate
// messages for the modifier keys
// Scan the modifier keys as of the last Windows key message
// (keydown encoded in high order bit of short)
setModifierKeyLevel( KEY_SHIFT, GetKeyState(VK_SHIFT) & 0x8000 );
setModifierKeyLevel( KEY_CONTROL, GetKeyState(VK_CONTROL) & 0x8000 );
setModifierKeyLevel( KEY_ALT, GetKeyState(VK_MENU) & 0x8000 );
setModifierKeyLevel( KEY_CAPSLOCK, GetKeyState(VK_CAPITAL) & 0x0001); // Low order bit carries the toggle state.
//setModifierKeyLevel( KEY_SHIFT, GetKeyState(VK_SHIFT) & 0x8000 );
//setModifierKeyLevel( KEY_CONTROL, GetKeyState(VK_CONTROL) & 0x8000 );
//setModifierKeyLevel( KEY_ALT, GetKeyState(VK_MENU) & 0x8000 );
//setModifierKeyLevel( KEY_CAPSLOCK, GetKeyState(VK_CAPITAL) & 0x0001); // Low order bit carries the toggle state.
// Get mask for keyboard events
MASK mask = currentMask(FALSE);
return mask;

View File

@ -31,7 +31,7 @@ public:
protected:
MASK updateModifiers();
void setModifierKeyLevel( KEY key, BOOL new_state );
//void setModifierKeyLevel( KEY key, BOOL new_state );
private:
std::map<U16, KEY> mTranslateNumpadMap;
std::map<KEY, U16> mInvTranslateNumpadMap;

View File

@ -129,6 +129,13 @@ THIRD_PERSON DOWN ALT move_backward
THIRD_PERSON PGUP ALT spin_over
THIRD_PERSON PGDN ALT spin_under
THIRD_PERSON A ALT spin_around_cw
THIRD_PERSON D ALT spin_around_ccw
THIRD_PERSON W ALT move_forward
THIRD_PERSON S ALT move_backward
THIRD_PERSON E ALT spin_over
THIRD_PERSON C ALT spin_under
THIRD_PERSON PAD_LEFT ALT spin_around_cw
THIRD_PERSON PAD_RIGHT ALT spin_around_ccw
THIRD_PERSON PAD_UP ALT move_forward

View File

@ -95,6 +95,7 @@ LLChatBar::LLChatBar(const std::string& name, const LLRect& rect)
mInputEditor->setFocusLostCallback(&onInputEditorFocusLost);
mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus );
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
mInputEditor->setIgnoreTab(TRUE);
mInputEditor->setPassDelete(TRUE);
}

View File

@ -42,7 +42,8 @@
#include "lldraghandle.h"
const F32 CONTEXT_CONE_IN_ALPHA = 0.0f;
const F32 CONTEXT_CONE_OUT_ALPHA = 0.35f;
const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
const F32 CONTEXT_FADE_TIME = 0.08f;
//////////////////////////////////////////////////////////////////////////////
//
@ -607,11 +608,11 @@ void LLFloaterColorPicker::draw()
if (gFocusMgr.childHasMouseCapture(mDragHandle))
{
mContextConeOpacity = lerp(mContextConeOpacity, 1.f, LLCriticalDamp::getInterpolant(0.1f));
mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
}
else
{
mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(0.2f));
mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
}
mPipetteBtn->setEnabled(gToolMgr != NULL);

View File

@ -110,6 +110,7 @@ BOOL LLFloaterIMPanel::postBuild()
mInputEditor->setKeystrokeCallback( onInputEditorKeystroke );
mInputEditor->setCallbackUserData(this);
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
LLButton* profile_btn = LLUICtrlFactory::getButtonByName(this, "profile_btn");
profile_btn->setClickedCallback(&LLFloaterIMPanel::onClickProfile, this);

View File

@ -2340,19 +2340,25 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo
open_notecard(
lastitem->getUUID(),
LLString("Note: ") + lastitem->getName(),
show_keep_discard);
show_keep_discard,
LLUUID::null,
FALSE);
break;
case LLAssetType::AT_LANDMARK:
open_landmark(
lastitem->getUUID(),
LLString(" ") + lastitem->getName(),
show_keep_discard);
show_keep_discard,
LLUUID::null,
FALSE);
break;
case LLAssetType::AT_TEXTURE:
open_texture(
lastitem->getUUID(),
LLString("Texture: ") + lastitem->getName(),
show_keep_discard);
show_keep_discard,
LLUUID::null,
FALSE);
break;
default:
break;

View File

@ -88,7 +88,9 @@ void LLManip::getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3
LLVector3 arrow_axis;
getManipAxis(object, manip, arrow_axis);
LLVector3 cross = arrow_axis % gCamera->getAtAxis();
LLVector3 origin_dir = grid_origin - gCamera->getOrigin();
origin_dir.normVec();
LLVector3 cross = arrow_axis % origin_dir;
normal = cross % arrow_axis;
normal.normVec();
}

View File

@ -157,6 +157,16 @@ void LLPreview::onCommit()
LLViewerInventoryItem* item = getItem();
if(item)
{
if (!item->isComplete())
{
// We are attempting to save an item that was never loaded
llwarns << "LLPreview::onCommit() called with mIsComplete == FALSE"
<< " Type: " << item->getType()
<< " ID: " << item->getUUID()
<< llendl;
return;
}
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
BOOL has_sale_info = FALSE;
LLSaleInfo sale_info;

View File

@ -67,8 +67,8 @@ static const S32 FOOTER_HEIGHT = 100;
static const S32 BORDER_PAD = HPAD;
static const S32 TEXTURE_INVENTORY_PADDING = 30;
static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f;
static const F32 CONTEXT_CONE_OUT_ALPHA = 0.35f;
static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
static const F32 CONTEXT_FADE_TIME = 0.08f;
//static const char CURRENT_IMAGE_NAME[] = "Current Texture";
//static const char WHITE_IMAGE_NAME[] = "Blank Texture";
@ -437,11 +437,11 @@ void LLFloaterTexturePicker::draw()
if (gFocusMgr.childHasMouseCapture(mDragHandle))
{
mContextConeOpacity = lerp(mContextConeOpacity, 1.f, LLCriticalDamp::getInterpolant(0.1f));
mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
}
else
{
mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(0.2f));
mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
}
updateImageStats();

View File

@ -8263,6 +8263,8 @@ BOOL LLViewerMenuHolderGL::hideMenus()
gParcelMgr->deselectLand();
}
}
gMenuBarView->clearHoverItem();
gMenuBarView->resetMenuTrigger();
return handled;
}

View File

@ -2137,7 +2137,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
}
// don't pass keys on to world when something in ui has focus
return gFocusMgr.childHasKeyboardFocus(mRootView);
return gFocusMgr.childHasKeyboardFocus(mRootView) || (gMenuBarView && gMenuBarView->getHighlightedItem());
}
@ -2154,6 +2154,12 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
return gViewerKeyboard.handleKey(KEY_RETURN, mask, gKeyboard->getKeyRepeated(KEY_RETURN));
}
// let menus handle navigation (jump) keys
if (gMenuBarView && gMenuBarView->handleUnicodeChar(uni_char, TRUE))
{
return TRUE;
}
// Traverses up the hierarchy
LLView* keyboard_focus = gFocusMgr.getKeyboardFocus();
if( keyboard_focus )
@ -2665,7 +2671,8 @@ BOOL LLViewerWindow::handlePerFrameHover()
if (gParcelMgr
&& !LLFloaterLand::floaterVisible()
&& !LLFloaterBuyLand::isOpen()
&& (!gFloaterTools || !gFloaterTools->getVisible()))
&& (!gFloaterTools || !gFloaterTools->getVisible())
&& !gToolMgr)
{
gParcelMgr->deselectLand();
}
@ -3499,8 +3506,21 @@ BOOL LLViewerWindow::mousePointOnPlaneGlobal(LLVector3d& point, const S32 x, con
mouse_direction_global_d.setVec(mouseDirectionGlobal(x,y));
LLVector3d plane_normal_global_d;
plane_normal_global_d.setVec(plane_normal_global);
F64 mouse_look_at_scale = (plane_normal_global_d * (plane_point_global - gAgent.getCameraPositionGlobal()))
/ (plane_normal_global_d * mouse_direction_global_d);
F64 plane_mouse_dot = (plane_normal_global_d * mouse_direction_global_d);
LLVector3d plane_origin_camera_rel = plane_point_global - gAgent.getCameraPositionGlobal();
F64 mouse_look_at_scale = (plane_normal_global_d * plane_origin_camera_rel)
/ plane_mouse_dot;
if (llabs(plane_mouse_dot) < 0.00001)
{
// if mouse is parallel to plane, return closest point on line through plane origin
// that is parallel to camera plane by scaling mouse direction vector
// by distance to plane origin, modulated by deviation of mouse direction from plane origin
LLVector3d plane_origin_dir = plane_origin_camera_rel;
plane_origin_dir.normVec();
mouse_look_at_scale = plane_origin_camera_rel.magVec() / (plane_origin_dir * mouse_direction_global_d);
}
point = gAgent.getCameraPositionGlobal() + mouse_look_at_scale * mouse_direction_global_d;
return mouse_look_at_scale > 0.0;