summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llmenugl.cpp9
-rw-r--r--indra/newview/llfavoritesbar.cpp73
-rw-r--r--indra/newview/llfavoritesbar.h6
-rw-r--r--indra/newview/llfloaterpreference.cpp7
-rw-r--r--indra/newview/skins/default/xui/en/panel_navigation_bar.xml29
5 files changed, 49 insertions, 75 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index f8935d03ac..907f2352a0 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -590,12 +590,13 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask)
LLMenuGL* parent_menu = getMenu();
if (y > getRect().getHeight() / 2)
{
- LLView* prev_menu_item = parent_menu->findPrevSibling(this);
+ // the menu items are in the child list in bottom up order
+ LLView* prev_menu_item = parent_menu->findNextSibling(this);
return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
}
else
{
- LLView* next_menu_item = parent_menu->findNextSibling(this);
+ LLView* next_menu_item = parent_menu->findPrevSibling(this);
return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE;
}
}
@@ -605,12 +606,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask)
LLMenuGL* parent_menu = getMenu();
if (y > getRect().getHeight() / 2)
{
- LLView* prev_menu_item = parent_menu->findPrevSibling(this);
+ LLView* prev_menu_item = parent_menu->findNextSibling(this);
return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;
}
else
{
- LLView* next_menu_item = parent_menu->findNextSibling(this);
+ LLView* next_menu_item = parent_menu->findPrevSibling(this);
return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE;
}
}
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 8406ddeeca..17b0710813 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -355,8 +355,8 @@ struct LLFavoritesSort
};
LLFavoritesBarCtrl::Params::Params()
-: chevron_button_tool_tip("chevron_button_tool_tip"),
- image_drag_indication("image_drag_indication")
+: image_drag_indication("image_drag_indication"),
+ chevron_button("chevron_button")
{
}
@@ -365,7 +365,6 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()),
mPopupMenuHandle(),
mInventoryItemsPopupMenuHandle(),
- mChevronButtonToolTip(p.chevron_button_tool_tip),
mImageDragIndication(p.image_drag_indication),
mShowDragMarker(FALSE),
mLandingTab(NULL),
@@ -381,6 +380,12 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
boost::bind(&LLFavoritesBarCtrl::enableSelected, this, _2));
gInventory.addObserver(this);
+
+ //make chevron button
+ LLButton::Params chevron_button_params(p.chevron_button);
+ chevron_button_params.click_callback.function(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this));
+ mChevronButton = LLUICtrlFactory::create<LLButton> (chevron_button_params);
+ addChild(mChevronButton);
}
LLFavoritesBarCtrl::~LLFavoritesBarCtrl()
@@ -653,10 +658,6 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width)
buttonXMLNode->getAttributeS32("left", buttonHGap);
S32 count = mItems.count();
-
- const S32 buttonHPad = LLUI::sSettingGroups["config"]->getS32("ButtonHPad");
- const S32 chevron_button_width = mFont->getWidth(">>") + buttonHPad * 2;
-
S32 buttons_space = bar_width - buttonHGap;
S32 first_drop_down_item = count;
@@ -670,7 +671,7 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width)
{
// There is no space for all buttons.
// Calculating the number of buttons, that are fit with chevron button
- buttons_space -= chevron_button_width + buttonHGap;
+ buttons_space -= mChevronButton->getRect().getWidth() + buttonHGap;
while (i >= 0 && buttons_width > buttons_space)
{
buttons_width -= buttonWidth + buttonHGap;
@@ -718,7 +719,7 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width)
child_list_const_iter_t cur_it = child_it++;
LLView* viewp = *cur_it;
LLButton* button = dynamic_cast<LLButton*>(viewp);
- if (button)
+ if (button && (button != mChevronButton))
{
removeChild(button);
delete button;
@@ -732,55 +733,15 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width)
if (mFirstDropDownItem != count)
{
// Chevron button should stay right aligned
- LLView *chevron_button = findChildView(std::string(">>"), FALSE);
- if (chevron_button)
- {
- LLRect rect;
- rect.setOriginAndSize(bar_width - chevron_button_width - buttonHGap, 0, chevron_button_width, getRect().getHeight());
- chevron_button->setRect(rect);
- chevron_button->setVisible(TRUE);
- mChevronRect = rect;
- }
- else
- {
- static LLButton::Params default_button_params(LLUICtrlFactory::getDefaultParams<LLButton>());
- std::string flat_icon = "transparent.j2c";
- std::string hover_icon = default_button_params.image_unselected.name;
- std::string hover_icon_selected = default_button_params.image_selected.name;
-
- LLButton::Params bparams;
-
- LLRect rect;
- rect.setOriginAndSize(bar_width - chevron_button_width - buttonHGap, 0, chevron_button_width, getRect().getHeight());
-
- bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_BOTTOM);
- bparams.image_unselected.name(flat_icon);
- bparams.image_disabled.name(flat_icon);
- bparams.image_selected.name(hover_icon_selected);
- bparams.image_hover_selected.name(hover_icon_selected);
- bparams.image_disabled_selected.name(hover_icon_selected);
- bparams.image_hover_unselected.name(hover_icon);
- bparams.rect (rect);
- bparams.tab_stop(false);
- bparams.font(mFont);
- bparams.name(">>");
- bparams.label(">>");
- bparams.tool_tip(mChevronButtonToolTip);
- bparams.click_callback.function(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this));
-
- addChildInBack(LLUICtrlFactory::create<LLButton> (bparams));
-
- mChevronRect = rect;
- }
+ LLRect rect;
+ rect.setOriginAndSize(bar_width - mChevronButton->getRect().getWidth() - buttonHGap, 0, mChevronButton->getRect().getWidth(), mChevronButton->getRect().getHeight());
+ mChevronButton->setRect(rect);
+ mChevronButton->setVisible(TRUE);
}
else
{
// Hide chevron button if all items are visible on bar
- LLView *chevron_button = findChildView(std::string(">>"), FALSE);
- if (chevron_button)
- {
- chevron_button->setVisible(FALSE);
- }
+ mChevronButton->setVisible(FALSE);
}
}
@@ -917,7 +878,7 @@ void LLFavoritesBarCtrl::showDropDownMenu()
if (menu->getButtonRect().isEmpty())
{
- menu->setButtonRect(mChevronRect, this);
+ menu->setButtonRect(mChevronButton->getRect(), this);
}
LLMenuGL::showPopup(this, menu, getRect().getWidth() - menu->getRect().getWidth(), 0);
@@ -981,7 +942,7 @@ void LLFavoritesBarCtrl::showDropDownMenu()
menu->buildDrawLabels();
menu->updateParent(LLMenuGL::sMenuContainer);
- menu->setButtonRect(mChevronRect, this);
+ menu->setButtonRect(mChevronButton->getRect(), this);
LLMenuGL::showPopup(this, menu, getRect().getWidth() - max_width, 0);
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 20a324c67c..b2fe3cc651 100644
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -33,6 +33,7 @@
#ifndef LL_LLFAVORITESBARCTRL_H
#define LL_LLFAVORITESBARCTRL_H
+#include "llbutton.h"
#include "lluictrl.h"
#include "llinventoryobserver.h"
@@ -43,8 +44,8 @@ class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
- Optional<std::string> chevron_button_tool_tip;
Optional<LLUIImage*> image_drag_indication;
+ Optional<LLButton::Params> chevron_button;
Params();
};
@@ -105,9 +106,7 @@ protected:
item_names_array_t mItemNamesCache;
LLUUID mSelectedItemID;
- LLRect mChevronRect;
- std::string mChevronButtonToolTip;
LLUIImage* mImageDragIndication;
private:
@@ -150,6 +149,7 @@ private:
BOOL mShowDragMarker;
LLUICtrl* mLandingTab;
LLUICtrl* mLastTab;
+ LLButton* mChevronButton;
LLUUID mDragItemId;
BOOL mStartDrag;
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 83c784c1f7..a6ecb4c127 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -367,6 +367,10 @@ BOOL LLFloaterPreference::postBuild()
tabcontainer->selectFirstTab();
S32 show_avatar_nametag_options = gSavedSettings.getS32("AvatarNameTagMode");
handleNameTagOptionChanged(LLSD(show_avatar_nametag_options));
+
+ std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
+ childSetText("cache_location", cache_location);
+
return TRUE;
}
@@ -760,8 +764,9 @@ void LLFloaterPreference::onClickResetCache()
{
gSavedSettings.setString("NewCacheLocation", "");
gSavedSettings.setString("NewCacheLocationTopFolder", "");
- LLNotificationsUtil::add("CacheWillBeMoved");
}
+
+ LLNotificationsUtil::add("CacheWillBeMoved");
std::string cache_location = gDirUtilp->getCacheDir(true);
gSavedSettings.setString("CacheLocation", cache_location);
std::string top_folder(gDirUtilp->getBaseFileName(cache_location));
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 bf33b752d9..e8f1ad85f9 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -146,15 +146,22 @@
name="search_combo_editor"/>
</search_combo_box>
</panel>
-
- <favorites_bar
- follows="left|right|top"
- height="15"
- layout="topleft"
- left="0"
- name="favorite"
- image_drag_indication="Arrow_Down"
- chevron_button_tool_tip="Show more of My Favorites"
- bottom="62"
- width="590" />
+ <favorites_bar
+ follows="left|right|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="favorite"
+ image_drag_indication="Arrow_Down"
+ bottom="62"
+ width="590">
+ <chevron_button name=">>"
+ image_unselected="TabIcon_Close_Off"
+ image_selected="TabIcon_Close_Off"
+ tab_stop="false"
+ follows="left|bottom"
+ tool_tip="Show more of My Favorites"
+ width="15"
+ height="15"/>
+ </favorites_bar>
</panel>