From 64f30a302dfbcaf56502676fa4b8d8a06f355b40 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 20 Sep 2011 16:37:21 -0700 Subject: EXP-1228 FIX Create toolbar widget class that displays list of buttons horizontally or vertically buttons are now centered and sized according to content created floater_test_toolbar.xml to test --- indra/llui/llbutton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 2459429f6e..6c08ec7431 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -314,7 +314,7 @@ boost::signals2::connection LLButton::setHeldDownCallback( const commit_signal_t } -// *TODO: Deprecate (for backwards compatability only) +// *TODO: Deprecate (for backwards compatibility only) boost::signals2::connection LLButton::setClickedCallback( button_callback_t cb, void* data ) { return setClickedCallback(boost::bind(cb, data)); @@ -919,7 +919,7 @@ void LLButton::setToggleState(BOOL b) void LLButton::setFlashing( BOOL b ) { - if (b != mFlashing) + if ((bool)b != mFlashing) { mFlashing = b; mFlashingTimer.reset(); -- cgit v1.2.3 From cc56958452b8c10e1de176edb1924179ad04768a Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 26 Sep 2011 19:48:27 -0700 Subject: initial support for switching between icons only and icons + text --- indra/llui/llbutton.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 6c08ec7431..06781f1bdf 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -989,11 +989,27 @@ void LLButton::resize(LLUIString label) // get current btn length S32 btn_width =getRect().getWidth(); // check if it need resize - if (mAutoResize == TRUE) + if (mAutoResize) { - if (btn_width - (mRightHPad + mLeftHPad) < label_width) + S32 min_width = label_width + mLeftHPad + mRightHPad; + if (mImageOverlay) { - setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mLeft + label_width + mLeftHPad + mRightHPad , getRect().mBottom)); + switch(mImageOverlayAlignment) + { + case LLFontGL::LEFT: + case LLFontGL::RIGHT: + min_width += mImageOverlay->getWidth() + mImgOverlayLabelSpace; + break; + case LLFontGL::HCENTER: + break; + default: + // draw nothing + break; + } + } + if (btn_width < min_width) + { + reshape(min_width, getRect().getHeight()); } } } -- cgit v1.2.3 From 8912a9bef62386e5eecaa61ba9079d507ae16d90 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Sep 2011 15:53:38 -0700 Subject: EXP-1258 WIP toggle buttons between icons and icons+text modes better button sizing also disabled context menu for non-toolbar region --- indra/llui/llbutton.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 06781f1bdf..02ac928dfb 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -554,6 +554,16 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) return TRUE; } +void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height) +{ + overlay_width = mImageOverlay->getWidth(); + overlay_height = mImageOverlay->getHeight(); + + F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f); + overlay_width = llround((F32)overlay_width * scale_factor); + overlay_height = llround((F32)overlay_height * scale_factor); +} + // virtual void LLButton::draw() @@ -781,12 +791,10 @@ void LLButton::draw() if (mImageOverlay.notNull()) { // get max width and height (discard level 0) - S32 overlay_width = mImageOverlay->getWidth(); - S32 overlay_height = mImageOverlay->getHeight(); + S32 overlay_width; + S32 overlay_height; - F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f); - overlay_width = llround((F32)overlay_width * scale_factor); - overlay_height = llround((F32)overlay_height * scale_factor); + getOverlayImageSize(overlay_width, overlay_height); S32 center_x = getLocalRect().getCenterX(); S32 center_y = getLocalRect().getCenterY(); @@ -994,11 +1002,15 @@ void LLButton::resize(LLUIString label) S32 min_width = label_width + mLeftHPad + mRightHPad; if (mImageOverlay) { + S32 overlay_width = mImageOverlay->getWidth(); + F32 scale_factor = getRect().getHeight() / (F32)mImageOverlay->getHeight(); + overlay_width = llround((F32)overlay_width * scale_factor); + switch(mImageOverlayAlignment) { case LLFontGL::LEFT: case LLFontGL::RIGHT: - min_width += mImageOverlay->getWidth() + mImgOverlayLabelSpace; + min_width += overlay_width + mImgOverlayLabelSpace; break; case LLFontGL::HCENTER: break; -- cgit v1.2.3 From 68d5141fb3ccb5e898caa83e9eab84d76134e28c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Sep 2011 19:06:02 -0700 Subject: EXP-1258 WIP toggle buttons between icons and icons+text modes fixed button layout for icon+text layout stack now uses floating point precision to avoid clamping panels to 0 --- indra/llui/llbutton.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 02ac928dfb..e1bea086b2 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -819,6 +819,7 @@ void LLButton::draw() { case LLFontGL::LEFT: text_left += overlay_width + mImgOverlayLabelSpace; + text_width -= overlay_width + mImgOverlayLabelSpace; mImageOverlay->draw( mLeftHPad, center_y - (overlay_height / 2), @@ -836,6 +837,7 @@ void LLButton::draw() break; case LLFontGL::RIGHT: text_right -= overlay_width + mImgOverlayLabelSpace; + text_width -= overlay_width + mImgOverlayLabelSpace; mImageOverlay->draw( getRect().getWidth() - mRightHPad - overlay_width, center_y - (overlay_height / 2), -- cgit v1.2.3 From 78eb989e50e7f91298294d34a743f8ac0e3dcce1 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Sep 2011 19:22:09 -0700 Subject: EXP-1258 FIX toggle buttons between icons and icons+text modes fixed button layout for icon only buttons --- indra/llui/llbutton.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index e1bea086b2..f259e8027e 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1015,6 +1015,7 @@ void LLButton::resize(LLUIString label) min_width += overlay_width + mImgOverlayLabelSpace; break; case LLFontGL::HCENTER: + min_width = llmax(min_width, overlay_width + mLeftHPad + mRightHPad); break; default: // draw nothing -- cgit v1.2.3 From 93e3c8e4a51dd60c202bc2e3f11b9ae850b2b6c8 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 5 Oct 2011 16:28:40 -0700 Subject: EXP-1280 FIX -- Minimized floaters associated with toolbar buttons should change the state of their parent button * Toolbar buttons now display green when its corresponding floater is open or minimized. * Made changes to buttons so flash time and rate is configurable * Removed unused "highlight_color" attribute from LLButton * Implemented "isVisible" function for toolbar button floaters. It returns true when the floater is visible or minimized. * Toolbar floater unminimize now also puts focus to the floater * All commands now specify their "is_running_function" for toolbar button state * ButtonFlashCount and ButtonFlashRate have been moved to button.xml settings and are now configurable on the button. Toolbar buttons are set to never flash and this functionality is used to show which buttons have windows open. * All toybox buttons show hover glow even when disabled Reviewed by Richard. --- indra/llui/llbutton.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index f259e8027e..c9ee62296f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -83,7 +83,6 @@ LLButton::Params::Params() label_color_selected("label_color_selected"), // requires is_toggle true label_color_disabled("label_color_disabled"), label_color_disabled_selected("label_color_disabled_selected"), - highlight_color("highlight_color"), image_color("image_color"), image_color_disabled("image_color_disabled"), image_overlay_color("image_overlay_color", LLColor4::white), @@ -99,10 +98,13 @@ LLButton::Params::Params() scale_image("scale_image", true), hover_glow_amount("hover_glow_amount"), commit_on_return("commit_on_return", true), + display_pressed_state("display_pressed_state", true), use_draw_context_alpha("use_draw_context_alpha", true), badge("badge"), handle_right_mouse("handle_right_mouse"), - held_down_delay("held_down_delay") + held_down_delay("held_down_delay"), + button_flash_count("button_flash_count"), + button_flash_rate("button_flash_rate") { addSynonym(is_toggle, "toggle"); changeDefault(initial_value, LLSD(false)); @@ -136,7 +138,6 @@ LLButton::LLButton(const LLButton::Params& p) mSelectedLabelColor(p.label_color_selected()), mDisabledLabelColor(p.label_color_disabled()), mDisabledSelectedLabelColor(p.label_color_disabled_selected()), - mHighlightColor(p.highlight_color()), mImageColor(p.image_color()), mFlashBgColor(p.flash_color()), mDisabledImageColor(p.image_color_disabled()), @@ -159,12 +160,15 @@ LLButton::LLButton(const LLButton::Params& p) mCommitOnReturn(p.commit_on_return), mFadeWhenDisabled(FALSE), mForcePressedState(false), + mDisplayPressedState(p.display_pressed_state), mLastDrawCharsCount(0), mMouseDownSignal(NULL), mMouseUpSignal(NULL), mHeldDownSignal(NULL), mUseDrawContextAlpha(p.use_draw_context_alpha), - mHandleRightMouse(p.handle_right_mouse) + mHandleRightMouse(p.handle_right_mouse), + mButtonFlashCount(p.button_flash_count), + mButtonFlashRate(p.button_flash_rate) { static LLUICachedControl llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams()); @@ -570,15 +574,13 @@ void LLButton::draw() { F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); bool flash = FALSE; - static LLUICachedControl button_flash_rate("ButtonFlashRate", 0); - static LLUICachedControl button_flash_count("ButtonFlashCount", 0); if( mFlashing ) { F32 elapsed = mFlashingTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * button_flash_rate * 2.f); + S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > S32((F32)button_flash_count * 2.f); + flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); } bool pressed_by_keyboard = FALSE; @@ -607,7 +609,7 @@ void LLButton::draw() LLColor4 glow_color = LLColor4::white; LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; LLUIImage* imagep = NULL; - if (pressed) + if (pressed && mDisplayPressedState) { imagep = selected ? mImagePressedSelected : mImagePressed; } @@ -800,7 +802,7 @@ void LLButton::draw() S32 center_y = getLocalRect().getCenterY(); //FUGLY HACK FOR "DEPRESSED" BUTTONS - if (pressed) + if (pressed && mDisplayPressedState) { center_y--; center_x++; @@ -873,7 +875,7 @@ void LLButton::draw() S32 y_offset = 2 + (getRect().getHeight() - 20)/2; - if (pressed) + if (pressed && mDisplayPressedState) { y_offset--; x++; -- cgit v1.2.3 From adeaf71e3314e44a33864dbe90d93040d4247c67 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 6 Oct 2011 15:19:15 -0700 Subject: EXP-1300 WIP Visual feedback for Drag and Drop removed hover highlighting of buttons when dragging over them also updated toolbar button art to match spec --- indra/llui/llbutton.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index c9ee62296f..68cb5164b6 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -515,15 +515,6 @@ BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask) return TRUE; } - -void LLButton::onMouseEnter(S32 x, S32 y, MASK mask) -{ - LLUICtrl::onMouseEnter(x, y, mask); - - if (isInEnabledChain()) - mNeedsHighlight = TRUE; -} - void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) { LLUICtrl::onMouseLeave(x, y, mask); @@ -538,6 +529,10 @@ void LLButton::setHighlight(bool b) BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) { + if (isInEnabledChain() + && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this)) + mNeedsHighlight = TRUE; + if (!childrenHandleHover(x, y, mask)) { if (mMouseDownTimer.getStarted()) -- cgit v1.2.3 From 6a570a9bdc2660e4db87e8e7a65b724e1ad8d1b2 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 10 Oct 2011 17:52:37 -0700 Subject: fixed icons moving when clicking on icon-only toolbars --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 68cb5164b6..ba3748a573 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1002,7 +1002,7 @@ void LLButton::resize(LLUIString label) if (mImageOverlay) { S32 overlay_width = mImageOverlay->getWidth(); - F32 scale_factor = getRect().getHeight() / (F32)mImageOverlay->getHeight(); + F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight(); overlay_width = llround((F32)overlay_width * scale_factor); switch(mImageOverlayAlignment) -- cgit v1.2.3 From aec61c579a40687e2696d38a535143d59f771416 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 11 Oct 2011 10:07:19 -0700 Subject: Added 'execute_stop_function' command parameter to handle mouse down/up actions on toolbar buttons --- indra/llui/llbutton.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index ba3748a573..2e9c7a5d3d 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -296,6 +296,24 @@ void LLButton::onCommit() LLUICtrl::onCommit(); } +boost::signals2::connection LLButton::setClickedCallback(const CommitCallbackParam& cb) +{ + return setClickedCallback(initCommitCallback(cb)); +} +boost::signals2::connection LLButton::setMouseDownCallback(const CommitCallbackParam& cb) +{ + return setMouseDownCallback(initCommitCallback(cb)); +} +boost::signals2::connection LLButton::setMouseUpCallback(const CommitCallbackParam& cb) +{ + return setMouseUpCallback(initCommitCallback(cb)); +} +boost::signals2::connection LLButton::setHeldDownCallback(const CommitCallbackParam& cb) +{ + return setHeldDownCallback(initCommitCallback(cb)); +} + + boost::signals2::connection LLButton::setClickedCallback( const commit_signal_t::slot_type& cb ) { if (!mCommitSignal) mCommitSignal = new commit_signal_t(); -- cgit v1.2.3 From ca9ea840951bcfeaf46f07c9ee0974408c21792a Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 11 Oct 2011 15:54:56 -0700 Subject: * Dimmed overlay color on button image overlays to 0.75*alpha when buttons are unselected. --- indra/llui/llbutton.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 2e9c7a5d3d..0a7584a576 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -828,6 +828,10 @@ void LLButton::draw() { overlay_color.mV[VALPHA] = 0.5f; } + else if (!getToggleState()) + { + overlay_color.mV[VALPHA] = 0.75f; + } overlay_color.mV[VALPHA] *= alpha; switch(mImageOverlayAlignment) -- cgit v1.2.3 From d5d7e264ad636a42470772f5e96914327e30eca2 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 16:51:00 -0700 Subject: don't highlight toolbar buttons during drag and drop (for real) --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 0a7584a576..4f0c0d31bd 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -548,7 +548,7 @@ void LLButton::setHighlight(bool b) BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) { if (isInEnabledChain() - && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this)) + && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() == this)) mNeedsHighlight = TRUE; if (!childrenHandleHover(x, y, mask)) -- cgit v1.2.3 From 9206226a377c88d34036ebd8a3ac6d9d55bc4146 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 18:16:59 -0700 Subject: tooltips now only show labels for toolbar buttons when label is hidden or truncated tooltips are no longer instantaneous once a tooltip is visible --- indra/llui/llbutton.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 4f0c0d31bd..f40d99c024 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -732,16 +732,7 @@ void LLButton::draw() } // Unselected label assignments - LLWString label; - - if( getToggleState() ) - { - label = mSelectedLabel; - } - else - { - label = mUnselectedLabel; - } + LLWString label = getCurrentLabel(); // overlay with keyboard focus border if (hasFocus()) @@ -988,6 +979,23 @@ void LLButton::setLabelSelected( const LLStringExplicit& label ) mSelectedLabel = label; } +bool LLButton::labelIsTruncated() const +{ + return getCurrentLabel().getString().size() > mLastDrawCharsCount; +} + +const LLUIString& LLButton::getCurrentLabel() const +{ + if( getToggleState() ) + { + return mSelectedLabel; + } + else + { + return mUnselectedLabel; + } +} + void LLButton::setImageUnselected(LLPointer image) { mImageUnselected = image; @@ -999,16 +1007,7 @@ void LLButton::setImageUnselected(LLPointer image) void LLButton::autoResize() { - LLUIString label; - if(getToggleState()) - { - label = mSelectedLabel; - } - else - { - label = mUnselectedLabel; - } - resize(label); + resize(getCurrentLabel()); } void LLButton::resize(LLUIString label) -- cgit v1.2.3 From 63e4fdfc6498ad8a0af92e89759ae4fdb7035af6 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 13 Oct 2011 10:49:53 -0700 Subject: cleaned up floater reg, removed extraneous functions --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index f40d99c024..3572d18860 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1189,7 +1189,7 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) // Set the button control value (toggle state) to the floater visibility control (Sets the value as well) button->setControlVariable(LLFloater::getControlGroup()->getControl(vis_control_name)); // Set the clicked callback to toggle the floater - button->setClickedCallback(boost::bind(&LLFloaterReg::toggleFloaterInstance, sdname)); + button->setClickedCallback(boost::bind(&LLFloaterReg::toggleInstance, sdname, LLSD())); } // static -- cgit v1.2.3 From 93b6be6288036681c583e23be3b43ed23732352c Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 14 Oct 2011 14:46:21 -0700 Subject: New icon love for FUI --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3572d18860..64fd14ecc9 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -817,7 +817,7 @@ void LLButton::draw() LLColor4 overlay_color = mImageOverlayColor.get(); if (!enabled) { - overlay_color.mV[VALPHA] = 0.5f; + overlay_color.mV[VALPHA] = 0.3f; } else if (!getToggleState()) { -- cgit v1.2.3 From a2e32429bbe222342c413eb06e2820f6292e251a Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 17 Oct 2011 13:42:35 -0700 Subject: fix for not being able to drag disabled buttons --- indra/llui/llbutton.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 64fd14ecc9..2d3007cd5f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -85,7 +85,9 @@ LLButton::Params::Params() label_color_disabled_selected("label_color_disabled_selected"), image_color("image_color"), image_color_disabled("image_color_disabled"), - image_overlay_color("image_overlay_color", LLColor4::white), + image_overlay_color("image_overlay_color", LLColor4::white % 0.75f), + image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f), + image_overlay_selected_color("image_overlay_selected_color", LLColor4::white), flash_color("flash_color"), pad_right("pad_right", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), pad_left("pad_left", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), @@ -143,6 +145,8 @@ LLButton::LLButton(const LLButton::Params& p) mDisabledImageColor(p.image_color_disabled()), mImageOverlay(p.image_overlay()), mImageOverlayColor(p.image_overlay_color()), + mImageOverlayDisabledColor(p.image_overlay_disabled_color()), + mImageOverlaySelectedColor(p.image_overlay_selected_color()), mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), mImageOverlayTopPad(p.image_top_pad), mImageOverlayBottomPad(p.image_bottom_pad), @@ -817,11 +821,11 @@ void LLButton::draw() LLColor4 overlay_color = mImageOverlayColor.get(); if (!enabled) { - overlay_color.mV[VALPHA] = 0.3f; + overlay_color = mImageOverlayDisabledColor.get(); } else if (!getToggleState()) { - overlay_color.mV[VALPHA] = 0.75f; + overlay_color = mImageOverlaySelectedColor.get(); } overlay_color.mV[VALPHA] *= alpha; -- cgit v1.2.3 From ae3b5a4907b4611644d3b21c75ed420bc58593a2 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 17 Oct 2011 15:15:40 -0700 Subject: * Fixed icon opacity on selected and unselected buttons --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 2d3007cd5f..74b8885e1f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -823,7 +823,7 @@ void LLButton::draw() { overlay_color = mImageOverlayDisabledColor.get(); } - else if (!getToggleState()) + else if (getToggleState()) { overlay_color = mImageOverlaySelectedColor.get(); } -- cgit v1.2.3