diff options
author | brad kittenbrink <brad@lindenlab.com> | 2009-08-13 01:28:38 -0400 |
---|---|---|
committer | brad kittenbrink <brad@lindenlab.com> | 2009-08-13 01:28:38 -0400 |
commit | 39c2a584f47785c826c3bc133106f3689120bf32 (patch) | |
tree | 898695d92fc467672618f08260106ab773e456b5 /indra/llui/llslider.cpp | |
parent | a15feff98c13cd693e60fc59345609c007de16db (diff) | |
parent | efd58603da6062d90a5d7019987409994bc73858 (diff) |
Merged latest viewer-2.0.0-3 change up through svn r130333 into login-api.
Diffstat (limited to 'indra/llui/llslider.cpp')
-rw-r--r-- | indra/llui/llslider.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index 9483cca104..840dd9b089 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -51,6 +51,8 @@ LLSlider::Params::Params() thumb_outline_color("thumb_outline_color"), thumb_center_color("thumb_center_color"), thumb_image("thumb_image"), + thumb_image_pressed("thumb_image_pressed"), + thumb_image_disabled("thumb_image_disabled"), track_image("track_image"), track_highlight_image("track_highlight_image"), mouse_down_callback("mouse_down_callback"), @@ -66,6 +68,8 @@ LLSlider::LLSlider(const LLSlider::Params& p) mThumbOutlineColor(p.thumb_outline_color()), mThumbCenterColor(p.thumb_center_color()), mThumbImage(p.thumb_image), + mThumbImagePressed(p.thumb_image_pressed), + mThumbImageDisabled(p.thumb_image_disabled), mTrackImage(p.track_image), mTrackHighlightImage(p.track_highlight_image) { @@ -245,10 +249,6 @@ void LLSlider::draw() // drawing solids requires texturing be disabled gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - F32 opacity = getEnabled() ? 1.f : 0.3f; - LLColor4 center_color = (mThumbCenterColor.get() % opacity); - LLColor4 track_color = (mTrackColor.get() % opacity); - // Track LLRect track_rect(mThumbImage->getWidth() / 2, getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2), @@ -259,18 +259,38 @@ void LLSlider::draw() mTrackHighlightImage->draw(highlight_rect); // Thumb - if( hasMouseCapture() ) - { - // Show ghost where thumb was before dragging began. - mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor.get() % 0.3f); - } if (hasFocus()) { // Draw focus highlighting. mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); } - // Fill in the thumb. - mThumbImage->draw(mThumbRect, hasMouseCapture() ? mThumbOutlineColor.get() : center_color); + if( hasMouseCapture() ) // currently clicking on slider + { + // Show ghost where thumb was before dragging began. + if (mThumbImage.notNull()) + { + mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor.get() % 0.3f); + } + if (mThumbImagePressed.notNull()) + { + mThumbImagePressed->draw(mThumbRect, mThumbOutlineColor); + } + } + else if (!isInEnabledChain()) + { + if (mThumbImageDisabled.notNull()) + { + mThumbImageDisabled->draw(mThumbRect, mThumbCenterColor); + } + } + else + { + if (mThumbImage.notNull()) + { + mThumbImage->draw(mThumbRect, mThumbCenterColor); + } + } + LLUICtrl::draw(); } |