diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-09-09 04:12:50 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-09-09 04:12:50 +0000 |
commit | 579d8447d3269fc6ed747774f1b612a88d850781 (patch) | |
tree | db741511a681ae711aecb665b5be1eb6fdd4e062 | |
parent | bc022a04605c1e0f3c08dfc75c6f49fc9def02c7 (diff) |
merge merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1581 https://svn.aws.productengine.com/secondlife/pe/stable-2@1585 -> viewer-2.0.0-3
* Bugs: EXT-838 EXT-815 EXT-872
* New Dev: IM Floater Docking
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 25 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.h | 1 | ||||
-rw-r--r-- | indra/newview/llbottomtray.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llchiclet.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 56 | ||||
-rw-r--r-- | indra/newview/llimpanel.cpp | 51 | ||||
-rw-r--r-- | indra/newview/llimpanel.h | 12 | ||||
-rw-r--r-- | indra/newview/llsyswellwindow.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/search_combo_box.xml | 1 |
9 files changed, 101 insertions, 67 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index d0789d6502..5243f67a76 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -53,21 +53,34 @@ BOOL LLDockableFloater::postBuild() void LLDockableFloater::setDocked(bool docked, bool pop_on_undock) { - if (docked) + if (mDockControl.get() != NULL) { - mDockControl.get()->on(); + if (docked) + { + mDockControl.get()->on(); + } + else + { + mDockControl.get()->off(); + } } - else + + if (!docked && pop_on_undock) { - mDockControl.get()->off(); + // visually pop up a little bit to emphasize the undocking + translate(0, UNDOCK_LEAP_HEIGHT); } + LLFloater::setDocked(docked, pop_on_undock); } void LLDockableFloater::draw() { - mDockControl.get()->repositionDockable(); - mDockControl.get()->drawToungue(); + if (mDockControl.get() != NULL) + { + mDockControl.get()->repositionDockable(); + mDockControl.get()->drawToungue(); + } LLFloater::draw(); } diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 5ece78a925..da86889c33 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -43,6 +43,7 @@ */ class LLDockableFloater : public LLFloater { + static const U32 UNDOCK_LEAP_HEIGHT = 12; public: LOG_CLASS(LLDockableFloater); LLDockableFloater(LLDockControl* dockControl, const LLSD& key, const Params& params = getDefaultParams()); diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 861f23abb7..b47787bd5f 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -182,6 +182,14 @@ void LLBottomTray::sessionRemoved(const LLUUID& session_id) { if(getChicletPanel()) { + // IM floater should be closed when session removed and associated chiclet closed + LLIMFloater* iMfloater = LLFloaterReg::findTypedInstance<LLIMFloater>( + "impanel", session_id); + if (iMfloater != NULL) + { + iMfloater->closeFloater(); + } + getChicletPanel()->removeChiclet(session_id); } } diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 197ab9d352..e54b068d47 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -211,18 +211,6 @@ void LLIMChiclet::draw() { LLUICtrl::draw(); - //if we have a docked floater, we want to position it relative to us - LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", getSessionId()); - - if (im_floater && im_floater->isDocked()) - { - S32 x, y; - getParent()->localPointToScreen(getRect().getCenterX(), 0, &x, &y); - im_floater->translate(x - im_floater->getRect().getCenterX(), 10 - im_floater->getRect().mBottom); - //set this so the docked floater knows it's been positioned and can now draw - im_floater->setPositioned(true); - } - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE); } diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index df2bf53a05..ef71e35254 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -218,6 +218,36 @@ private: LLSLURLGetter mUrlGetter; }; +/** + * This class is needed to update an item being copied to the favorites folder + * with a sort field value (required to save favorites bar's tabs order). + * See method handleNewFavoriteDragAndDrop for more details on how this class is used. + */ +class LLItemCopiedCallback : public LLInventoryCallback +{ +public: + LLItemCopiedCallback(S32 sortField): mSortField(sortField) {} + + virtual void fire(const LLUUID& inv_item) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + + if (item) + { + item->setSortField(mSortField); + item->setComplete(TRUE); + item->updateServer(FALSE); + + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + + LLView::getWindow()->setCursor(UI_CURSOR_ARROW); + } + +private: + S32 mSortField; +}; // updateButtons's helper struct LLFavoritesSort @@ -369,7 +399,27 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con mItems.push_back(gInventory.getItem(item->getUUID())); } - saveItemsOrder(mItems); + int sortField = 0; + LLPointer<LLItemCopiedCallback> cb; + + // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field + for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i) + { + LLViewerInventoryItem* currItem = *i; + + if (currItem->getUUID() == item->getUUID()) + { + cb = new LLItemCopiedCallback(++sortField); + } + else + { + currItem->setSortField(++sortField); + currItem->setComplete(TRUE); + currItem->updateServer(FALSE); + + gInventory.updateItem(currItem); + } + } copy_inventory_item( gAgent.getID(), @@ -377,9 +427,7 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con item->getUUID(), favorites_id, std::string(), - LLPointer<LLInventoryCallback>(NULL)); - - getWindow()->setCursor(UI_CURSOR_ARROW); + cb); llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 020eff375b..0efe9b9849 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1989,7 +1989,7 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const LLIMFloater::LLIMFloater(const LLUUID& session_id) - : LLFloater(session_id), + : LLDockableFloater(NULL, session_id), mControlPanel(NULL), mSessionID(session_id), mLastMessageIndex(-1), @@ -2119,9 +2119,7 @@ BOOL LLIMFloater::postBuild() setTitle(LLIMModel::instance().getName(mSessionID)); setDocked(true); - mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); - - return TRUE; + return LLDockableFloater::postBuild(); } @@ -2145,8 +2143,6 @@ void* LLIMFloater::createPanelGroupControl(void* userdata) return self->mControlPanel; } - -const U32 UNDOCK_LEAP_HEIGHT = 12; const U32 DOCK_ICON_HEIGHT = 6; //virtual @@ -2164,20 +2160,6 @@ void LLIMFloater::onFocusLost() } } - - -//virtual -void LLIMFloater::setDocked(bool docked, bool pop_on_undock) -{ - LLFloater::setDocked(docked); - - if (!docked && pop_on_undock) - { - // visually pop up a little bit to emphasize the undocking - translate(0, UNDOCK_LEAP_HEIGHT); - } -} - void LLIMFloater::onSlide() { LLPanel* im_control_panel = getChild<LLPanel>("panel_im_control_panel"); @@ -2206,6 +2188,20 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->updateMessages(); floater->mInputEditor->setFocus(TRUE); + + if (floater->getDockControl() == NULL) + { + LLView* chiclet = + LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLView>( + session_id); + if (chiclet == NULL) + { + llerror("Dock chiclet for LLIMFloater doesn't exists", 0); + } + floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), + LLDockControl::TOP, floater->isDocked())); + } + return floater; } @@ -2305,18 +2301,3 @@ void LLIMFloater::setTyping(BOOL typing) { } - -void LLIMFloater::draw() -{ - //if we are docked, make sure we've been positioned by the chiclet - if (!isDocked() || mPositioned) - { - LLFloater::draw(); - - if (isDocked()) - { - mDockTongue->draw( (getRect().getWidth()/2) - mDockTongue->getWidth()/2, -mDockTongue->getHeight()); - } - } -} - diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 284a486b0f..1d69f1567c 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -33,7 +33,7 @@ #ifndef LL_IMPANEL_H #define LL_IMPANEL_H -#include "llfloater.h" +#include "lldockablefloater.h" #include "lllogchat.h" #include "lluuid.h" #include "lldarray.h" @@ -363,7 +363,7 @@ private: // Individual IM window that appears at the bottom of the screen, // optionally "docked" to the bottom tray. -class LLIMFloater : public LLFloater +class LLIMFloater : public LLDockableFloater { public: LLIMFloater(const LLUUID& session_id); @@ -372,18 +372,11 @@ public: // LLView overrides /*virtual*/ BOOL postBuild(); - - // LLView overrides for drawing dock tongue - /*virtual*/ - void draw(); // Floater should close when user clicks away to other UI area, // hence causing focus loss. /*virtual*/ void onFocusLost(); - // LLFloater overrides - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); - // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -426,7 +419,6 @@ private: LLViewerTextEditor* mHistoryEditor; LLLineEditor* mInputEditor; bool mPositioned; - LLUIImagePtr mDockTongue; }; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 7ddbf0a744..2ff0c6833c 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -154,6 +154,8 @@ void LLSysWellWindow::toggleWindow() getDockTongue(), LLDockControl::TOP, isDocked())); } setVisible(!getVisible()); + //set window in foreground + setFocus(getVisible()); } //--------------------------------------------------------------------------------- diff --git a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml index 1d43b25f1d..a03d90876a 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml @@ -4,6 +4,7 @@ list_position="BELOW" show_text_as_tentative="false" dropdown_button_visible="false" + max_chars="256" background_image="TextField_Search_Off" background_image_disabled="TextField_Search_Disabled" background_image_focused="TextField_Search_Active"> |