From 22c2fff4ba4198b8dca8367ae3f03d189e815770 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 14 Dec 2012 19:56:05 +0200 Subject: CHUI-566 Flashing and color on Conversations FUI button and conversation line item --- indra/llui/llbutton.cpp | 36 +++++++------------ indra/newview/llimview.cpp | 42 ++++++++++++++-------- indra/newview/skins/default/colors.xml | 3 ++ .../skins/default/xui/en/widgets/toolbar.xml | 12 +++---- 4 files changed, 48 insertions(+), 45 deletions(-) (limited to 'indra') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index f82cdc64a9..99384439d2 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -613,29 +613,11 @@ void LLButton::draw() static LLCachedControl sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); - bool flash = false; if (mFlashingTimer) { mFlashing = mFlashingTimer->isFlashingInProgress(); - flash = mFlashing && (!sEnableButtonFlashing || mFlashingTimer->isCurrentlyHighlighted()); - } - else - { - if(mFlashing) - { - if ( sEnableButtonFlashing) - { - F32 elapsed = mFrameTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); - // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); - } - else - { // otherwise just highlight button in flash color - flash = true; - } - } } + bool flash = mFlashing && sEnableButtonFlashing; bool pressed_by_keyboard = FALSE; if (hasFocus()) @@ -660,7 +642,8 @@ void LLButton::draw() bool selected = getToggleState(); bool use_glow_effect = FALSE; - LLColor4 glow_color = LLColor4::white; + LLColor4 highlighting_color = LLColor4::white; + LLColor4 glow_color; LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; LLUIImage* imagep = NULL; if (pressed && mDisplayPressedState) @@ -733,10 +716,15 @@ void LLButton::draw() LLColor4 flash_color = mFlashBgColor.get(); use_glow_effect = TRUE; glow_type = LLRender::BT_ALPHA; // blend the glow - if (mNeedsHighlight) // highlighted AND flashing - glow_color = (glow_color*0.5f + flash_color*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity - else + + if (mFlashingTimer->isCurrentlyHighlighted()) + { glow_color = flash_color; + } + else if (mNeedsHighlight) + { + glow_color = highlighting_color; + } } } @@ -785,7 +773,7 @@ void LLButton::draw() if (use_glow_effect) { mCurGlowStrength = lerp(mCurGlowStrength, - mFlashing ? (flash? 1.0 : 0.0) + mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 7e02915b43..5b4d5466a1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -160,10 +160,16 @@ void on_new_message(const LLSD& msg) LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); //session floater not focused (visible or not) - bool sessionFloaterNotFocused = session_floater && !session_floater->hasFocus(); + bool session_floater_not_focused = session_floater && !session_floater->hasFocus(); + //conv. floater is closed + bool conversation_floater_is_closed = + !( im_box + && im_box->isInVisibleChain() + && !im_box->isMinimized()); //conversation floater not focused (visible or not) - bool conversationFloaterNotFocused = im_box && !im_box->hasFocus(); + bool conversation_floater_not_focused = + conversation_floater_is_closed || !im_box->hasFocus(); if ("toast" == action) { @@ -187,12 +193,12 @@ void on_new_message(const LLSD& msg) } //User is not focused on conversation containing the message - if(sessionFloaterNotFocused) + if(session_floater_not_focused) { im_box->flashConversationItemWidget(session_id, true); //The conversation floater isn't focused/open - if(conversationFloaterNotFocused) + if(conversation_floater_not_focused) { gToolBarView->flashCommand(LLCommandId("chat"), true); @@ -204,23 +210,29 @@ void on_new_message(const LLSD& msg) } } } + else if ("flash" == action) { - //User is not focused on conversation containing the message - if(sessionFloaterNotFocused && conversationFloaterNotFocused) - { - gToolBarView->flashCommand(LLCommandId("chat"), true); - } - //conversation floater is open but a different conversation is focused - else if(sessionFloaterNotFocused) - { - im_box->flashConversationItemWidget(session_id, true); - } + if (session_floater_not_focused) + { + //User is not focused on conversation containing the message + + if(conversation_floater_not_focused) + { + gToolBarView->flashCommand(LLCommandId("chat"), true); + } + //conversation floater is open but a different conversation is focused + else + { + im_box->flashConversationItemWidget(session_id, true); + } + } } + else if("openconversations" == action) { //User is not focused on conversation containing the message - if(sessionFloaterNotFocused) + if(session_floater_not_focused) { //Flash line item im_box->flashConversationItemWidget(session_id, true); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 05230b8bd5..afd8ee4ba1 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -11,6 +11,9 @@ + diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml index 053b213ef4..0ace37a5dc 100644 --- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml +++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml @@ -30,9 +30,9 @@ image_overlay_alignment="left" use_ellipses="true" auto_resize="true" - button_flash_count="3" - button_flash_rate="0.25" - flash_color="EmphasisColor"/> + button_flash_count="4" + button_flash_rate="0.5" + flash_color="BeaconColor"/> + button_flash_count="4" + button_flash_rate="0.5" + flash_color="BeaconColor"/> -- cgit v1.2.3 From d2102c9b9f7ad31d3b5061a19f7b955af2f34b9f Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Wed, 19 Dec 2012 17:26:55 +0200 Subject: CHUI-601 : Fixed : Crash when dismissing a conversation while a participant is selected DeletePointer() for the items was replaced by Function LLFolderViewItem::destroyView(): Function LLFolderViewItem::destroyView(), before removing the item, immediately removes it from the Selection List of the Root Folder. As a result, at the time of the call of sanitizeSelection(), will not need to try to handle the elements that have already been deleted. --- indra/llui/llfolderviewitem.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0a06ce66aa..dc7e4777a7 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1481,17 +1481,20 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) void LLFolderViewFolder::destroyView() { - std::for_each(mItems.begin(), mItems.end(), DeletePointer()); - mItems.clear(); + while (!mItems.empty()) + { + LLFolderViewItem *itemp = mItems.back(); + itemp->destroyView(); // LLFolderViewItem::destroyView() removes entry from mItems + } while (!mFolders.empty()) { LLFolderViewFolder *folderp = mFolders.back(); - folderp->destroyView(); // removes entry from mFolders + folderp->destroyView(); // LLFolderVievFolder::destroyView() removes entry from mFolders } LLFolderViewItem::destroyView(); - } +} // extractItem() removes the specified item from the folder, but // doesn't delete it. -- cgit v1.2.3 From b34e3a1b40fd72b4c4cdc1553c3f5934e9e9cef5 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 18 Dec 2012 18:30:14 +0200 Subject: Clean up: Removed unnecessary call removeConversationListItem() when floater closes (If session's floater will be removed for any reason, then will start a removing of the corresponding session and removeConversationListItem() will call from a session's observer); Local variable are renamed in accordance with the code styling --- indra/newview/llfloaterimcontainer.cpp | 7 ++++--- indra/newview/llfloaterimsessiontab.cpp | 13 ------------- indra/newview/llfloaterimsessiontab.h | 1 - 3 files changed, 4 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index ba5ec363d6..390eec84f6 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1412,17 +1412,18 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c // Delete the widget and the associated conversation item // Note : since the mConversationsItems is also the listener to the widget, deleting // the widget will also delete its listener - bool isWidgetSelected = false; + bool is_widget_selected = false; LLFolderViewItem* new_selection = NULL; LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid); if (widget) { - isWidgetSelected = widget->isSelected(); + is_widget_selected = widget->isSelected(); new_selection = mConversationsRoot->getNextFromChild(widget); if(new_selection == NULL) { new_selection = mConversationsRoot->getPreviousFromChild(widget); } + widget->destroyView(); } @@ -1445,7 +1446,7 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c } } } - return isWidgetSelected; + return is_widget_selected; } LLConversationViewSession* LLFloaterIMContainer::createConversationItemWidget(LLConversationItem* item) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index d6955f37f2..7984034ded 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -748,19 +748,6 @@ void LLFloaterIMSessionTab::onOpen(const LLSD& key) } } -// virtual -void LLFloaterIMSessionTab::onClose(bool app_quitting) -{ - // Always suppress the IM from the conversations list on close if present for any reason - if (LLFloaterIMSessionTab::isChatMultiTab()) - { - LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance(); - if (im_box) - { - im_box->removeConversationListItem(mKey); - } - } -} void LLFloaterIMSessionTab::onTearOffClicked() { diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index a452c77224..0fa99a46be 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -77,7 +77,6 @@ public: // LLFloater overrides /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); /*virtual*/ BOOL postBuild(); /*virtual*/ void draw(); /*virtual*/ void setVisible(BOOL visible); -- cgit v1.2.3