From 3e7af3244f20f64b2d1c5ebc8d9f1fa616bee104 Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Tue, 6 Jul 2010 17:30:20 +0300 Subject: 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 --- indra/newview/llnavigationbar.cpp | 29 +++++++++++++-------- indra/newview/llnavigationbar.h | 2 ++ .../textures/navbar/NavBar_BG_NoFav_Bevel.png | Bin 0 -> 231 bytes .../textures/navbar/NavBar_BG_NoNav_Bevel.png | Bin 0 -> 218 bytes indra/newview/skins/default/textures/textures.xml | 4 +-- .../skins/default/xui/en/panel_navigation_bar.xml | 17 +++++++++--- 6 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png create mode 100644 indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png (limited to 'indra') 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); } diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index 03f17af09b..d21d86456e 100644 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -111,6 +111,8 @@ public: int getDefFavBarHeight(); private: + // the distance between navigation panel and favorites panel in pixels + const static S32 FAVBAR_TOP_PADDING = 10; void rebuildTeleportHistoryMenu(); void showTeleportHistoryMenu(LLUICtrl* btn_ctrl); diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png new file mode 100644 index 0000000000..a79d999932 Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png differ diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png new file mode 100644 index 0000000000..b692ed92da Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 40e882757f..082b37d80b 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -276,9 +276,9 @@ with the same filename but different name - - + + diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 00b1fdd843..2c9d7e4b6a 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -22,14 +22,25 @@ width="600"/> +