diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-16 16:50:21 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-16 16:50:21 +0000 |
commit | e2d56363f105f8bef2b05a6bd4c5276db9a60d82 (patch) | |
tree | 1f2a87ac22a6af695ec59d8f812a2d14f4fd4bf2 /indra/newview | |
parent | aa7fadfde02d396ab04c82f91f01d486b4f5396d (diff) | |
parent | 23e173631d24e7c301d2d6d2b0b6b9a34b5818ea (diff) |
viewer2 merge.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llbottomtray.cpp | 160 | ||||
-rw-r--r-- | indra/newview/llbottomtray.h | 8 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llfloatertools.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfolderview.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llimfloater.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llpanelmediasettingsgeneral.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 12 | ||||
-rw-r--r-- | indra/newview/lltoastimpanel.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/colors.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_preview_texture.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/combo_box.xml | 2 |
16 files changed, 198 insertions, 66 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 93b708f299..95a946cee8 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -60,6 +60,27 @@ namespace const std::string& PANEL_MOVEMENT_NAME = "movement_panel"; const std::string& PANEL_CAMERA_NAME = "cam_panel"; const std::string& PANEL_GESTURE_NAME = "gesture_panel"; + + S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel) + { + S32 minimal_width = 0; + llassert(stack); + if ( stack && panel && panel->getVisible() ) + { + stack->getPanelMinSize(panel->getName(), &minimal_width, NULL); + } + return minimal_width; + } + + S32 get_curr_width(LLUICtrl* ctrl) + { + S32 cur_width = 0; + if ( ctrl && ctrl->getVisible() ) + { + cur_width = ctrl->getRect().getWidth(); + } + return cur_width; + } } class LLBottomTrayLite @@ -1094,58 +1115,131 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis if (mDummiesMap.count(shown_object_type)) { - mDummiesMap[shown_object_type]->setVisible(visible); + // Hide/show layout panel for dummy icon. + mDummiesMap[shown_object_type]->getParent()->setVisible(visible); } } void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification) { - bool can_be_set = true; - - if (visible) + if (!setVisibleAndFitWidths(shown_object_type, visible) && visible && raise_notification) { - LLPanel* panel = mStateProcessedObjectMap[shown_object_type]; - if (NULL == panel) - { - lldebugs << "There is no object to process for state: " << shown_object_type << llendl; - return; - } + LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown", + LLSD(), + LLSD(), + LLNotificationFunctorRegistry::instance().DONOTHING); + } +} - const S32 dummy_width = mDummiesMap.count(shown_object_type) ? mDummiesMap[shown_object_type]->getRect().getWidth() : 0; +bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible) +{ + LLPanel* cur_panel = mStateProcessedObjectMap[object_type]; + if (NULL == cur_panel) + { + lldebugs << "There is no object to process for state: " << object_type << llendl; + return false; + } - const S32 chatbar_panel_width = mNearbyChatBar->getRect().getWidth(); - const S32 chatbar_panel_min_width = mNearbyChatBar->getMinWidth(); + const S32 dummy_width = mDummiesMap.count(object_type) + ? mDummiesMap[object_type]->getParent()->getRect().getWidth() + : 0; - const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth(); - const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth(); + bool is_set = true; - const S32 available_width = (chatbar_panel_width - chatbar_panel_min_width) - + (chiclet_panel_width - chiclet_panel_min_width); + if (visible) + { + // Assume that only chiclet panel can be auto-resized and + // don't take into account width of dummy widgets + const S32 available_width = + mChicletPanel->getParent()->getRect().getWidth() - + mChicletPanel->getMinWidth() - + dummy_width; + + S32 preferred_width = mObjectDefaultWidthMap[object_type]; + S32 current_width = cur_panel->getRect().getWidth(); + S32 result_width = 0; + bool decrease_width = false; + + // Mark this button to be shown + mResizeState |= object_type; + + if (preferred_width > 0 && available_width >= preferred_width) + { + result_width = preferred_width; + } + else if (available_width >= current_width) + { + result_width = current_width; + } + else + { + // Calculate the possible shrunk width as difference between current and minimal widths + const S32 chatbar_shrunk_width = + mNearbyChatBar->getRect().getWidth() - mNearbyChatBar->getMinWidth(); + + const S32 sum_of_min_widths = + get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_CAMERA]) + + get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + + get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + + get_panel_min_width(mToolbarStack, mSpeakPanel); + + const S32 sum_of_curr_widths = + get_curr_width(mStateProcessedObjectMap[RS_BUTTON_CAMERA]) + + get_curr_width(mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + + get_curr_width(mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + + get_curr_width(mSpeakPanel); + + const S32 possible_shrunk_width = + chatbar_shrunk_width + (sum_of_curr_widths - sum_of_min_widths); + + // Minimal width of current panel + S32 minimal_width = 0; + mToolbarStack->getPanelMinSize(cur_panel->getName(), &minimal_width, NULL); + + if ( (available_width + possible_shrunk_width) >= minimal_width) + { + // There is enough space for minimal width, but set the result_width + // to current_width so buttons widths decreasing will be done in predefined order + result_width = current_width; + decrease_width = true; + } + else + { + // Nothing can be done, give up... + return false; + } + } - const S32 required_width = panel->getRect().getWidth() + dummy_width; - can_be_set = available_width >= required_width; - } + if (result_width != current_width) + { + cur_panel->reshape(result_width, cur_panel->getRect().getHeight()); + current_width = result_width; + } - if (can_be_set) - { - setTrayButtonVisible(shown_object_type, visible); + is_set = processShowButton(object_type, ¤t_width); - // if we hide the button mark it NOT to show while future bottom tray extending - if (!visible) + // Shrink buttons if needed + if (is_set && decrease_width) { - mResizeState &= ~shown_object_type; + processWidthDecreased( -result_width - dummy_width ); } } else { - // mark this button to show it while future bottom tray extending - mResizeState |= shown_object_type; - if ( raise_notification ) - LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown", - LLSD(), - LLSD(), - LLNotificationFunctorRegistry::instance().DONOTHING); + const S32 delta_width = get_curr_width(cur_panel); + + setTrayButtonVisible(object_type, false); + + // Mark button NOT to show while future bottom tray extending + mResizeState &= ~object_type; + + // Extend other buttons if need + if (delta_width) + { + processWidthIncreased(delta_width + dummy_width); + } } + return is_set; } //EOF diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index ee0eb13218..2eeb0c0017 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -173,6 +173,14 @@ private: */ void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification = true); + /** + * Sets passed visibility to required button and fit widths of shown + * buttons(notice that method can shrink widths to + * allocate needed room in bottom tray). + * Returns true if visibility of required button was set. + */ + bool setVisibleAndFitWidths(EResizeState object_type, bool visible); + MASK mResizeState; typedef std::map<EResizeState, LLPanel*> state_object_map_t; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 43111d76f7..f20ef76bed 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -666,7 +666,8 @@ void LLFloaterPreference::refreshEnabledGraphics() LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); if(instance) { - instance->refreshEnabledState(); + instance->refresh(); + //instance->refreshEnabledState(); } LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings"); if (hardware_settings) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 94facb6b20..b968cc370c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1523,7 +1523,9 @@ void LLFloaterTools::updateMediaSettings() mMediaSettings[ base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX ) ] = ! identical; // Auto play - value_bool = default_media_data.getAutoPlay(); + //value_bool = default_media_data.getAutoPlay(); + // set default to auto play TRUE -- angela EXT-5172 + value_bool = true; struct functor_getter_auto_play : public LLSelectedTEGetFunctor< bool > { functor_getter_auto_play(const LLMediaEntry& entry) : mMediaEntry(entry) {} @@ -1534,7 +1536,8 @@ void LLFloaterTools::updateMediaSettings() if ( object->getTE(face) ) if ( object->getTE(face)->getMediaData() ) return object->getTE(face)->getMediaData()->getAutoPlay(); - return mMediaEntry.getAutoPlay(); + //return mMediaEntry.getAutoPlay(); set default to auto play TRUE -- angela EXT-5172 + return true; }; const LLMediaEntry &mMediaEntry; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index d053933dfb..68faaeaa0b 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -222,7 +222,7 @@ LLFolderView::LLFolderView(const Params& p) // Escape is handled by reverting the rename, not commiting it (default behavior) LLLineEditor::Params params; params.name("ren"); - params.rect(getRect()); + params.rect(rect); params.font(getLabelFontForStyle(LLFontGL::NORMAL)); params.max_length_bytes(DB_INV_ITEM_NAME_STR_LEN); params.commit_callback.function(boost::bind(&LLFolderView::commitRename, this, _2)); @@ -234,13 +234,19 @@ LLFolderView::LLFolderView(const Params& p) // Textbox LLTextBox::Params text_p; - LLRect new_r(5, 40, 300, 40-13); - text_p.name(std::string(p.name)); + LLFontGL* font = getLabelFontForStyle(mLabelStyle); + LLRect new_r = LLRect(rect.mLeft + ICON_PAD, + rect.mTop - TEXT_PAD, + rect.mRight, + rect.mTop - TEXT_PAD - llfloor(font->getLineHeight())); text_p.rect(new_r); - text_p.font(getLabelFontForStyle(mLabelStyle)); + text_p.name(std::string(p.name)); + text_p.font(font); text_p.visible(false); text_p.allow_html(true); mStatusTextBox = LLUICtrlFactory::create<LLTextBox> (text_p); + mStatusTextBox->setFollowsLeft(); + mStatusTextBox->setFollowsTop(); //addChild(mStatusTextBox); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 8b2c5b039f..847695577a 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -497,7 +497,11 @@ void LLIMFloater::setVisible(BOOL visible) { //only if floater was construced and initialized from xml updateMessages(); - mInputEditor->setFocus(TRUE); + //prevent steal focus when IM opened in multitab mode + if (!isChatMultiTab()) + { + mInputEditor->setFocus(TRUE); + } } if(!visible) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 91eab9f4f1..86f101e012 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -455,18 +455,20 @@ void LLPanelProfileTab::onMapButtonClick() void LLPanelProfileTab::updateButtons() { - bool is_avatar_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); + bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); if(LLAvatarActions::isFriend(getAvatarId())) { - childSetEnabled("teleport", is_avatar_online); + childSetEnabled("teleport", is_buddy_online); } else { childSetEnabled("teleport", true); } - bool enable_map_btn = is_avatar_online && gAgent.isGodlike() || is_agent_mappable(getAvatarId()); + bool enable_map_btn = (is_buddy_online && + is_agent_mappable(getAvatarId())) + || gAgent.isGodlike(); childSetEnabled("show_on_map_btn", enable_map_btn); } diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 64a265219b..f601a8d51c 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -206,7 +206,7 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) { LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata; self->mAutoLoop->clear(); - self->mAutoPlay->setValue(LLSD(TRUE)); // set default value for auto play to true; + self->mAutoPlay->clear(); self->mAutoScale->clear(); self->mAutoZoom ->clear(); self->mCurrentURL->clear(); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 0ed6bea74f..76b02f07ec 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -304,12 +304,12 @@ void LLPreviewTexture::openToSave() // static void LLPreviewTexture::onFileLoadedForSave(BOOL success, - LLViewerFetchedTexture *src_vi, - LLImageRaw* src, - LLImageRaw* aux_src, - S32 discard_level, - BOOL final, - void* userdata) + LLViewerFetchedTexture *src_vi, + LLImageRaw* src, + LLImageRaw* aux_src, + S32 discard_level, + BOOL final, + void* userdata) { LLUUID* item_uuid = (LLUUID*) userdata; diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index cb43beb819..26d3bd5192 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -66,12 +66,13 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif std::string font_size = LLFontGL::sizeFromFont(fontp); style_params.font.name(font_name); style_params.font.size(font_size); - style_params.font.style = "UNDERLINE"; + //Handle IRC styled /me messages. std::string prefix = p.message.substr(0, 4); if (prefix == "/me " || prefix == "/me'") { + //style_params.font.style = "UNDERLINE"; mMessage->clear(); style_params.font.style ="ITALIC"; @@ -82,7 +83,8 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif } else { - mMessage->setValue(p.message); + style_params.font.style = "NORMAL"; + mMessage->setText(p.message, style_params); } mAvatarName->setValue(p.from); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0e133f8729..25c843cf15 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2399,16 +2399,25 @@ void LLViewerMediaImpl::calculateInterest() for(; iter != mObjectList.end() ; ++iter) { LLVOVolume *obj = *iter; - if(LLMuteList::getInstance()->isMuted(obj->getID())) + llassert(obj); + if (!obj) continue; + if(LLMuteList::getInstance() && + LLMuteList::getInstance()->isMuted(obj->getID())) + { mIsMuted = true; + } else { // We won't have full permissions data for all objects. Attempt to mute objects when we can tell their owners are muted. - LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj); - if(obj_perm) + if (LLSelectMgr::getInstance()) { - if(LLMuteList::getInstance()->isMuted(obj_perm->getOwner())) - mIsMuted = true; + LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj); + if(obj_perm) + { + if(LLMuteList::getInstance() && + LLMuteList::getInstance()->isMuted(obj_perm->getOwner())) + mIsMuted = true; + } } } } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index b33d4f73a4..45050de044 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -286,6 +286,9 @@ name="ColorPaletteEntry32" reference="White" /> <color + name="ComboListBgColor" + reference="DkGray" /> + <color name="ConsoleBackground" reference="Black" /> <color diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index fc6f06ffd4..7fd7eab867 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -118,7 +118,7 @@ <button follows="right|bottom" height="22" - label="Cancel" + label="Discard" layout="topleft" left_pad="5" name="Discard" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 56b8440c4f..d7e75abaea 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2297,6 +2297,9 @@ Display settings have been set to recommended levels based on your system config name="ErrorMessage" type="alertmodal"> [ERROR_MESSAGE] + <usetemplate + name="okbutton" + yestext="OK"/> </notification> <notification diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b9dd87e878..c62a36bca3 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1805,12 +1805,9 @@ Clears (deletes) the media and all params from the given face. <string name="LeaveMouselook">Press ESC to return to World View</string> <!-- inventory --> - <string name="InventoryNoMatchingItems">[secondlife:///app/search/groups No matching items found in inventory.Try "Search"?]</string> - <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> - <string name="InventoryNoTexture"> - You do not have a copy of -this texture in your inventory - </string> + <string name="InventoryNoMatchingItems">No matching items found in inventory. Try [secondlife:///app/search/groups "Search"].</string> + <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> + <string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string> <!-- use value="" because they have preceding spaces --> <string name="no_transfer" value=" (no transfer)" /> <string name="no_modify" value=" (no modify)" /> diff --git a/indra/newview/skins/default/xui/en/widgets/combo_box.xml b/indra/newview/skins/default/xui/en/widgets/combo_box.xml index 132bd24bca..1f7499646f 100644 --- a/indra/newview/skins/default/xui/en/widgets/combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/combo_box.xml @@ -20,7 +20,7 @@ image_pressed="DropDown_Press" image_pressed_selected="DropDown_Press" image_disabled="DropDown_Disabled" /> - <combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" + <combo_box.combo_list bg_writeable_color="ComboListBgColor" background_visible="true" /> <!-- Text is "tentative" if you have typed in a string that does not match |