diff options
| author | Richard Linden <none@none> | 2010-09-22 19:11:29 -0700 |
|---|---|---|
| committer | Richard Linden <none@none> | 2010-09-22 19:11:29 -0700 |
| commit | abe758d45fa3dd3524a4c7a9667e4f02c3de8eac (patch) | |
| tree | 7ac140c51c22a42c693b0930898e0996a807ecb8 /indra/llui/llbutton.cpp | |
| parent | 264b549bcb991f4cdd6889f06b8f7fbe8740e32a (diff) | |
| parent | b124d45b4ef714acfe629af554768950dcdd5f2c (diff) | |
merge
Diffstat (limited to 'indra/llui/llbutton.cpp')
| -rw-r--r-- | indra/llui/llbutton.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index d51276bf26..f26711065a 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -114,7 +114,6 @@ 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), @@ -499,19 +498,14 @@ 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) { LLUICtrl::onMouseLeave(x, y, mask); mNeedsHighlight = FALSE; - mMouseOver = true; } void LLButton::setHighlight(bool b) @@ -564,11 +558,19 @@ void LLButton::draw() pressed_by_keyboard = gKeyboard->getKeyDown(' ') || (mCommitOnReturn && gKeyboard->getKeyDown(KEY_RETURN)); } - // Unselected image assignments + bool mouse_pressed_and_over = false; + if (hasMouseCapture()) + { + S32 local_mouse_x ; + S32 local_mouse_y; + LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + mouse_pressed_and_over = pointInView(local_mouse_x, local_mouse_y); + } + bool enabled = isInEnabledChain(); bool pressed = pressed_by_keyboard - || (hasMouseCapture() && mMouseOver) + || mouse_pressed_and_over || mForcePressedState; bool selected = getToggleState(); |
