summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorDenis Serdjuk <dserduk@productengine.com>2010-02-04 16:04:28 +0200
committerDenis Serdjuk <dserduk@productengine.com>2010-02-04 16:04:28 +0200
commit8693cf51e5f1645bcb99310700eb530cff5a0373 (patch)
tree8fc19b8b868bff566e310bfa752e36a7238bc6ba /indra/newview/llfavoritesbar.cpp
parent7b62c80060184690ac28d34e4653472179f0cf13 (diff)
fixed critical bug EXT-4887 The Label, \"Favorites Bar\" should only appear if you have no favorites
Changes: Check for empty favbar has been added to change visibility of favbar label --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rw-r--r--indra/newview/llfavoritesbar.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index a5b62439f4..90f6438980 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -34,7 +34,6 @@
#include "llfavoritesbar.h"
-#include "llbutton.h"
#include "llfloaterreg.h"
#include "llfocusmgr.h"
#include "llinventory.h"
@@ -48,7 +47,6 @@
#include "llclipboard.h"
#include "llinventoryclipboard.h"
#include "llinventorybridge.h"
-#include "llinventorymodel.h"
#include "llfloaterworldmap.h"
#include "lllandmarkactions.h"
#include "llnotificationsutil.h"
@@ -674,7 +672,14 @@ void LLFavoritesBarCtrl::updateButtons()
{
return;
}
-
+ if(mItems.empty())
+ {
+ mBarLabel->setVisible(TRUE);
+ }
+ else
+ {
+ mBarLabel->setVisible(FALSE);
+ }
const child_list_t* childs = getChildList();
child_list_const_iter_t child_it = childs->begin();
int first_changed_item_index = 0;
@@ -720,14 +725,22 @@ void LLFavoritesBarCtrl::updateButtons()
}
}
// we have to remove ChevronButton to make sure that the last item will be LandmarkButton to get the right aligning
+ // keep in mind that we are cutting all buttons in space between the last visible child of favbar and ChevronButton
if (mChevronButton->getParent() == this)
{
removeChild(mChevronButton);
}
int last_right_edge = 0;
+ //calculate new buttons offset
if (getChildList()->size() > 0)
{
- last_right_edge = getChildList()->back()->getRect().mRight;
+ //find last visible child to get the rightest button offset
+ child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
+ std::mem_fun(&LLView::getVisible));
+ if(last_visible_it != childs->rend())
+ {
+ last_right_edge = (*last_visible_it)->getRect().mRight;
+ }
}
//last_right_edge is saving coordinates
LLButton* last_new_button = NULL;