diff options
-rw-r--r-- | indra/newview/llbottomtray.cpp | 207 | ||||
-rw-r--r-- | indra/newview/llbottomtray.h | 137 | ||||
-rw-r--r-- | indra/newview/llcofwearables.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llcofwearables.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelgroupgeneral.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 49 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 48 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Generic_Group_Large.png | bin | 0 -> 7905 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml | 73 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_general.xml | 1 |
12 files changed, 408 insertions, 147 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 774248ce4d..226d5593c9 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -473,16 +473,11 @@ BOOL LLBottomTray::postBuild() // Registering Chat Bar to receive Voice client status change notifications. LLVoiceClient::getInstance()->addObserver(this); - mObjectDefaultWidthMap[RS_BUTTON_GESTURES] = mGesturePanel->getRect().getWidth(); - mObjectDefaultWidthMap[RS_BUTTON_MOVEMENT] = mMovementPanel->getRect().getWidth(); - mObjectDefaultWidthMap[RS_BUTTON_CAMERA] = mCamPanel->getRect().getWidth(); - mObjectDefaultWidthMap[RS_BUTTON_SPEAK] = mSpeakPanel->getRect().getWidth(); - mNearbyChatBar->getChatBox()->setContextMenu(NULL); mChicletPanel = getChild<LLChicletPanel>("chiclet_list"); - initStateProcessedObjectMap(); + initResizeStateContainers(); // update wells visibility: showWellButton(RS_IM_WELL, !LLIMWellWindow::getInstance()->isWindowEmpty()); @@ -711,27 +706,9 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) S32 buttons_freed_width = 0; if (still_should_be_processed) { - processShrinkButtons(&delta_width, &buttons_freed_width); - - if (delta_width < 0) - { - processHideButton(RS_BUTTON_SNAPSHOT, &delta_width, &buttons_freed_width); - } - - if (delta_width < 0) - { - processHideButton(RS_BUTTON_CAMERA, &delta_width, &buttons_freed_width); - } - - if (delta_width < 0) - { - processHideButton(RS_BUTTON_MOVEMENT, &delta_width, &buttons_freed_width); - } + processShrinkButtons(delta_width, buttons_freed_width); - if (delta_width < 0) - { - processHideButton(RS_BUTTON_GESTURES, &delta_width, &buttons_freed_width); - } + processHideButtons(delta_width, buttons_freed_width); if (delta_width < 0) { @@ -776,27 +753,10 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) << llendl; S32 available_width = total_available_width; - if (available_width > 0) - { - processShowButton(RS_BUTTON_GESTURES, &available_width); - } - if (available_width > 0) - { - processShowButton(RS_BUTTON_MOVEMENT, &available_width); - } + processShowButtons(available_width); - if (available_width > 0) - { - processShowButton(RS_BUTTON_CAMERA, &available_width); - } - - if (available_width > 0) - { - processShowButton(RS_BUTTON_SNAPSHOT, &available_width); - } - - processExtendButtons(&available_width); + processExtendButtons(available_width); // if we have to show/extend some buttons but resized delta width is not enough... S32 processed_width = total_available_width - available_width; @@ -853,7 +813,23 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) } } -bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* available_width) +void LLBottomTray::processShowButtons(S32& available_width) +{ + // process buttons from left to right + resize_state_vec_t::const_iterator it = mButtonsProcessOrder.begin(); + const resize_state_vec_t::const_iterator it_end = mButtonsProcessOrder.end(); + + for (; it != it_end; ++it) + { + // is there available space? + if (available_width <= 0) break; + + // try to show next button + processShowButton(*it, available_width); + } +} + +bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32& available_width) { lldebugs << "Trying to show object type: " << shown_object_type << llendl; llassert(mStateProcessedObjectMap[shown_object_type] != NULL); @@ -869,15 +845,15 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa { //validate if we have enough room to show this button const S32 required_width = panel->getRect().getWidth(); - can_be_shown = *available_width >= required_width; + can_be_shown = available_width >= required_width; if (can_be_shown) { - *available_width -= required_width; + available_width -= required_width; setTrayButtonVisible(shown_object_type, true); lldebugs << "processed object type: " << shown_object_type - << ", rest available width: " << *available_width + << ", rest available width: " << available_width << llendl; mResizeState &= ~shown_object_type; } @@ -885,7 +861,23 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa return can_be_shown; } -void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width) +void LLBottomTray::processHideButtons(S32& required_width, S32& buttons_freed_width) +{ + // process buttons from right to left + resize_state_vec_t::const_reverse_iterator it = mButtonsProcessOrder.rbegin(); + const resize_state_vec_t::const_reverse_iterator it_end = mButtonsProcessOrder.rend(); + + for (; it != it_end; ++it) + { + // is it still necessary to hide a button? + if (required_width >= 0) break; + + // try to hide next button + processHideButton(*it, required_width, buttons_freed_width); + } +} + +void LLBottomTray::processHideButton(EResizeState processed_object_type, S32& required_width, S32& buttons_freed_width) { lldebugs << "Trying to hide object type: " << processed_object_type << llendl; llassert(mStateProcessedObjectMap[processed_object_type] != NULL); @@ -899,11 +891,11 @@ void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* re if (panel->getVisible()) { - *required_width += panel->getRect().getWidth(); + required_width += panel->getRect().getWidth(); - if (*required_width > 0) + if (required_width > 0) { - *buttons_freed_width += *required_width; + buttons_freed_width += required_width; } setTrayButtonVisible(processed_object_type, false); @@ -911,24 +903,29 @@ void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* re mResizeState |= processed_object_type; lldebugs << "processing object type: " << processed_object_type - << ", buttons_freed_width: " << *buttons_freed_width + << ", buttons_freed_width: " << buttons_freed_width << llendl; } } -void LLBottomTray::processShrinkButtons(S32* required_width, S32* buttons_freed_width) +void LLBottomTray::processShrinkButtons(S32& required_width, S32& buttons_freed_width) { - processShrinkButton(RS_BUTTON_CAMERA, required_width); + // process buttons from right to left + resize_state_vec_t::const_reverse_iterator it = mButtonsProcessOrder.rbegin(); + const resize_state_vec_t::const_reverse_iterator it_end = mButtonsProcessOrder.rend(); - if (*required_width < 0) + // iterate through buttons in the mButtonsProcessOrder first + for (; it != it_end; ++it) { - processShrinkButton(RS_BUTTON_MOVEMENT, required_width); - } - if (*required_width < 0) - { - processShrinkButton(RS_BUTTON_GESTURES, required_width); + // is it still necessary to hide a button? + if (required_width >= 0) break; + + // try to shrink next button + processShrinkButton(*it, required_width); } - if (*required_width < 0) + + // then shrink Speak button + if (required_width < 0) { S32 panel_min_width = 0; @@ -948,23 +945,23 @@ void LLBottomTray::processShrinkButtons(S32* required_width, S32* buttons_freed_ mSpeakBtn->setLabelVisible(false); mSpeakPanel->reshape(panel_width - possible_shrink_width, mSpeakPanel->getRect().getHeight()); - *required_width += possible_shrink_width; + required_width += possible_shrink_width; - if (*required_width > 0) + if (required_width > 0) { - *buttons_freed_width += *required_width; + buttons_freed_width += required_width; } - lldebugs << "Shrunk panel: " << panel_name + lldebugs << "Shrunk Speak button panel: " << panel_name << ", shrunk width: " << possible_shrink_width - << ", rest width to process: " << *required_width + << ", rest width to process: " << required_width << llendl; } } } } -void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32* required_width) +void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32& required_width) { llassert(mStateProcessedObjectMap[processed_object_type] != NULL); LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; @@ -992,63 +989,68 @@ void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32* // let calculate real width to shrink // 1. apply all possible width - *required_width += possible_shrink_width; + required_width += possible_shrink_width; // 2. it it is too much... - if (*required_width > 0) + if (required_width > 0) { // reduce applied shrunk width to the excessive value. - possible_shrink_width -= *required_width; - *required_width = 0; + possible_shrink_width -= required_width; + required_width = 0; } panel->reshape(panel_width - possible_shrink_width, panel->getRect().getHeight()); lldebugs << "Shrunk panel: " << panel_name << ", shrunk width: " << possible_shrink_width - << ", rest width to process: " << *required_width + << ", rest width to process: " << required_width << llendl; } } } -void LLBottomTray::processExtendButtons(S32* available_width) +void LLBottomTray::processExtendButtons(S32& available_width) { - // do not allow extending any buttons if we have some buttons hidden + // do not allow extending any buttons if we have some buttons hidden via resize if (mResizeState & RS_BUTTONS_CAN_BE_HIDDEN) return; - processExtendButton(RS_BUTTON_GESTURES, available_width); + // process buttons from left to right + resize_state_vec_t::const_iterator it = mButtonsProcessOrder.begin(); + const resize_state_vec_t::const_iterator it_end = mButtonsProcessOrder.end(); - if (*available_width > 0) + // iterate through buttons in the mButtonsProcessOrder first + for (; it != it_end; ++it) { - processExtendButton(RS_BUTTON_MOVEMENT, available_width); - } - if (*available_width > 0) - { - processExtendButton(RS_BUTTON_CAMERA, available_width); + // is there available space? + if (available_width <= 0) break; + + // try to extend next button + processExtendButton(*it, available_width); } - if (*available_width > 0) + + // then try to extend Speak button + if (available_width > 0) { S32 panel_max_width = mObjectDefaultWidthMap[RS_BUTTON_SPEAK]; S32 panel_width = mSpeakPanel->getRect().getWidth(); S32 possible_extend_width = panel_max_width - panel_width; - if (possible_extend_width >= 0 && possible_extend_width <= *available_width) // HACK: this button doesn't change size so possible_extend_width will be 0 + if (possible_extend_width >= 0 && possible_extend_width <= available_width) // HACK: this button doesn't change size so possible_extend_width will be 0 { mSpeakBtn->setLabelVisible(true); mSpeakPanel->reshape(panel_max_width, mSpeakPanel->getRect().getHeight()); log(mSpeakBtn, "speak button is extended"); - *available_width -= possible_extend_width; + available_width -= possible_extend_width; - lldebugs << "Extending panel: " << mSpeakPanel->getName() + lldebugs << "Extending Speak button panel: " << mSpeakPanel->getName() << ", extended width: " << possible_extend_width - << ", rest width to process: " << *available_width + << ", rest width to process: " << available_width << llendl; } } } -void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32* available_width) +void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32& available_width) { llassert(mStateProcessedObjectMap[processed_object_type] != NULL); LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; @@ -1069,20 +1071,20 @@ void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32* // let calculate real width to extend // 1. apply all possible width - *available_width -= possible_extend_width; + available_width -= possible_extend_width; // 2. it it is too much... - if (*available_width < 0) + if (available_width < 0) { // reduce applied extended width to the excessive value. - possible_extend_width += *available_width; - *available_width = 0; + possible_extend_width += available_width; + available_width = 0; } panel->reshape(panel_width + possible_extend_width, panel->getRect().getHeight()); lldebugs << "Extending panel: " << panel->getName() << ", extended width: " << possible_extend_width - << ", rest width to process: " << *available_width + << ", rest width to process: " << available_width << llendl; } } @@ -1116,12 +1118,25 @@ bool LLBottomTray::canButtonBeShown(EResizeState processed_object_type) const return can_be_shown; } -void LLBottomTray::initStateProcessedObjectMap() +void LLBottomTray::initResizeStateContainers() { + // init map with objects should be processed for each type mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_GESTURES, mGesturePanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_MOVEMENT, mMovementPanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_CAMERA, mCamPanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SNAPSHOT, mSnapshotPanel)); + + // init default widths + mObjectDefaultWidthMap[RS_BUTTON_GESTURES] = mGesturePanel->getRect().getWidth(); + mObjectDefaultWidthMap[RS_BUTTON_MOVEMENT] = mMovementPanel->getRect().getWidth(); + mObjectDefaultWidthMap[RS_BUTTON_CAMERA] = mCamPanel->getRect().getWidth(); + mObjectDefaultWidthMap[RS_BUTTON_SPEAK] = mSpeakPanel->getRect().getWidth(); + + // init an order of processed buttons + mButtonsProcessOrder.push_back(RS_BUTTON_GESTURES); + mButtonsProcessOrder.push_back(RS_BUTTON_MOVEMENT); + mButtonsProcessOrder.push_back(RS_BUTTON_CAMERA); + mButtonsProcessOrder.push_back(RS_BUTTON_SNAPSHOT); } void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool visible) @@ -1226,7 +1241,7 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible current_width = result_width; } - is_set = processShowButton(object_type, ¤t_width); + is_set = processShowButton(object_type, current_width); // Shrink buttons if needed if (is_set && decrease_width) diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 54258f74c1..e9d59e82ba 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -128,29 +128,131 @@ private: , RS_BUTTONS_CAN_BE_HIDDEN = RS_BUTTON_SNAPSHOT | RS_BUTTON_CAMERA | RS_BUTTON_MOVEMENT | RS_BUTTON_GESTURES }EResizeState; + /** + * Updates child controls size and visibility when it is necessary to reduce total width. + * + * Process order: + * - reduce chiclet panel to its minimal width; + * - reduce chatbar to its minimal width; + * - reduce visible buttons from right to left to their minimal width; + * - hide visible buttons from right to left; + * When button is hidden chatbar extended to fill released space if it is necessary. + * + * @param[in] delta_width - value by which bottom tray should be shrunk. It is a negative value. + * @return positive value which bottom tray can not process when it reaches its minimal width. + * Zero if there was enough space to process delta_width. + */ S32 processWidthDecreased(S32 delta_width); + + /** + * Updates child controls size and visibility when it is necessary to extend total width. + * + * Process order: + * - show invisible buttons should be shown from left to right if possible; + * - extend visible buttons from left to right to their default width; + * - extend chatbar to its maximal width; + * - extend chiclet panel to all available space; + * When chatbar & chiclet panels are wider then their minimal width they can be reduced to allow + * a button gets visible in case if passed delta_width is not enough (chatbar first). + * + * @param[in] delta_width - value by which bottom tray should be extended. It is a positive value. + */ void processWidthIncreased(S32 delta_width); + + /** helper function to log debug messages */ void log(LLView* panel, const std::string& descr); - bool processShowButton(EResizeState shown_object_type, S32* available_width); - void processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width); + + /** + * Tries to show hidden by resize buttons using available width. + * + * Gets buttons visible if there is enough space. Reduces available_width in this case. + * + * @params[in, out] available_width - reference to available width to be used to show buttons. + * @see processShowButton() + */ + void processShowButtons(S32& available_width); + + /** + * Tries to show panel with specified button using available width. + * + * Shows button specified by type if there is enough space. Reduces available_width in this case. + * + * @params[in] shown_object_type - type of button to be shown. + * @params[in, out] available_width - reference to available width to be used to show button. + * + * @return true if button can be shown, false otherwise + */ + bool processShowButton(EResizeState shown_object_type, S32& available_width); + + /** + * Hides visible panels with all buttons that may be hidden by resize if it is necessary. + * + * When button gets hidden some space is released in bottom tray. + * This space is taken into account for several consecutive calls for several buttons. + * + * @params[in, out] required_width - reference to required width to be released. This is a negative value. + * Its absolute value is decreased by shown panel width. + * @params[in, out] buttons_freed_width - reference to value released over required one. + * If panel's width is more than required difference is added to buttons_freed_width. + * @see processHideButton() + */ + void processHideButtons(S32& required_width, S32& buttons_freed_width); + + /** + * Hides panel with specified button if it is visible. + * + * When button gets hidden some space is released in bottom tray. + * This space is taken into account for several consecutive calls for several buttons. + * + * @params[in] processed_object_type - type of button to be hide. + * @params[in, out] required_width - reference to required width to be released. This is a negative value. + * Its absolute value is decreased by panel width. + * @params[in, out] buttons_freed_width - reference to value released over required one. + * If panel's width is more than required difference is added to buttons_freed_width. + */ + void processHideButton(EResizeState processed_object_type, S32& required_width, S32& buttons_freed_width); /** * Shrinks shown buttons to reduce total taken space. * - * @param - required_width - width which buttons can use to be shrunk. It is a negative value. + * Shrinks buttons that may be shrunk smoothly first. Then shrinks Speak button. + * + * @param[in, out] required_width - reference to width value which should be released when buttons are shrunk. It is a negative value. * It is increased on the value processed by buttons. + * @params[in, out] buttons_freed_width - reference to value released over required one. + * If width of panel with Speak button is more than required that difference is added + * to buttons_freed_width. + * This is because Speak button shrinks discretely unlike other buttons which are changed smoothly. + */ + void processShrinkButtons(S32& required_width, S32& buttons_freed_width); + + /** + * Shrinks panel with specified button if it is visible. + * + * @params[in] processed_object_type - type of button to be shrunk. + * @param[in, out] required_width - reference to width value which should be released when button is shrunk. It is a negative value. + * It is increased on the value released by the button. */ - void processShrinkButtons(S32* required_width, S32* buttons_freed_width); - void processShrinkButton(EResizeState processed_object_type, S32* required_width); + void processShrinkButton(EResizeState processed_object_type, S32& required_width); /** * Extends shown buttons to increase total taken space. * - * @param - available_width - width which buttons can use to be extended. It is a positive value. - * It is decreased on the value processed by buttons. + * Extends buttons that may be extended smoothly first. Then extends Speak button. + * + * @param[in, out] available_width - reference to width value which buttons can use to be extended. + * It is a positive value. It is decreased on the value processed by buttons. */ - void processExtendButtons(S32* available_width); - void processExtendButton(EResizeState processed_object_type, S32* available_width); + void processExtendButtons(S32& available_width); + + /** + * Extends shown button to increase total taken space. + * + * @params[in] processed_object_type - type of button to be extended. + * @param[in, out] available_width - reference to width value which button can use to be extended. + * It is a positive value. It is decreased on the value processed by buttons. + */ + void processExtendButton(EResizeState processed_object_type, S32& available_width); /** * Determines if specified by type object can be shown. It should be hidden by shrink before. @@ -159,7 +261,15 @@ private: * - Gestures, Move, View, Snapshot */ bool canButtonBeShown(EResizeState processed_object_type) const; - void initStateProcessedObjectMap(); + + /** + * Initializes all containers stored data related to children resize state. + * + * @see mStateProcessedObjectMap + * @see mObjectDefaultWidthMap + * @see mButtonsProcessOrder + */ + void initResizeStateContainers(); /** * Sets passed visibility to object specified by resize type. @@ -205,6 +315,13 @@ private: typedef std::map<EResizeState, S32> state_object_width_map_t; state_object_width_map_t mObjectDefaultWidthMap; + typedef std::vector<EResizeState> resize_state_vec_t; + + /** + * Contains order in which child buttons should be processed in show/hide, extend/shrink methods. + */ + resize_state_vec_t mButtonsProcessOrder; + protected: LLBottomTray(const LLSD& key = LLSD()); diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index c73aa5f415..498aeec682 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -150,7 +150,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel LLPanelInventoryListItemBase* item_panel = NULL; if (item_type == LLAssetType::AT_OBJECT) { - item_panel = LLPanelInventoryListItemBase::create(item); + item_panel = buildAttachemntListItem(item); mAttachments->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false); } else if (item_type == LLAssetType::AT_BODYPART) @@ -232,6 +232,21 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor return item_panel; } +LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLViewerInventoryItem* item) +{ + llassert(item); + if (!item) return NULL; + + LLPanelDeletableWearableListItem* item_panel = LLPanelDeletableWearableListItem::create(item); + if (!item_panel) return NULL; + + //setting callbacks + //*TODO move that item panel's inner structure disclosing stuff into the panels + item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); + + return item_panel; +} + void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t& clothing_by_type) { llassert(clothing_by_type.size() == LLWearableType::WT_COUNT); diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 2d26bf781f..32acba5a3e 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -132,6 +132,7 @@ protected: LLPanelClothingListItem* buildClothingListItem(LLViewerInventoryItem* item, bool first, bool last); LLPanelBodyPartsListItem* buildBodypartListItem(LLViewerInventoryItem* item); + LLPanelDeletableWearableListItem* buildAttachemntListItem(LLViewerInventoryItem* item); LLFlatListView* mAttachments; LLFlatListView* mClothing; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 0a83ba8212..ddd41a1791 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -846,6 +846,17 @@ void LLPanelGroupGeneral::reset() mInsignia->setEnabled(true); + LLPointer<LLUIImage> imagep = LLUI::getUIImage(mInsignia->getDefaultImageName()); + if(imagep) + { + LLViewerFetchedTexture* pTexture = dynamic_cast<LLViewerFetchedTexture*>(imagep->getImage().get()); + if(pTexture) + { + LLUUID id = pTexture->getID(); + mInsignia->setImageAssetID(id); + } + } + { std::string empty_str = ""; mEditCharter->setText(empty_str); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 1c74c8f26a..c04be85174 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -246,15 +246,7 @@ BOOL LLPanelOutfitEdit::postBuild() mSearchFilter = getChild<LLFilterEditor>("look_item_filter"); mSearchFilter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onSearchEdit, this, _2)); - /* Removing add to look inline button (not part of mvp for viewer 2) - LLButton::Params add_params; - add_params.name("add_to_look"); - add_params.click_callback.function(boost::bind(&LLPanelOutfitEdit::onAddToLookClicked, this)); - add_params.label("+"); - - mAddToLookBtn = LLUICtrlFactory::create<LLButton>(add_params); - mAddToLookBtn->setEnabled(FALSE); - mAddToLookBtn->setVisible(FALSE); */ + childSetAction("add_to_outfit_btn", boost::bind(&LLPanelOutfitEdit::onAddToOutfitClicked, this)); mEditWearableBtn = getChild<LLButton>("edit_wearable_btn"); mEditWearableBtn->setEnabled(FALSE); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 26f6bc47cd..bac66d966a 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -103,7 +103,7 @@ LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem* } LLPanelClothingListItem::LLPanelClothingListItem(LLViewerInventoryItem* item) - : LLPanelWearableListItem(item) + : LLPanelDeletableWearableListItem(item) { } @@ -118,18 +118,13 @@ void LLPanelClothingListItem::init() BOOL LLPanelClothingListItem::postBuild() { - LLPanelInventoryListItemBase::postBuild(); + LLPanelDeletableWearableListItem::postBuild(); - addWidgetToLeftSide("btn_delete"); addWidgetToRightSide("btn_move_up"); addWidgetToRightSide("btn_move_down"); addWidgetToRightSide("btn_lock"); addWidgetToRightSide("btn_edit"); - LLButton* delete_btn = getChild<LLButton>("btn_delete"); - // Reserve space for 'delete' button event if it is invisible. - setLeftWidgetsWidth(delete_btn->getRect().mRight); - setWidgetsVisible(false); reshapeWidgets(); @@ -176,6 +171,46 @@ BOOL LLPanelBodyPartsListItem::postBuild() return TRUE; } + +// static +LLPanelDeletableWearableListItem* LLPanelDeletableWearableListItem::create(LLViewerInventoryItem* item) +{ + LLPanelDeletableWearableListItem* list_item = NULL; + if(item) + { + list_item = new LLPanelDeletableWearableListItem(item); + list_item->init(); + } + return list_item; +} + +LLPanelDeletableWearableListItem::LLPanelDeletableWearableListItem(LLViewerInventoryItem* item) +: LLPanelWearableListItem(item) +{ +} + +void LLPanelDeletableWearableListItem::init() +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_deletable_wearable_list_item.xml"); +} + +BOOL LLPanelDeletableWearableListItem::postBuild() +{ + LLPanelWearableListItem::postBuild(); + + addWidgetToLeftSide("btn_delete"); + + LLButton* delete_btn = getChild<LLButton>("btn_delete"); + // Reserve space for 'delete' button event if it is invisible. + setLeftWidgetsWidth(delete_btn->getRect().mRight); + + setWidgetsVisible(false); + reshapeWidgets(); + + return TRUE; +} + + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index b7f3fd0dff..5e3202c687 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -67,12 +67,35 @@ protected: LLPanelWearableListItem(LLViewerInventoryItem* item); }; + +class LLPanelDeletableWearableListItem : public LLPanelWearableListItem +{ + LOG_CLASS(LLPanelDeletableWearableListItem); +public: + + static LLPanelDeletableWearableListItem* create(LLViewerInventoryItem* item); + + virtual ~LLPanelDeletableWearableListItem() {}; + + /*virtual*/ BOOL postBuild(); + + /** + * Make button visible during mouse over event. + */ + inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); } + +protected: + LLPanelDeletableWearableListItem(LLViewerInventoryItem* item); + + /*virtual*/ void init(); +}; + /** * @class LLPanelClothingListItem * * Provides buttons for editing, moving, deleting a wearable. */ -class LLPanelClothingListItem : public LLPanelWearableListItem +class LLPanelClothingListItem : public LLPanelDeletableWearableListItem { LOG_CLASS(LLPanelClothingListItem); public: @@ -86,7 +109,6 @@ public: /** * Make button visible during mouse over event. */ - inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); } inline void setShowMoveUpButton(bool show) { setShowWidget("btn_move_up", show); } inline void setShowMoveDownButton(bool show) { setShowWidget("btn_move_down", show); } @@ -125,28 +147,6 @@ protected: }; -class LLPanelDeletableWearableListItem : public LLPanelWearableListItem -{ - LOG_CLASS(LLPanelDeletableWearableListItem); -public: - - static LLPanelDeletableWearableListItem* create(LLViewerInventoryItem* item); - - virtual ~LLPanelDeletableWearableListItem(); - - /*virtual*/ BOOL postBuild(); - - /** - * Make button visible during mouse over event. - */ - inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); } - -protected: - LLPanelDeletableWearableListItem(LLViewerInventoryItem* item); - - /*virtual*/ void init(); -}; - /** * @class LLPanelDummyClothingListItem * diff --git a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png Binary files differnew file mode 100644 index 0000000000..c067646c65 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index c4f90dee3e..f4206dc2e5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -135,6 +135,7 @@ with the same filename but different name <texture name="ForwardArrow_Press" file_name="icons/ForwardArrow_Press.png" preload="false" /> <texture name="Generic_Group" file_name="icons/Generic_Group.png" preload="false" /> + <texture name="Generic_Group_Large" file_name="icons/Generic_Group_Large.png" preload="false" /> <texture name="icon_group.tga" file_name="icons/Generic_Group.png" preload="false" /> <texture name="Generic_Object_Small" file_name="icons/Generic_Object_Small.png" preload="false" /> <texture name="Generic_Person" file_name="icons/Generic_Person.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml b/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml new file mode 100644 index 0000000000..2f37b9d3c9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="top|right|left" + height="23" + layout="topleft" + left="0" + name="deletable_wearable_item" + top="0" + width="380"> + <icon + follows="top|right|left" + height="20" + image_name="ListItem_Over" + layout="topleft" + left="0" + name="hovered_icon" + top="0" + visible="false" + width="380" /> + <icon + height="20" + follows="top|right|left" + image_name="ListItem_Select" + layout="topleft" + left="0" + name="selected_icon" + top="0" + visible="false" + width="380" /> + <button + name="btn_delete" + layout="topleft" + follows="top|left" + image_unselected="Toast_CloseBtn" + image_selected="Toast_CloseBtn" + top="0" + left="0" + height="20" + width="20" + tab_stop="false" /> + <icon + height="16" + follows="top|left" + image_name="Inv_Object" + layout="topleft" + left_pad="3" + name="item_icon" + top="2" + width="16" /> + <text + follows="left|right" + height="16" + layout="topleft" + left_pad="5" + allow_html="false" + use_ellipses="true" + name="item_name" + text_color="white" + top="4" + value="..." + width="359" /> + <panel + background_visible="true" + bg_alpha_color="0.4 0.4 0.4 1.0" + bottom="0" + follows="left|right|top" + height="1" + layout="bottomleft" + left="0" + name="wearable_type_separator_panel" + visible="true" + width="380"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 9341d433e8..e79ae34627 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -28,6 +28,7 @@ Hover your mouse over the options for more help. width="304" layout="topleft"> <texture_picker + default_image_name="Generic_Group_Large" follows="left|top" height="110" label="" |