summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-18 22:09:08 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-18 22:09:08 +0000
commit4a9b231dcc342bfd9cf570ff70d25909cda251cd (patch)
tree5d54b90d9fa5d2ba58b92a74f9e4a9cd1d16868f
parent1c67e8f386d69e06c1ff820eb551b3c69592ff89 (diff)
parent4ab945c9f0000ead1eca22eefe0829bf3c15d7da (diff)
viewer2 merge.
-rw-r--r--indra/llui/llmenugl.cpp40
-rw-r--r--indra/llui/llmenugl.h10
-rw-r--r--indra/llui/llresizehandle.cpp5
-rw-r--r--indra/newview/llpanelnearbymedia.cpp29
-rw-r--r--indra/newview/llpanelnearbymedia.h10
-rw-r--r--indra/newview/skins/default/xui/en/panel_nearby_media.xml12
-rw-r--r--indra/newview/skins/default/xui/en/panel_volume_pulldown.xml13
7 files changed, 73 insertions, 46 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index d18abbfb2f..0d56c5ed31 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -657,11 +657,38 @@ LLMenuItemVerticalSeparatorGL::LLMenuItemVerticalSeparatorGL( void )
// Class LLMenuItemTearOffGL
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LLMenuItemTearOffGL::LLMenuItemTearOffGL(const LLMenuItemTearOffGL::Params& p)
-: LLMenuItemGL(p),
- mParentHandle(p.parent_floater_handle)
+: LLMenuItemGL(p)
{
}
+// Returns the first floater ancestor if there is one
+LLFloater* LLMenuItemTearOffGL::getParentFloater()
+{
+ LLView* parent_view = getMenu();
+
+ while (parent_view)
+ {
+ if (dynamic_cast<LLFloater*>(parent_view))
+ {
+ return dynamic_cast<LLFloater*>(parent_view);
+ }
+
+ bool parent_is_menu = dynamic_cast<LLMenuGL*>(parent_view) && !dynamic_cast<LLMenuBarGL*>(parent_view);
+
+ if (parent_is_menu)
+ {
+ // use menu parent
+ parent_view = dynamic_cast<LLMenuGL*>(parent_view)->getParentMenuItem();
+ }
+ else
+ {
+ // just use regular view parent
+ parent_view = parent_view->getParent();
+ }
+ }
+
+ return NULL;
+}
void LLMenuItemTearOffGL::onCommit()
{
@@ -680,7 +707,7 @@ void LLMenuItemTearOffGL::onCommit()
getMenu()->needsArrange();
- LLFloater* parent_floater = mParentHandle.get();
+ LLFloater* parent_floater = getParentFloater();
LLFloater* tear_off_menu = LLTearOffMenu::create(getMenu());
if (tear_off_menu)
@@ -1671,7 +1698,6 @@ LLMenuGL::LLMenuGL(const LLMenuGL::Params& p)
mSpilloverMenu(NULL),
mJumpKey(p.jump_key),
mCreateJumpKeys(p.create_jump_keys),
- mParentFloaterHandle(p.parent_floater),
mNeedsArrange(FALSE),
mShortcutPad(p.shortcut_pad)
{
@@ -1699,7 +1725,7 @@ LLMenuGL::LLMenuGL(const LLMenuGL::Params& p)
void LLMenuGL::initFromParams(const LLMenuGL::Params& p)
{
LLUICtrl::initFromParams(p);
- setCanTearOff(p.can_tear_off, p.parent_floater);
+ setCanTearOff(p.can_tear_off);
}
// Destroys the object
@@ -1711,12 +1737,11 @@ LLMenuGL::~LLMenuGL( void )
mJumpKeys.clear();
}
-void LLMenuGL::setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_handle )
+void LLMenuGL::setCanTearOff(BOOL tear_off)
{
if (tear_off && mTearOffItem == NULL)
{
LLMenuItemTearOffGL::Params p;
- p.parent_floater_handle = parent_floater_handle;
mTearOffItem = LLUICtrlFactory::create<LLMenuItemTearOffGL>(p);
addChildInBack(mTearOffItem);
}
@@ -2233,7 +2258,6 @@ void LLMenuGL::createSpilloverBranch()
LLMenuGL::Params p;
p.name("More");
p.label("More"); // *TODO: Translate
- p.parent_floater(mParentFloaterHandle);
p.bg_color(mBackgroundColor);
p.bg_visible(true);
p.can_tear_off(false);
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 8441aaadd4..39d1986461 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -355,7 +355,6 @@ class LLMenuGL
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
- Optional<LLHandle<LLFloater> > parent_floater;
Optional<KEY> jump_key;
Optional<bool> horizontal_layout,
can_tear_off,
@@ -430,7 +429,7 @@ public:
void setBackgroundColor( const LLUIColor& color ) { mBackgroundColor = color; }
const LLUIColor& getBackgroundColor() const { return mBackgroundColor; }
void setBackgroundVisible( BOOL b ) { mBgVisible = b; }
- void setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>());
+ void setCanTearOff(BOOL tear_off);
// add a separator to this menu
virtual BOOL addSeparator();
@@ -553,7 +552,6 @@ private:
class LLMenuItemTearOffGL* mTearOffItem;
class LLMenuItemBranchGL* mSpilloverBranch;
LLMenuGL* mSpilloverMenu;
- LLHandle<LLFloater> mParentFloaterHandle;
KEY mJumpKey;
BOOL mCreateJumpKeys;
S32 mShortcutPad;
@@ -814,7 +812,6 @@ class LLMenuItemTearOffGL : public LLMenuItemGL
public:
struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
{
- Optional<LLHandle<LLFloater> > parent_floater_handle;
Params()
{
name = "tear off";
@@ -823,13 +820,12 @@ public:
};
LLMenuItemTearOffGL( const Params& );
-
+
virtual void onCommit(void);
virtual void draw(void);
virtual U32 getNominalHeight() const;
-private:
- LLHandle<LLFloater> mParentHandle;
+ LLFloater* getParentFloater();
};
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;
};
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
index acfd63db37..0f911f789e 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_media.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
@@ -2,7 +2,9 @@
<panel
can_resize="true"
can_close="false"
- background_opaque="true"
+ bg_opaque_image="Volume_Background"
+ bg_alpha_image="Volume_Background"
+ background_opaque="true"
background_visible="true"
layout="topleft"
width="270"
@@ -16,9 +18,7 @@
<string name="playing_suffix">(playing)</string>
<panel
bevel_style="in"
- bg_alpha_color="0 0 0 0"
- bg_opaque_color="0 0 0 0.3"
- bg_opaque_image="Toast_Background"
+ background_visible="false"
follows="left|right|top"
top="0"
height="30"
@@ -188,9 +188,7 @@
</scroll_list>
<panel
bevel_style="in"
- background_visible="true"
- bg_alpha_color="0.0 0.0 0.0 1.0"
- bg_opaque_color="0 0 0 0.3"
+ background_visible="false"
follows="left|right|bottom"
top_pad="5"
height="30"
diff --git a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml
index 55ab95bfe9..cd66c56ca1 100644
--- a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml
+++ b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
background_opaque="true"
- background_visible="false"
+ background_visible="true"
+ bg_opaque_image="Volume_Background"
+ bg_alpha_image="Volume_Background"
border_visible="false"
border="false"
chrome="true"
@@ -10,15 +12,6 @@
layout="topleft"
name="volumepulldown_floater"
width="32">
- <!-- floater background image -->
- <icon
- height="150"
- image_name="Volume_Background"
- layout="topleft"
- left="0"
- name="normal_background"
- top="0"
- width="32" />
<slider
control_name="AudioLevelMaster"
follows="left|top"