summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-03-16 13:43:42 -0700
committerMerov Linden <merov@lindenlab.com>2012-03-16 13:43:42 -0700
commit356c29c888e6220915a0f050c393c7e91d922318 (patch)
treebfc9061cf3e66d232a9b7bc5a940afce02e6d7c1 /indra/newview
parentf4722686d4bd125ebbecac5da511390252a7084e (diff)
parent34c599858bd64b7fbda767ff9c9f7d8bcd2c2c25 (diff)
EXP-1841 : pull from current viewer-experience.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterwebcontent.cpp4
-rw-r--r--indra/newview/llfolderview.cpp31
-rw-r--r--indra/newview/llfolderview.h24
-rw-r--r--indra/newview/llinventorybridge.cpp6
-rw-r--r--indra/newview/llinventoryclipboard.cpp110
-rw-r--r--indra/newview/llinventoryclipboard.h86
-rw-r--r--indra/newview/llinventorypanel.cpp3
-rw-r--r--indra/newview/llpanelobjectinventory.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml5
-rw-r--r--indra/newview/skins/default/xui/en/panel_chat_item.xml1
10 files changed, 266 insertions, 6 deletions
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 3b5c3663fb..3fe2518de6 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -169,7 +169,7 @@ void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y,
void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
{
// Make sure the layout of the browser control is updated, so this calculation is correct.
- LLLayoutStack::updateClass();
+ getChild<LLLayoutStack>("stack1")->updateLayout();
// TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc.
LLCoordWindow window_size;
@@ -258,7 +258,7 @@ void LLFloaterWebContent::open_media(const Params& p)
if (!p.preferred_media_size().isEmpty())
{
- LLLayoutStack::updateClass();
+ getChild<LLLayoutStack>("stack1")->updateLayout();
LLRect browser_rect = mWebBrowser->calcScreenRect();
LLCoordWindow window_size;
getWindow()->getSize(&window_size);
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 3103267b35..068a6407f7 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -165,6 +165,33 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item)
{ }
///----------------------------------------------------------------------------
+/// Class LLFolderViewScrollContainer
+///----------------------------------------------------------------------------
+
+// virtual
+const LLRect LLFolderViewScrollContainer::getScrolledViewRect() const
+{
+ LLRect rect = LLRect::null;
+ if (mScrolledView)
+ {
+ LLFolderView* folder_view = dynamic_cast<LLFolderView*>(mScrolledView);
+ if (folder_view)
+ {
+ S32 height = folder_view->mRunningHeight;
+
+ rect = mScrolledView->getRect();
+ rect.setLeftTopAndSize(rect.mLeft, rect.mTop, rect.getWidth(), height);
+ }
+ }
+
+ return rect;
+}
+
+LLFolderViewScrollContainer::LLFolderViewScrollContainer(const LLScrollContainer::Params& p)
+: LLScrollContainer(p)
+{}
+
+///----------------------------------------------------------------------------
/// Class LLFolderView
///----------------------------------------------------------------------------
LLFolderView::Params::Params()
@@ -535,6 +562,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
{
width = scroll_rect.getWidth();
}
+
LLView::reshape(width, height, called_from_parent);
mReshapeSignal(mSelectedItems, FALSE);
}
@@ -943,6 +971,9 @@ void LLFolderView::draw()
// We should call this method to also notify parent about required rect.
// See EXT-7564, EXT-7047.
arrangeFromRoot();
+ LLUI::popMatrix();
+ LLUI::pushMatrix();
+ LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
}
}
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 5705846c0e..da8bb15f8e 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -44,6 +44,7 @@
#include "lldepthstack.h"
#include "lleditmenuhandler.h"
#include "llfontgl.h"
+#include "llscrollcontainer.h"
#include "lltooldraganddrop.h"
#include "llviewertexture.h"
@@ -54,10 +55,28 @@ class LLInventoryModel;
class LLPanel;
class LLLineEditor;
class LLMenuGL;
-class LLScrollContainer;
class LLUICtrl;
class LLTextBox;
+/**
+ * Class LLFolderViewScrollContainer
+ *
+ * A scroll container which provides the information about the height
+ * of currently displayed folder view contents.
+ * Used for updating vertical scroll bar visibility in inventory panel.
+ * See LLScrollContainer::calcVisibleSize().
+ */
+class LLFolderViewScrollContainer : public LLScrollContainer
+{
+public:
+ /*virtual*/ ~LLFolderViewScrollContainer() {};
+ /*virtual*/ const LLRect getScrolledViewRect() const;
+
+protected:
+ LLFolderViewScrollContainer(const LLScrollContainer::Params& p);
+ friend class LLUICtrlFactory;
+};
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFolderView
//
@@ -81,6 +100,9 @@ public:
Params();
};
+
+ friend class LLFolderViewScrollContainer;
+
LLFolderView(const Params&);
virtual ~LLFolderView( void );
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 03f6a31c6d..9b8c311d16 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -446,7 +446,11 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
for(; it != end; ++it)
{
gInventory.moveObject((*it), trash_id);
- model->updateItem(gInventory.getItem(*it));
+ LLViewerInventoryItem* item = gInventory.getItem(*it);
+ if (item)
+ {
+ model->updateItem(item);
+ }
}
// notify inventory observers.
diff --git a/indra/newview/llinventoryclipboard.cpp b/indra/newview/llinventoryclipboard.cpp
new file mode 100644
index 0000000000..53da34f448
--- /dev/null
+++ b/indra/newview/llinventoryclipboard.cpp
@@ -0,0 +1,110 @@
+/**
+ * @file llinventoryclipboard.cpp
+ * @brief LLInventoryClipboard class implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llinventoryclipboard.h"
+
+
+LLInventoryClipboard LLInventoryClipboard::sInstance;
+
+///----------------------------------------------------------------------------
+/// Local function declarations, constants, enums, and typedefs
+///----------------------------------------------------------------------------
+
+
+///----------------------------------------------------------------------------
+/// Class LLInventoryClipboard
+///----------------------------------------------------------------------------
+
+LLInventoryClipboard::LLInventoryClipboard()
+: mCutMode(false)
+{
+}
+
+LLInventoryClipboard::~LLInventoryClipboard()
+{
+ reset();
+}
+
+void LLInventoryClipboard::add(const LLUUID& object)
+{
+ mObjects.put(object);
+}
+
+// this stores a single inventory object
+void LLInventoryClipboard::store(const LLUUID& object)
+{
+ reset();
+ mObjects.put(object);
+}
+
+void LLInventoryClipboard::store(const LLDynamicArray<LLUUID>& inv_objects)
+{
+ reset();
+ S32 count = inv_objects.count();
+ for(S32 i = 0; i < count; i++)
+ {
+ mObjects.put(inv_objects[i]);
+ }
+}
+
+void LLInventoryClipboard::cut(const LLUUID& object)
+{
+ if(!mCutMode && !mObjects.empty())
+ {
+ //looks like there are some stored items, reset clipboard state
+ reset();
+ }
+ mCutMode = true;
+ add(object);
+}
+void LLInventoryClipboard::retrieve(LLDynamicArray<LLUUID>& inv_objects) const
+{
+ inv_objects.reset();
+ S32 count = mObjects.count();
+ for(S32 i = 0; i < count; i++)
+ {
+ inv_objects.put(mObjects[i]);
+ }
+}
+
+void LLInventoryClipboard::reset()
+{
+ mObjects.reset();
+ mCutMode = false;
+}
+
+// returns true if the clipboard has something pasteable in it.
+BOOL LLInventoryClipboard::hasContents() const
+{
+ return (mObjects.count() > 0);
+}
+
+
+///----------------------------------------------------------------------------
+/// Local function definitions
+///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventoryclipboard.h b/indra/newview/llinventoryclipboard.h
new file mode 100644
index 0000000000..b9f1451e5c
--- /dev/null
+++ b/indra/newview/llinventoryclipboard.h
@@ -0,0 +1,86 @@
+/**
+ * @file llinventoryclipboard.h
+ * @brief LLInventoryClipboard class header file
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLINVENTORYCLIPBOARD_H
+#define LL_LLINVENTORYCLIPBOARD_H
+
+#include "lldarray.h"
+#include "lluuid.h"
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLInventoryClipboard
+//
+// This class is used to cut/copy/paste inventory items around the
+// world. This class is accessed through a singleton (only one
+// inventory clipboard for now) which can be referenced using the
+// instance() method.
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+class LLInventoryClipboard
+{
+public:
+ // calling this before main() is undefined
+ static LLInventoryClipboard& instance() { return sInstance; }
+
+ // this method adds to the current list.
+ void add(const LLUUID& object);
+
+ // this stores a single inventory object
+ void store(const LLUUID& object);
+
+ // this method stores an array of objects
+ void store(const LLDynamicArray<LLUUID>& inventory_objects);
+
+ void cut(const LLUUID& object);
+ // this method gets the objects in the clipboard by copying them
+ // into the array provided.
+ void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const;
+
+ // this method empties out the clipboard
+ void reset();
+
+ // returns true if the clipboard has something pasteable in it.
+ BOOL hasContents() const;
+ bool isCutMode() const { return mCutMode; }
+
+protected:
+ static LLInventoryClipboard sInstance;
+
+ LLDynamicArray<LLUUID> mObjects;
+ bool mCutMode;
+
+public:
+ // please don't actually call these
+ LLInventoryClipboard();
+ ~LLInventoryClipboard();
+private:
+ // please don't implement these
+ LLInventoryClipboard(const LLInventoryClipboard&);
+ LLInventoryClipboard& operator=(const LLInventoryClipboard&);
+};
+
+
+#endif // LL_LLINVENTORYCLIPBOARD_H
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index b417689858..71dd963f28 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -207,10 +207,11 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
LLScrollContainer::Params scroller_params(params.scroll());
scroller_params.rect(scroller_view_rect);
- mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroller_params);
+ mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
addChild(mScroller);
mScroller->addChild(mFolderRoot);
mFolderRoot->setScrollContainer(mScroller);
+ mFolderRoot->setFollowsAll();
mFolderRoot->addChild(mFolderRoot->mStatusTextBox);
}
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index eb0a257def..1ca24f3031 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1569,7 +1569,7 @@ void LLPanelObjectInventory::reset()
scroll_p.rect(scroller_rect);
scroll_p.tab_stop(true);
scroll_p.follows.flags(FOLLOWS_ALL);
- mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroll_p);
+ mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroll_p);
addChild(mScroller);
mScroller->addChild(mFolders);
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 6443e432fe..9ff2e233af 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3295,6 +3295,7 @@
name="Set Logging Level"
tear_off="true">
<menu_item_check
+ name="Debug"
label="Debug">
<menu_item_check.on_check
function="Develop.CheckLoggingLevel"
@@ -3304,6 +3305,7 @@
parameter="0" />
</menu_item_check>
<menu_item_check
+ name="Info"
label="Info">
<menu_item_check.on_check
function="Develop.CheckLoggingLevel"
@@ -3313,6 +3315,7 @@
parameter="1" />
</menu_item_check>
<menu_item_check
+ name="Warning"
label="Warning">
<menu_item_check.on_check
function="Develop.CheckLoggingLevel"
@@ -3322,6 +3325,7 @@
parameter="2" />
</menu_item_check>
<menu_item_check
+ name="Error"
label="Error">
<menu_item_check.on_check
function="Develop.CheckLoggingLevel"
@@ -3331,6 +3335,7 @@
parameter="3" />
</menu_item_check>
<menu_item_check
+ name="None"
label="None">
<menu_item_check.on_check
function="Develop.CheckLoggingLevel"
diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml
index 1b97de2b05..1ef99649e6 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml
@@ -18,6 +18,7 @@
<text_chat
top="3"
left="30"
+ right="-10"
height="120"
text_color="white"
word_wrap="true"