diff options
| author | Aaron Terrell (Enus) <enus@lindenlab.com> | 2010-08-30 11:56:33 -0700 |
|---|---|---|
| committer | Aaron Terrell (Enus) <enus@lindenlab.com> | 2010-08-30 11:56:33 -0700 |
| commit | d04e8d757575dbb50877ef861adcfde427837bb6 (patch) | |
| tree | b214237a4246e523754b356b003d1d2a163f21ab /indra/llui/llbutton.cpp | |
| parent | 3172b4db1ee4d2059d2605ce616bdb10c840fc03 (diff) | |
| parent | d84c6625c707b5d61b71749b74f3cc4fb8f02048 (diff) | |
merging up from viewer-development
Diffstat (limited to 'indra/llui/llbutton.cpp')
| -rw-r--r-- | indra/llui/llbutton.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index ac5651e4b6..f0f34ebd4f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -114,6 +114,7 @@ LLButton::LLButton(const LLButton::Params& p) mFlashing( FALSE ), mCurGlowStrength(0.f), mNeedsHighlight(FALSE), + mMouseOver(false), mUnselectedLabel(p.label()), mSelectedLabel(p.label_selected()), mGLFont(p.font), @@ -498,7 +499,11 @@ void LLButton::onMouseEnter(S32 x, S32 y, MASK mask) LLUICtrl::onMouseEnter(x, y, mask); if (isInEnabledChain()) + { mNeedsHighlight = TRUE; + } + + mMouseOver = true; } void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) @@ -506,6 +511,7 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) LLUICtrl::onMouseLeave(x, y, mask); mNeedsHighlight = FALSE; + mMouseOver = true; } void LLButton::setHighlight(bool b) @@ -559,14 +565,10 @@ void LLButton::draw() } // Unselected image assignments - S32 local_mouse_x; - S32 local_mouse_y; - LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); - bool enabled = isInEnabledChain(); bool pressed = pressed_by_keyboard - || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) + || (hasMouseCapture() && mMouseOver) || mForcePressedState; bool selected = getToggleState(); |
