Skip to content
Snippets Groups Projects
Commit 2b5f45c1 authored by Eugene Mutavchi's avatar Eugene Mutavchi
Browse files

Fixed normal bug EXT-4309 (Gesture button is too wide in the mouse look mode):...

Fixed normal bug EXT-4309 (Gesture button is too wide in the mouse look mode): added hack that avoid usage of the LLLayoutStack resizing logic on mouse look mode switching.

--HG--
branch : product-engine
parent 49f246a4
Branches
Tags
No related merge requests found
...@@ -93,6 +93,8 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack> ...@@ -93,6 +93,8 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
void updateLayout(BOOL force_resize = FALSE); void updateLayout(BOOL force_resize = FALSE);
S32 getPanelSpacing() const { return mPanelSpacing; } S32 getPanelSpacing() const { return mPanelSpacing; }
BOOL getAnimate () const { return mAnimate; }
void setAnimate (BOOL animate) { mAnimate = animate; }
static void updateClass(); static void updateClass();
......
...@@ -2806,6 +2806,7 @@ void LLAgent::endAnimationUpdateUI() ...@@ -2806,6 +2806,7 @@ void LLAgent::endAnimationUpdateUI()
gStatusBar->setVisibleForMouselook(true); gStatusBar->setVisibleForMouselook(true);
LLBottomTray::getInstance()->setVisible(TRUE); LLBottomTray::getInstance()->setVisible(TRUE);
LLBottomTray::getInstance()->onMouselookModeOut();
LLSideTray::getInstance()->getButtonsPanel()->setVisible(TRUE); LLSideTray::getInstance()->getButtonsPanel()->setVisible(TRUE);
LLSideTray::getInstance()->updateSidetrayVisibility(); LLSideTray::getInstance()->updateSidetrayVisibility();
...@@ -2904,6 +2905,7 @@ void LLAgent::endAnimationUpdateUI() ...@@ -2904,6 +2905,7 @@ void LLAgent::endAnimationUpdateUI()
LLNavigationBar::getInstance()->setVisible(FALSE); LLNavigationBar::getInstance()->setVisible(FALSE);
gStatusBar->setVisibleForMouselook(false); gStatusBar->setVisibleForMouselook(false);
LLBottomTray::getInstance()->onMouselookModeIn();
LLBottomTray::getInstance()->setVisible(FALSE); LLBottomTray::getInstance()->setVisible(FALSE);
LLSideTray::getInstance()->getButtonsPanel()->setVisible(FALSE); LLSideTray::getInstance()->getButtonsPanel()->setVisible(FALSE);
......
...@@ -52,6 +52,15 @@ ...@@ -52,6 +52,15 @@
// Build time optimization, generate extern template once in .cpp file // Build time optimization, generate extern template once in .cpp file
template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance(); template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
namespace
{
const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel";
const std::string& PANEL_CHATBAR_NAME = "chat_bar";
const std::string& PANEL_MOVEMENT_NAME = "movement_panel";
const std::string& PANEL_CAMERA_NAME = "cam_panel";
const std::string& PANEL_GESTURE_NAME = "gesture_panel";
}
LLBottomTray::LLBottomTray(const LLSD&) LLBottomTray::LLBottomTray(const LLSD&)
: mChicletPanel(NULL), : mChicletPanel(NULL),
mSpeakPanel(NULL), mSpeakPanel(NULL),
...@@ -236,6 +245,57 @@ void LLBottomTray::onFocusLost() ...@@ -236,6 +245,57 @@ void LLBottomTray::onFocusLost()
} }
} }
void LLBottomTray::savePanelsShape()
{
mSavedShapeList.clear();
for (child_list_const_iter_t
child_it = mToolbarStack->beginChild(),
child_it_end = mToolbarStack->endChild();
child_it != child_it_end; ++child_it)
{
mSavedShapeList.push_back( (*child_it)->getRect() );
}
}
void LLBottomTray::restorePanelsShape()
{
if (mSavedShapeList.size() != mToolbarStack->getChildCount())
return;
int i = 0;
for (child_list_const_iter_t
child_it = mToolbarStack->beginChild(),
child_it_end = mToolbarStack->endChild();
child_it != child_it_end; ++child_it)
{
(*child_it)->setShape(mSavedShapeList[i++]);
}
}
void LLBottomTray::onMouselookModeOut()
{
// Apply the saved settings when we are not in mouselook mode, see EXT-3988.
{
setTrayButtonVisibleIfPossible (RS_BUTTON_GESTURES, gSavedSettings.getBOOL("ShowGestureButton"), false);
setTrayButtonVisibleIfPossible (RS_BUTTON_MOVEMENT, gSavedSettings.getBOOL("ShowMoveButton"), false);
setTrayButtonVisibleIfPossible (RS_BUTTON_CAMERA, gSavedSettings.getBOOL("ShowCameraButton"), false);
setTrayButtonVisibleIfPossible (RS_BUTTON_SNAPSHOT, gSavedSettings.getBOOL("ShowSnapshotButton"),false);
}
// HACK: To avoid usage the LLLayoutStack logic of resizing, we force the updateLayout
// and then restore children saved shapes. See EXT-4309.
BOOL saved_anim = mToolbarStack->getAnimate();
mToolbarStack->updatePanelAutoResize(PANEL_CHATBAR_NAME, FALSE);
mToolbarStack->setAnimate(FALSE);
mToolbarStack->updateLayout();
mToolbarStack->setAnimate(saved_anim);
restorePanelsShape();
}
void LLBottomTray::onMouselookModeIn()
{
savePanelsShape();
mToolbarStack->updatePanelAutoResize(PANEL_CHATBAR_NAME, TRUE);
}
//virtual //virtual
// setVisible used instead of onVisibilityChange, since LLAgent calls it on entering/leaving mouselook mode. // setVisible used instead of onVisibilityChange, since LLAgent calls it on entering/leaving mouselook mode.
// If bottom tray is already visible in mouselook mode, then onVisibilityChange will not be called from setVisible(true), // If bottom tray is already visible in mouselook mode, then onVisibilityChange will not be called from setVisible(true),
...@@ -255,23 +315,15 @@ void LLBottomTray::setVisible(BOOL visible) ...@@ -255,23 +315,15 @@ void LLBottomTray::setVisible(BOOL visible)
LLView* viewp = *child_it; LLView* viewp = *child_it;
std::string name = viewp->getName(); std::string name = viewp->getName();
// Chat bar and gesture button are shown even in mouselook mode. But the move, camera and snapshot buttons shouldn't be displayed. See EXT-3988. // Chat bar and gesture button are shown even in mouselook mode.
if ("chat_bar" == name || "gesture_panel" == name || (visibility && ("movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name))) // But the move, camera and snapshot buttons shouldn't be displayed. See EXT-3988.
if ("chat_bar" == name || "gesture_panel" == name)
continue; continue;
else else
{ {
viewp->setVisible(visibility); viewp->setVisible(visibility);
} }
} }
// Apply the saved settings when we are not in mouselook mode, see EXT-3988.
if (visibility)
{
showCameraButton(gSavedSettings.getBOOL("ShowCameraButton"));
showSnapshotButton(gSavedSettings.getBOOL("ShowSnapshotButton"));
showMoveButton(gSavedSettings.getBOOL("ShowMoveButton"));
showGestureButton(gSavedSettings.getBOOL("ShowGestureButton"));
}
} }
} }
...@@ -337,15 +389,6 @@ void LLBottomTray::showSnapshotButton(BOOL visible) ...@@ -337,15 +389,6 @@ void LLBottomTray::showSnapshotButton(BOOL visible)
setTrayButtonVisibleIfPossible(RS_BUTTON_SNAPSHOT, visible); setTrayButtonVisibleIfPossible(RS_BUTTON_SNAPSHOT, visible);
} }
namespace
{
const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel";
const std::string& PANEL_CHATBAR_NAME = "chat_bar";
const std::string& PANEL_MOVEMENT_NAME = "movement_panel";
const std::string& PANEL_CAMERA_NAME = "cam_panel";
const std::string& PANEL_GESTURE_NAME = "gesture_panel";
}
BOOL LLBottomTray::postBuild() BOOL LLBottomTray::postBuild()
{ {
...@@ -1018,7 +1061,7 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis ...@@ -1018,7 +1061,7 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis
panel->setVisible(visible); panel->setVisible(visible);
} }
void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible) void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification)
{ {
bool can_be_set = true; bool can_be_set = true;
...@@ -1058,6 +1101,7 @@ void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type ...@@ -1058,6 +1101,7 @@ void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type
{ {
// mark this button to show it while future bottom tray extending // mark this button to show it while future bottom tray extending
mResizeState |= shown_object_type; mResizeState |= shown_object_type;
if ( raise_notification )
LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown"); LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown");
} }
} }
......
...@@ -93,6 +93,9 @@ class LLBottomTray ...@@ -93,6 +93,9 @@ class LLBottomTray
void showCameraButton(BOOL visible); void showCameraButton(BOOL visible);
void showSnapshotButton(BOOL visible); void showSnapshotButton(BOOL visible);
void onMouselookModeIn();
void onMouselookModeOut();
/** /**
* Creates IM Chiclet based on session type (IM chat or Group chat) * Creates IM Chiclet based on session type (IM chat or Group chat)
*/ */
...@@ -167,7 +170,14 @@ class LLBottomTray ...@@ -167,7 +170,14 @@ class LLBottomTray
* - if hidden via context menu button should be shown but there is no enough room for now * - if hidden via context menu button should be shown but there is no enough room for now
* it will be shown while extending. * it will be shown while extending.
*/ */
void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible); void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification = true);
/**
* Save and restore children shapes.
* Used to avoid the LLLayoutStack resizing logic between mouse look mode switching.
*/
void savePanelsShape();
void restorePanelsShape();
MASK mResizeState; MASK mResizeState;
...@@ -177,6 +187,9 @@ class LLBottomTray ...@@ -177,6 +187,9 @@ class LLBottomTray
typedef std::map<EResizeState, S32> state_object_width_map_t; typedef std::map<EResizeState, S32> state_object_width_map_t;
state_object_width_map_t mObjectDefaultWidthMap; state_object_width_map_t mObjectDefaultWidthMap;
typedef std::vector<LLRect> shape_list_t;
shape_list_t mSavedShapeList;
protected: protected:
LLBottomTray(const LLSD& key = LLSD()); LLBottomTray(const LLSD& key = LLSD());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment