summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llresizehandle.cpp5
-rw-r--r--indra/newview/llpanelnearbymedia.cpp29
-rw-r--r--indra/newview/llpanelnearbymedia.h10
3 files changed, 30 insertions, 14 deletions
diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp
index 3df09d124a..367666efbd 100644
--- a/indra/llui/llresizehandle.cpp
+++ b/indra/llui/llresizehandle.cpp
@@ -136,9 +136,10 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
if( resizing_view )
{
// undock floater when user resize it
- if (((LLFloater*)getParent())->isDocked())
+ LLFloater* floater_parent = dynamic_cast<LLFloater*>(getParent());
+ if (floater_parent && floater_parent->isDocked())
{
- ((LLFloater*)getParent())->setDocked(false, false);
+ floater_parent->setDocked(false, false);
}
// Resize the parent
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);
}
diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h
index eedfd447de..6fe724266b 100644
--- a/indra/newview/llpanelnearbymedia.h
+++ b/indra/newview/llpanelnearbymedia.h
@@ -174,11 +174,11 @@ private:
std::string mParcelMediaName;
std::string mParcelAudioName;
- S32 mMoreHeight;
- S32 mLessHeight;
- LLFrameTimer mHoverTimer;
- LLScrollListItem* mParcelMediaItem;
- LLScrollListItem* mParcelAudioItem;
+ LLRect mMoreRect;
+ LLRect mLessRect;
+ LLFrameTimer mHoverTimer;
+ LLScrollListItem* mParcelMediaItem;
+ LLScrollListItem* mParcelAudioItem;
};