diff options
| author | Oz Linden <oz@lindenlab.com> | 2010-10-08 10:47:25 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2010-10-08 10:47:25 -0400 |
| commit | bb74487c859acccb8f88002630606419761136e4 (patch) | |
| tree | eadeabd044a9fa06c789b957d9b2c823c47617dd /indra/llui/llbutton.cpp | |
| parent | 970ce1e1626c205302c4085610819571c1ce79f4 (diff) | |
| parent | d25a30e55b7e6a20173c3a53891489adc5610d72 (diff) | |
Merge fixes for VWR-23047, VWR-20911, and SNOW-748
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..65ef3e5f8f 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,11 +498,7 @@ 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) @@ -511,7 +506,6 @@ 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(); |
