summaryrefslogtreecommitdiff
path: root/indra/newview/llbottomtray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llbottomtray.cpp')
-rw-r--r--indra/newview/llbottomtray.cpp69
1 files changed, 37 insertions, 32 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 79e6c7b66b..55c63edd74 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -165,13 +165,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");
@@ -201,7 +201,8 @@ public:
};
LLBottomTray::LLBottomTray(const LLSD&)
-: mChicletPanel(NULL),
+: mDesiredNearbyChatWidth(0),
+ mChicletPanel(NULL),
mSpeakPanel(NULL),
mSpeakBtn(NULL),
mNearbyChatBar(NULL),
@@ -223,7 +224,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");
@@ -270,7 +271,8 @@ LLBottomTray::~LLBottomTray()
// *TODO Vadim: why void* ?
void* LLBottomTray::createNearbyChatBar(void* userdata)
{
- return new LLNearbyChatBar();
+ //return new LLNearbyChatBar();
+ return NULL;
}
LLNearbyChatBar* LLBottomTray::getNearbyChatBar()
@@ -398,7 +400,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);
}
@@ -411,8 +413,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;
}
@@ -536,10 +538,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");
@@ -576,7 +578,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");
@@ -881,6 +883,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")
@@ -902,13 +905,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");
@@ -932,7 +935,7 @@ void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata)
else if (item == "select_all")
{
edit_box->selectAll();
- }
+ }*/
}
void LLBottomTray::log(LLView* panel, const std::string& descr)
@@ -1095,33 +1098,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;
}
@@ -1141,8 +1146,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");
@@ -1200,16 +1205,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");
}