From 0daf4297d43e97a4b715196e9821cc290ebd65b3 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 13 Nov 2009 16:16:12 -0800 Subject: EXT-2484 Auto Set Touch to Buy when a user checks the For Sale option Reviewed with Richard. --- indra/newview/llpanelpermissions.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 2d3f901370..1051326e72 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -970,19 +970,32 @@ void LLPanelPermissions::setAllSaleInfo() if (price < 0) sale_type = LLSaleInfo::FS_NOT; - LLSaleInfo sale_info(sale_type, price); - LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info); + LLSaleInfo old_sale_info; + LLSelectMgr::getInstance()->selectGetSaleInfo(old_sale_info); + + LLSaleInfo new_sale_info(sale_type, price); + LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info); - // If turned off for-sale, make sure click-action buy is turned - // off as well - if (sale_type == LLSaleInfo::FS_NOT) + U8 old_click_action = 0; + LLSelectMgr::getInstance()->selectionGetClickAction(&old_click_action); + + if (old_sale_info.isForSale() + && !new_sale_info.isForSale() + && old_click_action == CLICK_ACTION_BUY) { - U8 click_action = 0; - LLSelectMgr::getInstance()->selectionGetClickAction(&click_action); - if (click_action == CLICK_ACTION_BUY) - { - LLSelectMgr::getInstance()->selectionSetClickAction(CLICK_ACTION_TOUCH); - } + // If turned off for-sale, make sure click-action buy is turned + // off as well + LLSelectMgr::getInstance()-> + selectionSetClickAction(CLICK_ACTION_TOUCH); + } + else if (new_sale_info.isForSale() + && !old_sale_info.isForSale() + && old_click_action == CLICK_ACTION_TOUCH) + { + // If just turning on for-sale, preemptively turn on one-click buy + // unless user have a different click action set + LLSelectMgr::getInstance()-> + selectionSetClickAction(CLICK_ACTION_BUY); } } -- cgit v1.2.3 From 1baf1d218644ac5dc00d9b41119a1ef168c709a2 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 16 Nov 2009 20:46:40 +0800 Subject: fix chat format for /me --- indra/llui/llstyle.cpp | 29 ++++++++++++++++++++-- indra/llui/llstyle.h | 5 ++++ indra/llui/lltextbase.cpp | 11 ++++---- indra/newview/llchathistory.cpp | 6 +++-- indra/newview/llchathistory.h | 2 +- indra/newview/llchatitemscontainerctrl.cpp | 24 ++++++++++++++++-- indra/newview/llexpandabletextbox.cpp | 5 ++-- indra/newview/llimfloater.cpp | 28 ++++++++++++++++++++- indra/newview/llnearbychat.cpp | 28 ++++++++++++++++++++- indra/newview/llnearbychathandler.cpp | 1 + indra/newview/lltoastimpanel.cpp | 4 +-- indra/newview/llviewerchat.cpp | 17 +++++++++++++ indra/newview/llviewerchat.h | 3 +-- indra/newview/llviewermessage.cpp | 40 ++++++++++++++++-------------- 14 files changed, 163 insertions(+), 40 deletions(-) diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index 71511f69a4..92c0b7c1b4 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -44,7 +44,10 @@ LLStyle::Params::Params() color("color", LLColor4::black), font("font", LLFontGL::getFontMonospace()), image("image"), - link_href("href") + link_href("href"), + italic("italic", false ), + bold("bold", false), + underline("bold", false) {} @@ -55,7 +58,10 @@ LLStyle::LLStyle(const LLStyle::Params& p) mFont(p.font()), mLink(p.link_href), mDropShadow(p.drop_shadow), - mImagep(p.image()) + mImagep(p.image()), + mItalic(p.italic()), + mBold(p.bold), + mUnderline(p.underline) {} void LLStyle::setFont(const LLFontGL* font) @@ -69,6 +75,25 @@ const LLFontGL* LLStyle::getFont() const return mFont; } +const S32 LLStyle::getFontStyle() const +{ + S32 ret = 0; + if (mBold) + { + ret |= LLFontGL::BOLD; + } + if (mItalic) + { + ret |= LLFontGL::ITALIC; + } + if (mUnderline) + { + ret |= LLFontGL::UNDERLINE; + } + return ret; +} + + void LLStyle::setLinkHREF(const std::string& href) { mLink = href; diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index ee9ca730e9..cc72011903 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -51,12 +51,17 @@ public: Optional font; Optional image; Optional link_href; + Optional italic; + Optional bold; + Optional underline; Params(); }; LLStyle(const Params& p = Params()); public: const LLColor4& getColor() const { return mColor; } void setColor(const LLColor4 &color) { mColor = color; } + + const S32 getFontStyle() const; const LLColor4& getReadOnlyColor() const { return mReadOnlyColor; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7b1aaac35c..d7697ac7cc 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1506,9 +1506,8 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c LLStyle::Params link_params = style_params; link_params.color = match.getColor(); // apply font name from requested style_params - std::string font_name = LLFontGL::nameFromFont(style_params.font()); - link_params.font.name.setIfNotProvided(font_name); - link_params.font.style = "UNDERLINE"; + std::string font_name = LLFontGL::nameFromFont(style_params.font()); + link_params.underline = true; link_params.link_href = match.getUrl(); // output the text before the Url @@ -2251,7 +2250,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele rect.mLeft, rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, - 0, + mStyle->getFontStyle(), mStyle->getShadowType(), length, rect.getWidth(), &right_x, @@ -2270,7 +2269,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele rect.mLeft, rect.mTop, LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), LLFontGL::LEFT, LLFontGL::TOP, - 0, + mStyle->getFontStyle(), LLFontGL::NO_SHADOW, length, rect.mRight, &right_x, @@ -2287,7 +2286,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele rect.mLeft, rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, - 0, + mStyle->getFontStyle(), mStyle->getShadowType(), length, rect.mRight, &right_x, diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 028bb7a384..bec8eb2666 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -345,7 +345,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style return header; } -void LLChatHistory::appendWidgetMessage(const LLChat& chat) +void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params) { LLView* view = NULL; std::string view_text = "\n[" + formatCurrentTime() + "] "; @@ -367,7 +367,9 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) style_params.color(txt_color); style_params.readonly_color(txt_color); style_params.font(fontp); - + style_params.italic = input_append_params.italic; + style_params.underline = input_append_params.underline; + style_params.bold = input_append_params.bold; if (mLastFromName == chat.mFromName) { diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index f689a225fe..c89d4b4ec6 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -109,7 +109,7 @@ class LLChatHistory : public LLTextEditor * @param time time of a message. * @param message message itself. */ - void appendWidgetMessage(const LLChat& chat); + void appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params = LLStyle::Params()); private: std::string mLastFromName; diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index d2e3247250..1cc6b2beef 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -173,10 +173,28 @@ void LLNearbyChatToastPanel::init(LLSD& notification) caption->getChild("msg_time", false)->setText(appendTime() , style_params ); - LLChatMsgBox* msg_text = getChild("msg_text", false); - msg_text->setText(mText, style_params); + + if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) + { + if (mFromName.size() > 0) + { + style_params.italic= true; + + msg_text->setText(mFromName, style_params); + } + mText = mText.substr(3); + style_params.underline = true; + msg_text->addText(mText,style_params); + } + else + { + msg_text->setText(mText, style_params); + } + + + LLUICtrl* msg_inspector = caption->getChild("msg_inspector"); if(mSourceType != CHAT_SOURCE_AGENT) msg_inspector->setVisible(false); @@ -196,6 +214,8 @@ void LLNearbyChatToastPanel::setMessage (const LLChat& chat_msg) notification["from_id"] = chat_msg.mFromID; notification["time"] = chat_msg.mTime; notification["source"] = (S32)chat_msg.mSourceType; + notification["chat_type"] = (S32)chat_msg.mChatType; + notification["chat_style"] = (S32)chat_msg.mChatStyle; std::string r_color_name="White"; F32 r_color_alpha = 1.0f; diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 6d7da107ac..27df6be730 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -80,7 +80,7 @@ public: draw_rect.mRight, draw_rect.mTop, mStyle->getColor(), LLFontGL::RIGHT, LLFontGL::TOP, - 0, + mStyle->getFontStyle(), mStyle->getShadowType(), end - start, draw_rect.getWidth(), &right_x, @@ -164,8 +164,7 @@ void LLExpandableTextBox::LLTextBoxEx::showExpandText() S32 last_line = visible_lines.second - 1; LLStyle::Params expander_style = getDefaultStyle(); - expander_style.font.name.setIfNotProvided(LLFontGL::nameFromFont(expander_style.font)); - expander_style.font.style = "UNDERLINE"; + expander_style.underline = true; expander_style.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); LLExpanderSegment* expanderp = new LLExpanderSegment(new LLStyle(expander_style), getLineStart(last_line), getLength() + 1, mExpanderLabel, *this); insertSegment(expanderp); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index e3121fbc7a..dff27ee032 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -477,7 +477,33 @@ void LLIMFloater::updateMessages() chat.mFromName = from; chat.mText = message; - mChatHistory->appendWidgetMessage(chat); + LLStyle::Params append_style_params; + //Handle IRC styled /me messages. + std::string prefix = message.substr(0, 4); + if (prefix == "/me " || prefix == "/me'") + { + if (from.size() > 0) + { + append_style_params.italic= true; + chat.mText = from + " "; + mChatHistory->appendWidgetMessage(chat, append_style_params); + } + message = message.substr(3); + + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + append_style_params.color(txt_color); + append_style_params.readonly_color(txt_color); + append_style_params.font(fontp); + append_style_params.underline = true; + mChatHistory->appendText(message, FALSE, append_style_params); + } + else + { + chat.mText = message; + mChatHistory->appendWidgetMessage(chat); + } mLastMessageIndex = msg["index"].asInteger(); } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 85db69174d..68677decae 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -155,7 +155,33 @@ void LLNearbyChat::addMessage(const LLChat& chat) if (!chat.mMuted) { - mChatHistory->appendWidgetMessage(chat); + std::string message = chat.mText; + std::string prefix = message.substr(0, 4); + if (chat.mChatStyle == CHAT_STYLE_IRC) + { + LLStyle::Params append_style_params; + if (chat.mFromName.size() > 0) + { + append_style_params.italic= true; + LLChat add_chat=chat; + add_chat.mText = chat.mFromName + " "; + mChatHistory->appendWidgetMessage(add_chat, append_style_params); + } + message = message.substr(3); + + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + append_style_params.color(txt_color); + append_style_params.readonly_color(txt_color); + append_style_params.font(fontp); + append_style_params.underline = true; + mChatHistory->appendText(message, FALSE, append_style_params); + } + else + { + mChatHistory->appendWidgetMessage(chat); + } } } diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 458845fff3..74a75d0369 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -341,6 +341,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) notification["time"] = chat_msg.mTime; notification["source"] = (S32)chat_msg.mSourceType; notification["chat_type"] = (S32)chat_msg.mChatType; + notification["chat_style"] = (S32)chat_msg.mChatStyle; std::string r_color_name = "White"; F32 r_color_alpha = 1.0f; diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 1ea5f515b7..3acab85bf7 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -56,9 +56,9 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif if (prefix == "/me " || prefix == "/me'") { mMessage->clear(); - style_params.font.style= "ITALIC"; + style_params.italic = true; mMessage->appendText(p.from + " ", FALSE, style_params); - style_params.font.style= "UNDERLINE"; + style_params.underline = true; mMessage->appendText(p.message.substr(3), FALSE, style_params); } else diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index d65a060bbc..ccf9ce9056 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -201,3 +201,20 @@ S32 LLViewerChat::getChatFontSize() { return gSavedSettings.getS32("ChatFontSize"); } + + +//static +void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg) +{ + std::string tmpmsg = chat.mText; + + if(chat.mChatStyle == CHAT_STYLE_IRC) + { + formated_msg = chat.mFromName + tmpmsg.substr(3); + } + else + { + formated_msg = tmpmsg; + } + +} \ No newline at end of file diff --git a/indra/newview/llviewerchat.h b/indra/newview/llviewerchat.h index d8840d5dd2..502d6ea7e5 100644 --- a/indra/newview/llviewerchat.h +++ b/indra/newview/llviewerchat.h @@ -45,8 +45,7 @@ public: static void getChatColor(const LLChat& chat, std::string& r_color_name, F32& r_color_alpha); static LLFontGL* getChatFont(); static S32 getChatFontSize(); - - + static void formatChatMsg(const LLChat& chat, std::string& formated_msg); }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0153116887..ef6a621323 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2343,14 +2343,14 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) std::string prefix = mesg.substr(0, 4); if (prefix == "/me " || prefix == "/me'") { - chat.mText = from_name; - chat.mText += mesg.substr(3); +// chat.mText = from_name; +// chat.mText += mesg.substr(3); ircstyle = TRUE; } - else - { +// else +// { chat.mText = mesg; - } +// } // Look for the start of typing so we can put "..." in the bubbles. if (CHAT_TYPE_START == chat.mChatType) @@ -2376,19 +2376,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) return; } - // We have a real utterance now, so can stop showing "..." and proceed. - if (chatter && chatter->isAvatar()) - { - LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); - ((LLVOAvatar*)chatter)->stopTyping(); - - if (!is_muted && !is_busy) - { - visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); - ((LLVOAvatar*)chatter)->addChat(chat); - } - } - // Look for IRC-style emotes if (ircstyle) { @@ -2428,6 +2415,23 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mText += mesg; } + // We have a real utterance now, so can stop showing "..." and proceed. + if (chatter && chatter->isAvatar()) + { + LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); + ((LLVOAvatar*)chatter)->stopTyping(); + + if (!is_muted && !is_busy) + { + visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); + std::string formated_msg = ""; + LLViewerChat::formatChatMsg(chat, formated_msg); + LLChat chat_bubble = chat; + chat_bubble.mText = formated_msg; + ((LLVOAvatar*)chatter)->addChat(chat_bubble); + } + } + if (chatter) { chat.mPosAgent = chatter->getPositionAgent(); -- cgit v1.2.3 From bce2cab144214b5a90a702e62f1e7c98e93fefc3 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 16 Nov 2009 21:27:08 +0800 Subject: EXT-2317 I18N: use the localized names for [ATTACHMENT_POINT] in strings.xml WornOnAttachmentPoint --- indra/newview/llinventorybridge.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7be09efa9..d18f9affe3 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3937,7 +3937,6 @@ std::string LLObjectBridge::getLabelSuffix() const if( avatar && avatar->isWearingAttachment( mUUID ) ) { std::string attachment_point_name = avatar->getAttachedPointName(mUUID); - LLStringUtil::toLower(attachment_point_name); LLStringUtil::format_map_t args; args["[ATTACHMENT_POINT]"] = attachment_point_name.c_str(); -- cgit v1.2.3 From d5efbfcd2874dd7045baabe33944da37e738872e Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 16 Nov 2009 12:36:35 -0800 Subject: Convert mForcePressedState to bool from BOOL --- indra/llui/llbutton.cpp | 2 +- indra/llui/llbutton.h | 4 ++-- indra/llui/llmenubutton.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index bbaf908d2e..b65f248db2 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -146,7 +146,7 @@ LLButton::LLButton(const LLButton::Params& p) mHoverGlowStrength(p.hover_glow_amount), mCommitOnReturn(p.commit_on_return), mFadeWhenDisabled(FALSE), - mForcePressedState(FALSE), + mForcePressedState(false), mLastDrawCharsCount(0) { static LLUICachedControl llbutton_orig_h_pad ("UIButtonOrigHPad", 0); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 08f289092f..3c1b57c4be 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -238,7 +238,7 @@ public: static void setDockableFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname); static void showHelp(LLUICtrl* ctrl, const LLSD& sdname); - void setForcePressedState(BOOL b) { mForcePressedState = b; } + void setForcePressedState(bool b) { mForcePressedState = b; } protected: LLPointer getImageUnselected() const { return mImageUnselected; } @@ -315,7 +315,7 @@ private: BOOL mNeedsHighlight; BOOL mCommitOnReturn; BOOL mFadeWhenDisabled; - BOOL mForcePressedState; + bool mForcePressedState; LLFrameTimer mFlashingTimer; }; diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index a657ed039a..cdbd17e4dc 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -133,11 +133,11 @@ void LLMenuButton::draw() if (mMenuVisibleLastFrame) { - setForcePressedState(TRUE); + setForcePressedState(true); } LLButton::draw(); - setForcePressedState(FALSE); + setForcePressedState(false); } -- cgit v1.2.3 From 7cc233b3a83bd82f7a42bf1f64901d2578beaf2c Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 16 Nov 2009 12:52:25 -0800 Subject: EXT-772 Dropbox widget needs "pressed" state - currently shows wrong art Reviewed with Richard. --- indra/llui/llcombobox.cpp | 19 +++++++++++++++++-- indra/llui/llcombobox.h | 3 ++- indra/newview/skins/default/textures/textures.xml | 1 + indra/newview/skins/default/xui/en/widgets/button.xml | 4 ++++ .../skins/default/xui/en/widgets/combo_box.xml | 4 +++- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 36e309d639..803978bfa2 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -109,7 +109,8 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p) // Text label button LLButton::Params button_params = (mAllowTextEntry ? p.combo_button : p.drop_down_button); - button_params.mouse_down_callback.function(boost::bind(&LLComboBox::onButtonDown, this)); + button_params.mouse_down_callback.function( + boost::bind(&LLComboBox::onButtonMouseDown, this)); button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); button_params.rect(p.rect); @@ -140,6 +141,10 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p) mList = LLUICtrlFactory::create(params); addChild(mList); + // Mouse-down on button will transfer mouse focus to the list + // Grab the mouse-up event and make sure the button state is correct + mList->setMouseUpCallback(boost::bind(&LLComboBox::onListMouseUp, this)); + for (LLInitParam::ParamIterator::const_iterator it = p.items().begin(); it != p.items().end(); ++it) @@ -644,7 +649,7 @@ void LLComboBox::hideList() } } -void LLComboBox::onButtonDown() +void LLComboBox::onButtonMouseDown() { if (!mList->getVisible()) { @@ -670,6 +675,10 @@ void LLComboBox::onButtonDown() if (mButton->hasMouseCapture()) { gFocusMgr.setMouseCapture(mList); + + // But keep the "pressed" look, which buttons normally lose when they + // lose focus + mButton->setForcePressedState(true); } } else @@ -679,6 +688,12 @@ void LLComboBox::onButtonDown() } +void LLComboBox::onListMouseUp() +{ + // In some cases this is the termination of a mouse click that started on + // the button, so clear its pressed state + mButton->setForcePressedState(false); +} //------------------------------------------------------------------ // static functions diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 6285ca5170..11acdb9b8f 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -204,7 +204,8 @@ public: void setButtonVisible(BOOL visible); - void onButtonDown(); + void onButtonMouseDown(); + void onListMouseUp(); void onItemSelected(const LLSD& data); void onTextCommit(const LLSD& data); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index d5293bdbb5..8af65b25e9 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -106,6 +106,7 @@ + diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 5bb48ef5aa..6b11e72247 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -1,4 +1,8 @@ +