diff options
author | Andrew Polunin <apolunin@productengine.com> | 2010-07-06 17:30:20 +0300 |
---|---|---|
committer | Andrew Polunin <apolunin@productengine.com> | 2010-07-06 17:30:20 +0300 |
commit | 3e7af3244f20f64b2d1c5ebc8d9f1fa616bee104 (patch) | |
tree | 23efb172d1afd6a67a9d2c70fc0a6ba639bd4b51 /indra/newview/llnavigationbar.cpp | |
parent | 38d54c07508ece7c08a0cc14e9da4706b3f7ef16 (diff) |
EXT-7536 FIXED (Favorites bar and Navigation bar looks similar to the mock-up)
- Added constant FAVBAR_TOP_PADDING in the LLNavigationBar which defines the distance between navigation panel and favorites panel in pixels.
- Added new image NavBar_BG_NoFav_Bevel which is used to show navigation panel with favorites bar hidden. It is required to show navigation panel with bevel at the bottom.
- Added new image NavBar_BG_NoNav_Bevel which is used to show favorites panel with navigation panel hidden. It is required to show favorites panel with bevel at the top.
- Removed image NavBar_BG_NoFav. It is not used anymore.
- Modified the methods showNavigationPanel and showFavoritesPanel to take into account that distance.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/664/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llnavigationbar.cpp')
-rw-r--r-- | indra/newview/llnavigationbar.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index fce666c9d4..67295179b2 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -776,7 +776,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) { // Navigation Panel must be shown. Favorites Panel is hidden. - S32 height = mDefaultNbRect.getHeight() - mDefaultFpRect.getHeight(); + S32 height = mDefaultNbRect.getHeight() - mDefaultFpRect.getHeight() - FAVBAR_TOP_PADDING; nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), height); reshape(nbRect.getWidth(), nbRect.getHeight()); @@ -790,8 +790,11 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) { // Navigation Panel must be hidden. Favorites Panel is visible. - nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fbRect.getHeight()); - fbRect.setLeftTopAndSize(fbRect.mLeft, fbRect.getHeight(), fbRect.getWidth(), fbRect.getHeight()); + S32 fpHeight = mDefaultFpRect.getHeight() + FAVBAR_TOP_PADDING; + S32 fpTop = fpHeight - (mDefaultFpRect.getHeight() / 2) + 1; + + nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fpHeight); + fbRect.setLeftTopAndSize(fbRect.mLeft, fpTop, fbRect.getWidth(), mDefaultFpRect.getHeight()); // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); @@ -813,8 +816,9 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) } } - childSetVisible("bg_icon", fpVisible); - childSetVisible("bg_icon_no_fav", !fpVisible); + childSetVisible("bg_icon", visible && fpVisible); + childSetVisible("bg_icon_no_fav_bevel", visible && !fpVisible); + childSetVisible("bg_icon_no_nav_bevel", !visible && fpVisible); } void LLNavigationBar::showFavoritesPanel(BOOL visible) @@ -833,7 +837,7 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) // Favorites Panel must be shown. Navigation Panel is visible. S32 fbHeight = fbRect.getHeight(); - S32 newHeight = nbRect.getHeight() + fbHeight; + S32 newHeight = nbRect.getHeight() + fbHeight + FAVBAR_TOP_PADDING; nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), newHeight); fbRect.setLeftTopAndSize(mDefaultFpRect.mLeft, mDefaultFpRect.mTop, fbRect.getWidth(), fbRect.getHeight()); @@ -842,9 +846,11 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) { // Favorites Panel must be shown. Navigation Panel is hidden. - S32 fpHeight = mDefaultFpRect.getHeight(); + S32 fpHeight = mDefaultFpRect.getHeight() + FAVBAR_TOP_PADDING; + S32 fpTop = fpHeight - (mDefaultFpRect.getHeight() / 2) + 1; + nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fpHeight); - fbRect.setLeftTopAndSize(fbRect.mLeft, fpHeight, fbRect.getWidth(), fpHeight); + fbRect.setLeftTopAndSize(fbRect.mLeft, fpTop, fbRect.getWidth(), mDefaultFpRect.getHeight()); } reshape(nbRect.getWidth(), nbRect.getHeight()); @@ -861,7 +867,7 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) // Favorites Panel must be hidden. Navigation Panel is visible. S32 fbHeight = fbRect.getHeight(); - S32 newHeight = nbRect.getHeight() - fbHeight; + S32 newHeight = nbRect.getHeight() - fbHeight - FAVBAR_TOP_PADDING; nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), newHeight); } @@ -877,8 +883,9 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } - childSetVisible("bg_icon", visible); - childSetVisible("bg_icon_no_fav", !visible); + childSetVisible("bg_icon", npVisible && visible); + childSetVisible("bg_icon_no_fav_bevel", npVisible && !visible); + childSetVisible("bg_icon_no_nav_bevel", !npVisible && visible); fb->setVisible(visible); } |