From 2aca9b39d467f48984c246d93e3393b9851929db Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 10 Apr 2013 19:39:56 +0300 Subject: CHUI-932 FIXED Restore previous text only if there is no gesture. --- indra/newview/llfloaterimnearbychat.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 266b5b20ee..7e472466ed 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -568,7 +568,10 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) if (0 == channel) { // discard returned "found" boolean - LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text); + if(!LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text)) + { + utf8_revised_text = utf8text; + } } else { @@ -582,7 +585,6 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) if (!utf8_revised_text.empty()) { // Chat with animation - utf8_revised_text = utf8text; sendChatFromViewer(utf8_revised_text, type, TRUE); } } -- cgit v1.2.3 From c59aeef9664a1d9b6357a66a6eff0eab6d24b3eb Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 11 Apr 2013 00:18:00 +0300 Subject: CHUI-921 FIXED Default position of open floaters starts at left edge of viewer behind toolbar --- indra/llui/llfloater.cpp | 2 +- indra/newview/llviewerwindow.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 09e27a264a..5873df5169 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2788,7 +2788,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } // move window fully onscreen - if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) + if (floater->translateIntoRect( gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index be508ad17d..45ff75bb34 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1798,6 +1798,7 @@ void LLViewerWindow::initBase() // Constrain floaters to inside the menu and status bar regions. gFloaterView = main_view->getChild("Floater View"); + gFloaterView->setFloaterSnapView(main_view->getChild("floater_snap_region")->getHandle()); gSnapshotFloaterView = main_view->getChild("Snapshot Floater View"); // Console -- cgit v1.2.3 From 33d6f8a5953a6860bf1233d4a715f16a5b627cc0 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 12 Apr 2013 14:58:11 +0300 Subject: CHUI-934 FIXED Don't try to close Session floater if it is already doesn't exist. --- indra/newview/llfloaterimsession.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index edc25a7d7e..6ed04f8716 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -469,7 +469,10 @@ void LLFloaterIMSession::addP2PSessionParticipants(const LLSD& notification, con temp_ids.insert(temp_ids.end(), uuids.begin(), uuids.end()); // then we can close the current session - onClose(false); + if(findInstance(mSessionID)) + { + onClose(false); + } // we start a new session so reset the initialization flag mSessionInitialized = false; -- cgit v1.2.3 From 3c2c897cac98e39dcc0447c2d7d458ba313a8cd6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 12 Apr 2013 20:27:28 +0300 Subject: CHUI-916 FIXED Clear mMisspellRanges if spell check is not needed. --- indra/llui/lltextbase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index a815cfc176..def1277ba7 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -652,6 +652,10 @@ void LLTextBase::drawText() mSpellCheckEnd = end; } } + else + { + mMisspellRanges.clear(); + } LLTextSegmentPtr cur_segment = *seg_iter; -- cgit v1.2.3 From 9ab92603ce9ca54d4ef5571196f34ba5f0875286 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 17 Apr 2013 14:41:05 +0300 Subject: CHUI-936 FIXED Do not show Conversation log floater if logging is disabled. --- indra/newview/lldonotdisturbnotificationstorage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 82affcf068..1cb650e4ea 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -215,7 +215,8 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() LLFloaterReg::showInstance("im_container"); } - if(group_ad_hoc_toast_exists) + bool isConversationLoggingAllowed = gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0; + if(group_ad_hoc_toast_exists && isConversationLoggingAllowed) { LLFloaterReg::showInstance("conversation"); } -- cgit v1.2.3 From fa36f85b007a124c418fd8cfc0e836cc7fdc86cf Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine Date: Tue, 9 Apr 2013 20:50:54 +0300 Subject: CHUI-797 FIXED Only one separated conversation window is shown after exiting from mouselook view Added all separated conversation floaters to skip list used in gFloaterView->popVisibleAll(skip_list) in llagent.cpp since LLFloaterIMContainer::setVisible() takes control of them by itself. --- indra/llui/llfloater.cpp | 5 +++++ indra/llui/llfloater.h | 1 + indra/newview/llagent.cpp | 13 ++++++++++++- indra/newview/llconversationview.cpp | 14 +++++++++----- indra/newview/llconversationview.h | 2 ++ indra/newview/llfloaterimcontainer.cpp | 18 ++++++++++++++++++ indra/newview/llfloaterimcontainer.h | 2 ++ 7 files changed, 49 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 5873df5169..6816137e52 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3258,6 +3258,11 @@ bool LLFloater::isShown() const return ! isMinimized() && isInVisibleChain(); } +bool LLFloater::isDetachedAndNotMinimized() +{ + return !getHost() && !isMinimized(); +} + /* static */ bool LLFloater::isShown(const LLFloater* floater) { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 4dba1e645f..26ac4a98ad 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -238,6 +238,7 @@ public: void center(); LLMultiFloater* getHost(); + bool isDetachedAndNotMinimized(); void applyTitle(); std::string getCurrentTitle() const; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 094d502078..e0ab70bac7 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -45,6 +45,7 @@ #include "llenvmanager.h" #include "llfirstuse.h" #include "llfloatercamera.h" +#include "llfloaterimcontainer.h" #include "llfloaterreg.h" #include "llfloatertools.h" #include "llgroupactions.h" @@ -90,6 +91,7 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" +#include "boost/foreach.hpp" using namespace LLVOAvatarDefines; @@ -2002,7 +2004,16 @@ void LLAgent::endAnimationUpdateUI() { skip_list.insert(LLFloaterReg::findInstance("mini_map")); } - + + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance("im_container"); + LLFloaterIMContainer::floater_list_t conversations; + im_box->getDetachedConversationFloaters(conversations); + BOOST_FOREACH(LLFloater* conversation, conversations) + { + llinfos << "skip_list.insert(session_floater): " << conversation->getTitle() << llendl; + skip_list.insert(conversation); + } + gFloaterView->popVisibleAll(skip_list); #endif mViewsPushed = FALSE; diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index b6c53e5e30..911e14bcd5 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -340,16 +340,20 @@ void LLConversationViewSession::setVisibleIfDetached(BOOL visible) { // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here - LLFolderViewModelItem* item = mViewModelItem; - LLUUID session_uuid = dynamic_cast(item)->getUUID(); - LLFloater* session_floater = LLFloaterIMSessionTab::getConversation(session_uuid); - - if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) + LLFloater* session_floater = getSessionFloater(); + if (session_floater && session_floater->isDetachedAndNotMinimized()) { session_floater->setVisible(visible); } } +LLFloater* LLConversationViewSession::getSessionFloater() +{ + LLFolderViewModelItem* item = mViewModelItem; + LLUUID session_uuid = dynamic_cast(item)->getUUID(); + return LLFloaterIMSessionTab::getConversation(session_uuid); +} + LLConversationViewParticipant* LLConversationViewSession::findParticipant(const LLUUID& participant_id) { // This is *not* a general tree parsing algorithm. We search only in the mItems list diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 3eb2e63792..7e432804d0 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -87,6 +87,8 @@ public: /*virtual*/ void setFlashState(bool flash_state); + LLFloater* getSessionFloater(); + private: void onCurrentVoiceSessionChanged(const LLUUID& session_id); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index f89e818928..8575f6f055 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -54,6 +54,7 @@ #include "llworld.h" #include "llsdserialize.h" #include "llviewerobjectlist.h" +#include "boost/foreach.hpp" // // LLFloaterIMContainer @@ -660,6 +661,23 @@ void LLFloaterIMContainer::setVisible(BOOL visible) LLMultiFloater::setVisible(visible); } +void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters) +{ + typedef conversations_widgets_map::value_type conv_pair; + BOOST_FOREACH(conv_pair item, mConversationsWidgets) + { + LLConversationViewSession* widget = dynamic_cast(item.second); + if (widget) + { + LLFloater* session_floater = widget->getSessionFloater(); + if (session_floater && session_floater->isDetachedAndNotMinimized()) + { + floaters.push_back(session_floater); + } + } + } +} + void LLFloaterIMContainer::setVisibleAndFrontmost(BOOL take_focus, const LLSD& key) { LLMultiFloater::setVisibleAndFrontmost(take_focus, key); diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index f6c716e2cf..5ea1a38c63 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -194,6 +194,8 @@ public: bool isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget); boost::signals2::connection mMicroChangedSignal; S32 getConversationListItemSize() { return mConversationsWidgets.size(); } + typedef std::list floater_list_t; + void getDetachedConversationFloaters(floater_list_t& floaters); private: LLConversationViewSession* createConversationItemWidget(LLConversationItem* item); -- cgit v1.2.3 From 4106d203e016077fe9e233da8fbaa9e2e9a24403 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 18 Apr 2013 19:13:28 +0300 Subject: CHUI-938 FIXED Pop up (?) notification steals focus --- indra/llui/llfloater.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 6816137e52..d97569839a 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -507,22 +507,11 @@ LLFloater::~LLFloater() { LLFloaterReg::removeInstance(mInstanceName, mKey); -// delete mNotificationContext; -// mNotificationContext = NULL; - - //// am I not hosted by another floater? - //if (mHostHandle.isDead()) - //{ - // LLFloaterView* parent = (LLFloaterView*) getParent(); - - // if( parent ) - // { - // parent->removeChild( this ); - // } - //} - - // Just in case we might still have focus here, release it. - releaseFocus(); + if( gFocusMgr.childHasKeyboardFocus(this)) + { + // Just in case we might still have focus here, release it. + releaseFocus(); + } // This is important so that floaters with persistent rects (i.e., those // created with rect control rather than an LLRect) are restored in their -- cgit v1.2.3 From 0193a7b74ccc09788e8d2503244f30ac231546cc Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 16 Apr 2013 04:55:09 +0300 Subject: CHUI-808 FIXED Draggable separator between conversations and message pane is not discoverable: - final solution; --- indra/llui/lllayoutstack.cpp | 103 +++++++++++++++---- indra/llui/lllayoutstack.h | 10 ++ indra/llui/llresizebar.cpp | 110 ++++++++++++++++++++- indra/llui/llresizebar.h | 52 +++++----- indra/newview/llfloaterimcontainer.cpp | 15 ++- indra/newview/llfloaterimsessiontab.cpp | 2 +- indra/newview/skins/default/colors.xml | 15 +++ indra/newview/skins/default/textures/textures.xml | 3 + .../textures/widgets/horizontal_drag_handle.png | Bin 0 -> 197 bytes .../textures/widgets/vertical_drag_handle.png | Bin 0 -> 196 bytes .../skins/default/xui/en/floater_im_container.xml | 100 ++++++++++--------- .../skins/default/xui/en/floater_im_session.xml | 88 +++++++---------- 12 files changed, 339 insertions(+), 159 deletions(-) create mode 100644 indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png create mode 100644 indra/newview/skins/default/textures/widgets/vertical_drag_handle.png (limited to 'indra') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index e642883991..c89c0203b4 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -214,8 +214,15 @@ LLLayoutStack::Params::Params() open_time_constant("open_time_constant", 0.02f), close_time_constant("close_time_constant", 0.03f), resize_bar_overlap("resize_bar_overlap", 1), - border_size("border_size", LLCachedControl(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)) -{} + border_size("border_size", LLCachedControl(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)), + show_drag_handle("show_drag_handle", false), + drag_handle_first_indent("drag_handle_first_indent", 0), + drag_handle_second_indent("drag_handle_second_indent", 0), + drag_handle_thickness("drag_handle_thickness", 5), + drag_handle_shift("drag_handle_shift", 2) +{ + addSynonym(border_size, "drag_handle_gap"); +} LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) : LLView(p), @@ -227,8 +234,14 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mClip(p.clip), mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), - mResizeBarOverlap(p.resize_bar_overlap) -{} + mResizeBarOverlap(p.resize_bar_overlap), + mShowDragHandle(p.show_drag_handle), + mDragHandleFirstIndent(p.drag_handle_first_indent), + mDragHandleSecondIndent(p.drag_handle_second_indent), + mDragHandleThickness(p.drag_handle_thickness), + mDragHandleShift(p.drag_handle_shift) +{ +} LLLayoutStack::~LLLayoutStack() { @@ -262,6 +275,26 @@ void LLLayoutStack::draw() drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } } + + const LLView::child_list_t * child_listp = getChildList(); + BOOST_FOREACH(LLView * childp, * child_listp) + { + LLResizeBar * resize_barp = dynamic_cast(childp); + if (resize_barp && resize_barp->isShowDragHandle() && resize_barp->getVisible() && resize_barp->getRect().isValid()) + { + LLRect screen_rect = resize_barp->calcScreenRect(); + if (LLUI::getRootView()->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) + { + LLUI::pushMatrix(); + { + const LLRect& rb_rect(resize_barp->getRect()); + LLUI::translate(rb_rect.mLeft, rb_rect.mBottom); + resize_barp->draw(); + } + LLUI::popMatrix(); + } + } + } } void LLLayoutStack::removeChild(LLView* view) @@ -390,7 +423,6 @@ void LLLayoutStack::updateLayout() BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) { F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim); - F32 panel_visible_dim = panelp->getVisibleDim(); LLRect panel_rect; if (mOrientation == HORIZONTAL) @@ -407,27 +439,61 @@ void LLLayoutStack::updateLayout() getRect().getWidth(), llround(panel_dim)); } - panelp->setIgnoreReshape(true); - panelp->setShape(panel_rect); - panelp->setIgnoreReshape(false); LLRect resize_bar_rect(panel_rect); - + LLResizeBar * resize_barp = panelp->getResizeBar(); + bool show_drag_handle = resize_barp->isShowDragHandle(); F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount(); + F32 panel_visible_dim = panelp->getVisibleDim(); + S32 panel_spacing_round = (S32)(llround(panel_spacing)); + if (mOrientation == HORIZONTAL) { - resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; - resize_bar_rect.mRight = panel_rect.mRight + (S32)(llround(panel_spacing)) + mResizeBarOverlap; - cur_pos += panel_visible_dim + panel_spacing; + + if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + { + resize_bar_rect.mLeft = panel_rect.mRight + mDragHandleShift; + resize_bar_rect.mRight = resize_bar_rect.mLeft + mDragHandleThickness; + } + else + { + resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; + resize_bar_rect.mRight = panel_rect.mRight + panel_spacing_round + mResizeBarOverlap; + } + + if (show_drag_handle) + { + resize_bar_rect.mBottom += mDragHandleSecondIndent; + resize_bar_rect.mTop -= mDragHandleFirstIndent; + } + } else //VERTICAL { - resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; - resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llround(panel_spacing)) - mResizeBarOverlap; - cur_pos -= panel_visible_dim + panel_spacing; + + if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + { + resize_bar_rect.mTop = panel_rect.mBottom - mDragHandleShift; + resize_bar_rect.mBottom = resize_bar_rect.mTop - mDragHandleThickness; + } + else + { + resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; + resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing_round - mResizeBarOverlap; + } + + if (show_drag_handle) + { + resize_bar_rect.mLeft += mDragHandleFirstIndent; + resize_bar_rect.mRight -= mDragHandleSecondIndent; + } } + + panelp->setIgnoreReshape(true); + panelp->setShape(panel_rect); + panelp->setIgnoreReshape(false); panelp->mResizeBar->setShape(resize_bar_rect); } @@ -475,15 +541,13 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) { if (lp->mResizeBar == NULL) { - LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; - LLRect resize_bar_rect = getRect(); - LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); resize_params.min_size(lp->getRelevantMinDim()); - resize_params.side(side); + resize_params.side((mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM); resize_params.snapping_enabled(false); + resize_params.show_drag_handle(mShowDragHandle); LLResizeBar* resize_bar = LLUICtrlFactory::create(resize_params); lp->mResizeBar = resize_bar; LLView::addChild(resize_bar, 0); @@ -865,3 +929,4 @@ void LLLayoutStack::updateResizeBarLimits() previous_visible_panelp = visible_panelp; } } + diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 02c664f1a0..b570974bd6 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -62,6 +62,11 @@ public: Optional open_time_constant, close_time_constant; Optional resize_bar_overlap; + Optional show_drag_handle; + Optional drag_handle_first_indent; + Optional drag_handle_second_indent; + Optional drag_handle_thickness; + Optional drag_handle_shift; Params(); }; @@ -126,6 +131,11 @@ private: F32 mCloseTimeConstant; bool mNeedsLayout; S32 mResizeBarOverlap; + bool mShowDragHandle; + S32 mDragHandleFirstIndent; + S32 mDragHandleSecondIndent; + S32 mDragHandleThickness; + S32 mDragHandleShift; }; // end class LLLayoutStack diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 15e56cbfe5..cfdc951542 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -28,14 +28,53 @@ #include "llresizebar.h" +#include "lllocalcliprect.h" #include "llmath.h" #include "llui.h" #include "llmenugl.h" #include "llfocusmgr.h" #include "llwindow.h" +class LLImagePanel : public LLPanel +{ +public: + struct Params : public LLInitParam::Block + { + Optional horizontal; + Params() : horizontal("horizontal", false) {} + }; + LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {} + virtual ~LLImagePanel() {} + + void draw() + { + const LLRect& parent_rect = getParent()->getRect(); + const LLRect& rect = getRect(); + LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2 + , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom); + LLLocalClipRect clip(clip_rect); + LLPanel::draw(); + } + +private: + bool mHorizontal; +}; + +static LLDefaultChildRegistry::Register t1("resize_bar_image_panel"); + +LLResizeBar::Params::Params() +: max_size("max_size", S32_MAX), + snapping_enabled("snapping_enabled", true), + resizing_view("resizing_view"), + side("side"), + allow_double_click_snapping("allow_double_click_snapping", true), + show_drag_handle("show_drag_handle", false) +{ + name = "resize_bar"; +} + LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) -: LLView(p), +: LLPanel(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), @@ -46,7 +85,9 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) mSnappingEnabled(p.snapping_enabled), mAllowDoubleClickSnapping(p.allow_double_click_snapping), mResizingView(p.resizing_view), - mResizeListener(NULL) + mResizeListener(NULL), + mShowDragHandle(p.show_drag_handle), + mImagePanel(NULL) { setFollowsNone(); // set up some generically good follow code. @@ -75,8 +116,37 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) default: break; } + + if (mShowDragHandle) + { + LLViewBorder::Params border_params; + border_params.border_thickness = 1; + border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderlight"); + border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); + + addBorder(border_params); + setBorderVisible(TRUE); + + LLImagePanel::Params image_panel; + mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle"); + image_panel.bg_alpha_image = mDragHandleImage; + image_panel.background_visible = true; + image_panel.horizontal = (LLResizeBar::BOTTOM == mSide); + mImagePanel = LLUICtrlFactory::create(image_panel); + setImagePanel(mImagePanel); + } } +BOOL LLResizeBar::postBuild() +{ + if (mShowDragHandle) + { + setBackgroundVisible(TRUE); + setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody")); + } + + return LLPanel::postBuild(); +} BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask) { @@ -342,3 +412,39 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } +void LLResizeBar::setImagePanel(LLPanel * panelp) +{ + const LLView::child_list_t * children = getChildList(); + if (getChildCount() == 2) + { + LLPanel * image_panelp = dynamic_cast(children->back()); + if (image_panelp) + { + removeChild(image_panelp); + delete image_panelp; + } + } + + addChild(panelp); + sendChildToBack(panelp); +} + +LLPanel * LLResizeBar::getImagePanel() const +{ + return getChildCount() > 0 ? (LLPanel *)getChildList()->back() : NULL; +} + +void LLResizeBar::draw() +{ + if (mShowDragHandle) + { + S32 image_width = mDragHandleImage->getTextureWidth(); + S32 image_height = mDragHandleImage->getTextureHeight(); + const LLRect& panel_rect = getRect(); + S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1; + S32 image_bottom = (panel_rect.getHeight() - image_height) / 2; + mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom)); + } + + LLPanel::draw(); +} diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 8190a95a71..bcf8ea0b40 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -27,15 +27,14 @@ #ifndef LL_RESIZEBAR_H #define LL_RESIZEBAR_H -#include "llview.h" -#include "llcoord.h" +#include "llpanel.h" -class LLResizeBar : public LLView +class LLResizeBar : public LLPanel { public: enum Side { LEFT, TOP, RIGHT, BOTTOM }; - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Mandatory resizing_view; Mandatory side; @@ -44,24 +43,19 @@ public: Optional max_size; Optional snapping_enabled; Optional allow_double_click_snapping; + Optional show_drag_handle; - Params() - : max_size("max_size", S32_MAX), - snapping_enabled("snapping_enabled", true), - resizing_view("resizing_view"), - side("side"), - allow_double_click_snapping("allow_double_click_snapping", true) - { - name = "resize_bar"; - } + Params(); }; protected: LLResizeBar(const LLResizeBar::Params& p); friend class LLUICtrlFactory; + + /*virtual*/ BOOL postBuild(); public: -// virtual void draw(); No appearance + virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -72,20 +66,26 @@ public: void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; } bool canResize() { return getEnabled() && mMaxSize > mMinSize; } void setResizeListener(boost::function listener) {mResizeListener = listener;} + BOOL isShowDragHandle() const { return mShowDragHandle; } + void setImagePanel(LLPanel * panelp); + LLPanel * getImagePanel() const; private: - S32 mDragLastScreenX; - S32 mDragLastScreenY; - S32 mLastMouseScreenX; - S32 mLastMouseScreenY; - LLCoordGL mLastMouseDir; - S32 mMinSize; - S32 mMaxSize; - const Side mSide; - BOOL mSnappingEnabled; - BOOL mAllowDoubleClickSnapping; - LLView* mResizingView; - boost::function mResizeListener; + S32 mDragLastScreenX; + S32 mDragLastScreenY; + S32 mLastMouseScreenX; + S32 mLastMouseScreenY; + LLCoordGL mLastMouseDir; + S32 mMinSize; + S32 mMaxSize; + const Side mSide; + BOOL mSnappingEnabled; + BOOL mAllowDoubleClickSnapping; + BOOL mShowDragHandle; + LLView* mResizingView; + boost::function mResizeListener; + LLPointer mDragHandleImage; + LLPanel * mImagePanel; }; #endif // LL_RESIZEBAR_H diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 8575f6f055..043ffacffb 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -817,15 +817,12 @@ void LLFloaterIMContainer::assignResizeLimits() bool is_conv_pane_expanded = !mConversationsPane->isCollapsed(); bool is_msg_pane_expanded = !mMessagesPane->isCollapsed(); - // With two panels visible number of borders is three, because the borders - // between the panels are merged into one - S32 number_of_visible_borders = llmin((is_conv_pane_expanded? 2 : 0) + (is_msg_pane_expanded? 2 : 0), 3); - S32 summary_width_of_visible_borders = number_of_visible_borders * LLPANEL_BORDER_WIDTH; - S32 conv_pane_target_width = is_conv_pane_expanded? - (is_msg_pane_expanded? - mConversationsPane->getRect().getWidth() - : mConversationsPane->getExpandedMinDim()) - : mConversationsPane->getMinDim(); + S32 summary_width_of_visible_borders = (is_msg_pane_expanded ? mConversationsStack->getPanelSpacing() : 0) + 1; + + S32 conv_pane_target_width = is_conv_pane_expanded + ? ( is_msg_pane_expanded?mConversationsPane->getRect().getWidth():mConversationsPane->getExpandedMinDim() ) + : mConversationsPane->getMinDim(); + S32 msg_pane_min_width = is_msg_pane_expanded ? mMessagesPane->getExpandedMinDim() : 0; S32 new_min_width = conv_pane_target_width + msg_pane_min_width + summary_width_of_visible_borders; diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index ce6e639305..7d96fd0d6c 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -212,7 +212,7 @@ void LLFloaterIMSessionTab::assignResizeLimits() mRightPartPanel->setIgnoreReshape(is_participants_pane_collapsed); S32 participants_pane_target_width = is_participants_pane_collapsed? - 0 : (mParticipantListPanel->getRect().getWidth() + LLPANEL_BORDER_WIDTH); + 0 : (mParticipantListPanel->getRect().getWidth() + mParticipantListAndHistoryStack->getPanelSpacing()); S32 new_min_width = participants_pane_target_width + mRightPartPanel->getExpandedMinDim() + mFloaterExtraWidth; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 0de217fc0d..b0dfd471e0 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -864,4 +864,19 @@ + + + + + + + + + diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 93c9cb02cb..d99c3a8bda 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -776,4 +776,7 @@ with the same filename but different name + + + diff --git a/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png b/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png new file mode 100644 index 0000000000..642eac4065 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png differ diff --git a/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png b/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png new file mode 100644 index 0000000000..b06b70cf36 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png differ diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 65f623a47e..3e8c6c76cc 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -25,23 +25,27 @@ + expanded_min_dim="136">