diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 13 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.h | 8 | ||||
-rw-r--r-- | indra/newview/llbottomtray.cpp | 131 | ||||
-rw-r--r-- | indra/newview/llbottomtray.h | 22 | ||||
-rw-r--r-- | indra/newview/llchatitemscontainerctrl.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lljoystickbutton.cpp | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_im_session.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/main_view.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_bottomtray.xml | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_chat_item.xml | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_notify.xml | 3 |
12 files changed, 188 insertions, 26 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 14a6ddb7e0..1fb618adee 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -413,6 +413,19 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au } } +bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp) +{ + LayoutPanel* panel = findEmbeddedPanelByName(panel_name); + + if (panel) + { + if (min_widthp) *min_widthp = panel->mMinWidth; + if (min_heightp) *min_heightp = panel->mMinHeight; + } + + return NULL != panel; +} + static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 9cbcb285dc..abd5436018 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -82,6 +82,14 @@ public: void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); + /** + * Gets minimal width and/or height of the specified by name panel. + * + * If it is necessary to get only the one dimension pass NULL for another one. + * @returns true if specified by panel_name internal panel exists, false otherwise. + */ + bool getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp); + void updateLayout(BOOL force_resize = FALSE); static void updateClass(); diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 958dbf226a..3c34aa4fa4 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -317,6 +317,10 @@ BOOL LLBottomTray::postBuild() // Registering Chat Bar to receive Voice client status change notifications. gVoiceClient->addObserver(this); + mObjectDefaultWidthMap[RS_BUTTON_GESTURES] = mGesturePanel->getRect().getWidth(); + mObjectDefaultWidthMap[RS_BUTTON_MOVEMENT] = mMovementPanel->getRect().getWidth(); + mObjectDefaultWidthMap[RS_BUTTON_CAMERA] = mCamPanel->getRect().getWidth(); + return TRUE; } @@ -402,7 +406,6 @@ void LLBottomTray::reshape(S32 width, S32 height, BOOL called_from_parent) } } - lldebugs << "There is no enough width to reshape all children: " << extra_shrink_width << llendl; if (should_be_reshaped) { lldebugs << "Reshape all children with width: " << width << llendl; @@ -473,7 +476,12 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) S32 buttons_freed_width = 0; if (still_should_be_processed) { - processHideButton(RS_BUTTON_SNAPSHOT, &delta_width, &buttons_freed_width); + processShrinkButtons(&delta_width); + + if (delta_width < 0) + { + processHideButton(RS_BUTTON_SNAPSHOT, &delta_width, &buttons_freed_width); + } if (delta_width < 0) { @@ -493,7 +501,7 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) if (delta_width < 0) { extra_shrink_width = -delta_width; - lldebugs << "There is no enough room for bottom tray, resizing still should be processed: " + llwarns << "There is no enough width to reshape all children: " << extra_shrink_width << llendl; } @@ -551,7 +559,7 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) processShowButton(RS_BUTTON_SNAPSHOT, &available_width, &buttons_required_width); } - // if we have to show some buttons but whidth increasing is not enough... + // if we have to show some buttons but width increasing is not enough... if (buttons_required_width > 0 && delta_width < buttons_required_width) { // ... let's shrink nearby chat & chiclet panels @@ -587,6 +595,8 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) // shown buttons take some space, rest should be processed by nearby chatbar & chiclet panels delta_width -= buttons_required_width; + processExtendButtons(&delta_width); + // how many space can nearby chatbar take? S32 chatbar_panel_width_ = mNearbyChatBar->getRect().getWidth(); if (delta_width > 0 && chatbar_panel_width_ < chatbar_panel_max_width) @@ -656,6 +666,119 @@ void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* re } } +void LLBottomTray::processShrinkButtons(S32* required_width) +{ + processShrinkButton(RS_BUTTON_CAMERA, required_width); + + if (*required_width < 0) + { + processShrinkButton(RS_BUTTON_MOVEMENT, required_width); + } + if (*required_width < 0) + { + processShrinkButton(RS_BUTTON_GESTURES, required_width); + } +} + +void LLBottomTray::processShrinkButton(EResizeState processed_object_type, /*const std::string& panel_name, */S32* required_width) +{ + LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; + if (NULL == panel) + { + lldebugs << "There is no object to process for type: " << processed_object_type << llendl; + return; + } + + if (panel->getVisible()) + { + S32 panel_width = panel->getRect().getWidth(); + S32 panel_min_width = 0; + std::string panel_name = panel->getName(); + bool success = mToolbarStack->getPanelMinSize(panel_name, &panel_min_width, NULL); + S32 possible_shrink_width = panel_width - panel_min_width; + + if (!success) + { + lldebugs << "Panel was not found to get its min width: " << panel_name << llendl; + } + // we have some space to free by shrinking the button + else if (possible_shrink_width > 0) + { + // let calculate real width to shrink + + // 1. apply all possible width + *required_width += possible_shrink_width; + + // 2. it it is too much... + if (*required_width > 0) + { + // reduce applied shrunk width to the excessive value. + 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 + << llendl; + } + } +} + + +void LLBottomTray::processExtendButtons(S32* available_width) +{ + processExtendButton(RS_BUTTON_GESTURES, available_width); + + if (*available_width > 0) + { + processExtendButton(RS_BUTTON_CAMERA, available_width); + } + if (*available_width > 0) + { + processExtendButton(RS_BUTTON_MOVEMENT, available_width); + } +} + +void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32* available_width) +{ + LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; + if (NULL == panel) + { + lldebugs << "There is no object to process for type: " << processed_object_type << llendl; + return; + } + + if (!panel->getVisible()) return; + + S32 panel_max_width = mObjectDefaultWidthMap[processed_object_type]; + S32 panel_width = panel->getRect().getWidth(); + S32 possible_extend_width = panel_max_width - panel_width; + + if (possible_extend_width > 0) + { + // let calculate real width to extend + + // 1. apply all possible width + *available_width -= possible_extend_width; + + // 2. it it is too much... + if (*available_width < 0) + { + // reduce applied extended width to the excessive value. + 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 + << llendl; + } +} + bool LLBottomTray::canButtonBeShown(EResizeState processed_object_type) const { bool can_be_shown = mResizeState & processed_object_type; diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 8989816bfe..97bcc23403 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -98,7 +98,6 @@ private: , RS_BUTTON_MOVEMENT = 0x0010 , RS_BUTTON_GESTURES = 0x0020 , RS_BUTTON_SPEAK = 0x0040 - , RS_RESIZABLE_BUTTONS = /*RS_BUTTON_SNAPSHOT | */RS_BUTTON_CAMERA | RS_BUTTON_MOVEMENT | RS_BUTTON_GESTURES }EResizeState; S32 processWidthDecreased(S32 delta_width); @@ -108,6 +107,24 @@ private: 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. + * It is increased on the value processed by buttons. + */ + void processShrinkButtons(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. + */ + void processExtendButtons(S32* available_width); + 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. * * Processes buttons a such way to show buttons in constant order: @@ -140,6 +157,9 @@ private: typedef std::map<EResizeState, LLPanel*> state_object_map_t; state_object_map_t mStateProcessedObjectMap; + typedef std::map<EResizeState, S32> state_object_width_map_t; + state_object_width_map_t mObjectDefaultWidthMap; + protected: LLBottomTray(const LLSD& key = LLSD()); diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index d2e3247250..244c7b1794 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -171,9 +171,6 @@ void LLNearbyChatToastPanel::init(LLSD& notification) caption->getChild<LLTextBox>("sender_name", false)->setText(str_sender , style_params); - caption->getChild<LLTextBox>("msg_time", false)->setText(appendTime() , style_params ); - - LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); msg_text->setText(mText, style_params); diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 0acc67ff5a..2cc5c8335d 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -136,13 +136,13 @@ void LLJoystick::updateSlop() bool LLJoystick::pointInCircle(S32 x, S32 y) const { - if(this->getLocalRect().mTop!=this->getLocalRect().mRight) + if(this->getLocalRect().getHeight() != this->getLocalRect().getWidth()) { llwarns << "Joystick shape is not square"<<llendl; - return TRUE; + return true; } //center is x and y coordinates of center of joystick circle, and also its radius - int center = this->getLocalRect().mTop/2; + int center = this->getLocalRect().getHeight()/2; bool in_circle = (x - center) * (x - center) + (y - center) * (y - center) <= center * center; return in_circle; } diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 452d28d4ea..70d708f0e7 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -9,6 +9,7 @@ name="panel_im" help_topic="panel_im" top="0" + can_close="false" can_dock="true" can_minimize="true" visible="true" diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 9e35c95d45..14a4949df7 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -10,7 +10,7 @@ <layout_stack border_size="0" follows="all" mouse_opaque="false" - height="772" + height="768" name="menu_stack" orientation="vertical" top="0"> diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml index 5c8a8ee208..3842c2a8db 100644 --- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml @@ -61,6 +61,7 @@ layout="topleft" left_delta="0" name="Block object by name..." + tool_tip="Pick an object to block by name" top_pad="4" width="210" > <button.commit_callback diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index a902f50582..d2933c0c0e 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -94,7 +94,7 @@ min_height="28" width="82" top_delta="0" - min_width="82" + min_width="52" name="gesture_panel" user_resize="false"> <gesture_combo_box @@ -105,9 +105,13 @@ name="Gesture" left="0" top="3" - use_ellipses="true" width="82" - tool_tip="Shows/hides gestures"/> + tool_tip="Shows/hides gestures"> + <gesture_combo_box.drop_down_button + font="SansSerifSmall" + pad_right="10" + use_ellipses="true" /> + </gesture_combo_box> </layout_panel> <icon auto_resize="false" @@ -131,7 +135,7 @@ name="movement_panel" user_resize="false" width="80" - min_width="80"> + min_width="49"> <button follows="left|right" height="23" @@ -167,7 +171,7 @@ height="28" layout="topleft" min_height="28" - min_width="80" + min_width="49" name="cam_panel" user_resize="false" width="80"> 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 05b04bbf8e..d8a0c877fd 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -15,19 +15,13 @@ color="1 1 1 1" enabled="true" name="avatar_icon" /> <text - width="130" top="25" left="40" height="20" follows="left|right|top" + width="150" top="25" left="40" height="20" follows="left|right|top" font="SansSerifBigBold" text_color="white" word_wrap="false" use_ellipses="true" mouse_opaque="true" name="sender_name" > Jerry Knight </text> - <icon top="22" left="170" width="15" height="15" follows="top|right" + <icon top="22" left="215" width="15" height="15" follows="top|right" image_name="icn_voice-pvtfocus.tga" visible="false" name="msg_inspector"/> - <icon top="22" left="190" width="10" height="10" follows="top|right" - image_name="speaking_indicator.tga" name="msg_icon"/> - <text width="35" top="22" left="205" height="20" follows="right|top" - text_color="white" word_wrap="true" mouse_opaque="true" name="msg_time" > - 10:32 - </text> </panel> <text_chat top="-35" left="10" right="-10" height="120" follows="left|right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_group_notify.xml b/indra/newview/skins/default/xui/en/panel_group_notify.xml index 984a799b41..e699a77581 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notify.xml @@ -104,7 +104,8 @@ name="attachment"
text_color="GroupNotifyTextColor"
value="Attachment"
- width="280" />
+ use_ellipses="true"
+ width="250" />
<button
bottom="130"
follows="bottom"
|