diff options
author | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-29 18:03:39 +0300 |
---|---|---|
committer | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-29 18:03:39 +0300 |
commit | 6a463a41fec89c7f1eadb77c16eeae169ff777d0 (patch) | |
tree | f297c32418eb139eded752ce99b418773328e458 /indra/newview/llbottomtray.cpp | |
parent | c44db34a15abd2e96b8fd461e9fb3e217fe648cc (diff) | |
parent | 71ed326f51770b215ba5dd2ac8d159c3b764c2d2 (diff) |
Merge sergeylproductengine/viewer-experience-fui with richard/viewer-experience-fui
Diffstat (limited to 'indra/newview/llbottomtray.cpp')
-rw-r--r-- | indra/newview/llbottomtray.cpp | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index e6448d38ee..19061c55ca 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -166,13 +166,13 @@ public: mChatBarContainer(NULL), mGesturePanel(NULL) { - mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); + //mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); buildFromFile("panel_bottomtray_lite.xml"); } BOOL postBuild() { - mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); + //mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel"); mGesturePanel = getChild<LLPanel>("gesture_panel"); @@ -202,7 +202,8 @@ public: }; LLBottomTray::LLBottomTray(const LLSD&) -: mChicletPanel(NULL), +: mDesiredNearbyChatWidth(0), + mChicletPanel(NULL), mSpeakPanel(NULL), mSpeakBtn(NULL), mNearbyChatBar(NULL), @@ -224,7 +225,7 @@ LLBottomTray::LLBottomTray(const LLSD&) // before chiclets do that. LLIMMgr::getInstance()->addSessionObserver(this); - mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); + //mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); buildFromFile("panel_bottomtray.xml"); @@ -271,7 +272,8 @@ LLBottomTray::~LLBottomTray() // *TODO Vadim: why void* ? void* LLBottomTray::createNearbyChatBar(void* userdata) { - return new LLNearbyChatBar(); + //return new LLNearbyChatBar(); + return NULL; } LLNearbyChatBar* LLBottomTray::getNearbyChatBar() @@ -399,7 +401,7 @@ void LLBottomTray::onMouselookModeOut() { mIsInLiteMode = false; mBottomTrayLite->setVisible(FALSE); - mNearbyChatBar->getChatBox()->setText(mBottomTrayLite->mNearbyChatBar->getChatBox()->getText()); + //mNearbyChatBar->getChatBox()->setText(mBottomTrayLite->mNearbyChatBar->getChatBox()->getText()); setVisible(TRUE); } @@ -412,8 +414,8 @@ void LLBottomTray::onMouselookModeIn() getParent()->addChild(mBottomTrayLite); mBottomTrayLite->setShape(getLocalRect()); - mBottomTrayLite->mNearbyChatBar->getChatBox()->setText(mNearbyChatBar->getChatBox()->getText()); - mBottomTrayLite->mGesturePanel->setVisible(gSavedSettings.getBOOL("ShowGestureButton")); + //mBottomTrayLite->mNearbyChatBar->getChatBox()->setText(mNearbyChatBar->getChatBox()->getText()); + //mBottomTrayLite->mGesturePanel->setVisible(gSavedSettings.getBOOL("ShowGestureButton")); mIsInLiteMode = true; } @@ -537,10 +539,10 @@ BOOL LLBottomTray::postBuild() mBottomTrayContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gMenuHolder->addChild(mBottomTrayContextMenu); - mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); - LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); + //mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); + //LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); - mListener.reset(new LLNearbyChatBarListener(*mNearbyChatBar)); + //mListener.reset(new LLNearbyChatBarListener(*mNearbyChatBar)); mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel"); mNearbyCharResizeHandlePanel = getChild<LLPanel>("chat_bar_resize_handle_panel"); @@ -577,7 +579,7 @@ BOOL LLBottomTray::postBuild() // Registering Chat Bar to receive Voice client status change notifications. LLVoiceClient::getInstance()->addObserver(this); - mNearbyChatBar->getChatBox()->setContextMenu(NULL); + //mNearbyChatBar->getChatBox()->setContextMenu(NULL); mChicletPanel = getChild<LLChicletPanel>("chiclet_list"); @@ -882,6 +884,7 @@ void LLBottomTray::draw() bool LLBottomTray::onContextMenuItemEnabled(const LLSD& userdata) { std::string item = userdata.asString(); + /* LLLineEditor* edit_box = mNearbyChatBar->findChild<LLLineEditor>("chat_box"); if (item == "can_cut") @@ -903,13 +906,13 @@ bool LLBottomTray::onContextMenuItemEnabled(const LLSD& userdata) else if (item == "can_select_all") { return edit_box->canSelectAll() && (edit_box->getLength()>0); - } + }*/ return true; } void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata) -{ +{/* std::string item = userdata.asString(); LLLineEditor* edit_box = mNearbyChatBar->findChild<LLLineEditor>("chat_box"); @@ -933,7 +936,7 @@ void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata) else if (item == "select_all") { edit_box->selectAll(); - } + }*/ } void LLBottomTray::log(LLView* panel, const std::string& descr) @@ -1096,33 +1099,35 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) if (still_should_be_processed) { processShrinkButtons(delta_width, buttons_freed_width); + still_should_be_processed = delta_width < 0; } + // 3. Decreasing width of nearby chat. const S32 chatbar_panel_min_width = get_panel_min_width(mToolbarStack, mChatBarContainer); const S32 chatbar_panel_width = mChatBarContainer->getRect().getWidth(); if (still_should_be_processed && chatbar_panel_width > chatbar_panel_min_width) { // we have some space to decrease chatbar panel - S32 panel_delta_min = chatbar_panel_width - chatbar_panel_min_width; + S32 chatbar_shrink_headroom = chatbar_panel_width - chatbar_panel_min_width; - S32 delta_panel = llmin(-delta_width, panel_delta_min); + S32 shrink_by = llmin(-delta_width, chatbar_shrink_headroom); // is chatbar panel wide enough to process resizing? - delta_width += panel_delta_min; + delta_width += chatbar_shrink_headroom; still_should_be_processed = delta_width < 0; // chatbar should only be shrunk here, not stretched - if(delta_panel > 0) + if (shrink_by > 0) { - lldebugs << "Shrinking nearby chat bar by " << delta_panel << " px " << llendl; - mChatBarContainer->reshape(mNearbyChatBar->getRect().getWidth() - delta_panel, mChatBarContainer->getRect().getHeight()); + //lldebugs << "Shrinking nearby chat bar by " << delta_panel << " px " << llendl; + //mChatBarContainer->reshape(mNearbyChatBar->getRect().getWidth() - delta_panel, mChatBarContainer->getRect().getHeight()); } log(mNearbyChatBar, "after processing panel decreasing via nearby chatbar panel"); lldebugs << "RS_CHATBAR_INPUT" - << ", delta_panel: " << delta_panel + << ", shrink_by: " << shrink_by << ", delta_width: " << delta_width << llendl; } @@ -1142,8 +1147,8 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) if (buttons_freed_width > 0) { - S32 nearby_needed_width = mDesiredNearbyChatWidth - mNearbyChatBar->getRect().getWidth(); - if (nearby_needed_width > 0) + S32 nearby_needed_width = mDesiredNearbyChatWidth; + if ( 0) { S32 compensative_width = nearby_needed_width > buttons_freed_width ? buttons_freed_width : nearby_needed_width; log(mNearbyChatBar, "before applying compensative width"); @@ -1201,16 +1206,16 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) << ", mDesiredNearbyChatWidth = " << mDesiredNearbyChatWidth << llendl; if (delta_width > 0 && chatbar_panel_width < mDesiredNearbyChatWidth) { - S32 delta_panel_max = mDesiredNearbyChatWidth - chatbar_panel_width; - S32 delta_panel = llmin(delta_width, delta_panel_max); - lldebugs << "Unprocesed delta width: " << delta_width - << ", can be applied to chatbar: " << delta_panel_max - << ", will be applied: " << delta_panel + S32 extend_by_max = mDesiredNearbyChatWidth - chatbar_panel_width; + S32 extend_by = llmin(delta_width, extend_by_max); + lldebugs << "Unprocessed delta width: " << delta_width + << " px, chatbar can be extended by " << extend_by_max + << " px, extending it by " << extend_by << " px" << llendl; - delta_width -= delta_panel_max; - lldebugs << "Extending nearby chat bar by " << delta_panel << " px " << llendl; - mChatBarContainer->reshape(chatbar_panel_width + delta_panel, mChatBarContainer->getRect().getHeight()); + delta_width -= extend_by_max; + lldebugs << "Extending nearby chat bar by " << extend_by << " px " << llendl; + mChatBarContainer->reshape(chatbar_panel_width + extend_by, mChatBarContainer->getRect().getHeight()); log(mNearbyChatBar, "applied unprocessed delta width"); } |