diff options
author | Richard Linden <none@none> | 2010-02-17 22:21:58 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2010-02-17 22:21:58 -0800 |
commit | f6079c93820f354401e5431a9fcfd006859f9e21 (patch) | |
tree | f871438f4774a01192b47924f319d1f078f71bdd /indra/newview/llpanelnearbymedia.cpp | |
parent | effadd3908c53f17ced08131546196e3dea9d1d5 (diff) |
EXT-5515 - Allow resizing on left and lower left of nearby media popup
Diffstat (limited to 'indra/newview/llpanelnearbymedia.cpp')
-rw-r--r-- | indra/newview/llpanelnearbymedia.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index d38dd0f870..8ad5389566 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -38,6 +38,7 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" #include "llresizebar.h" +#include "llresizehandle.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llscrolllistcell.h" @@ -116,6 +117,20 @@ BOOL LLPanelNearByMedia::postBuild() p.resizing_view = this; addChild( LLUICtrlFactory::create<LLResizeBar>(p) ); + p.rect = LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0); + p.name = "resizebar_left"; + p.min_size = getRect().getWidth(); + p.side = LLResizeBar::LEFT; + addChild( LLUICtrlFactory::create<LLResizeBar>(p) ); + + LLResizeHandle::Params resize_handle_p; + resize_handle_p.rect = LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ); + resize_handle_p.mouse_opaque(false); + resize_handle_p.min_width(getRect().getWidth()); + resize_handle_p.min_height(getRect().getHeight()); + resize_handle_p.corner(LLResizeHandle::LEFT_BOTTOM); + addChild(LLUICtrlFactory::create<LLResizeHandle>(resize_handle_p)); + mNearbyMediaPanel = getChild<LLUICtrl>("nearby_media_panel"); mMediaList = getChild<LLScrollListCtrl>("media_list"); mEnableAllCtrl = getChild<LLUICtrl>("all_nearby_media_enable_btn"); @@ -148,8 +163,10 @@ BOOL LLPanelNearByMedia::postBuild() updateColumns(); LLView* minimized_controls = getChildView("minimized_controls"); - mMoreHeight = getRect().getHeight(); - mLessHeight = getRect().getHeight() - minimized_controls->getRect().mBottom; + mMoreRect = getRect(); + mLessRect = getRect(); + mLessRect.mBottom = minimized_controls->getRect().mBottom; + getChild<LLUICtrl>("more_less_btn")->setValue(false); onMoreLess(); @@ -207,7 +224,7 @@ void LLPanelNearByMedia::reshape(S32 width, S32 height, BOOL called_from_parent) LLButton* more_less_btn = getChild<LLButton>("more_less_btn"); if (more_less_btn->getValue().asBoolean()) { - mMoreHeight = getRect().getHeight(); + mMoreRect = getRect(); } } @@ -928,10 +945,8 @@ void LLPanelNearByMedia::onMoreLess() // enable resizing when expanded getChildView("resizebar_bottom")->setEnabled(is_more); - S32 new_height = is_more ? mMoreHeight : mLessHeight; - - LLRect new_rect = getRect(); - new_rect.mBottom = new_rect.mTop - new_height; + LLRect new_rect = is_more ? mMoreRect : mLessRect; + new_rect.translate(getRect().mRight - new_rect.mRight, getRect().mTop - new_rect.mTop); setShape(new_rect); } |