summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-09-29 15:01:15 -0700
committerMerov Linden <merov@lindenlab.com>2011-09-29 15:01:15 -0700
commitb07e7c7198fbc78ca852b3ba48d516ec2901da21 (patch)
treeb7b2323439e2d3e5d32ce69c43540d1b38e454d3 /indra/llui/lltoolbar.cpp
parent71ed326f51770b215ba5dd2ac8d159c3b764c2d2 (diff)
EXP-1211, EXP-1257 : Save and load the button type along with the toolbars, add a force default load option, enforce consistency between menus and toolbars
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 45567d5859..75c7d91f8a 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -213,6 +213,14 @@ bool LLToolBar::addCommand(const LLCommandId& commandId)
return add_command;
}
+void LLToolBar::clearCommandsList()
+{
+ // Clears the commands list
+ mButtonCommands.clear();
+ // This will clear the buttons
+ createButtons();
+}
+
bool LLToolBar::hasCommand(const LLCommandId& commandId) const
{
bool has_command = false;
@@ -278,7 +286,7 @@ BOOL LLToolBar::isSettingChecked(const LLSD& userdata)
const std::string setting_name = userdata.asString();
- if (setting_name == "icons_and_labels")
+ if (setting_name == "icons_with_text")
{
retval = (mButtonType == BTNTYPE_ICONS_WITH_TEXT);
}
@@ -296,18 +304,23 @@ void LLToolBar::onSettingEnable(const LLSD& userdata)
const std::string setting_name = userdata.asString();
- const ButtonType current_button_type = mButtonType;
-
- if (setting_name == "icons_and_labels")
+ if (setting_name == "icons_with_text")
{
- mButtonType = BTNTYPE_ICONS_WITH_TEXT;
+ setButtonType(BTNTYPE_ICONS_WITH_TEXT);
}
else if (setting_name == "icons_only")
{
- mButtonType = BTNTYPE_ICONS_ONLY;
+ setButtonType(BTNTYPE_ICONS_ONLY);
}
+}
- if(current_button_type != mButtonType)
+void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type)
+{
+ bool regenerate_buttons = (mButtonType != button_type);
+
+ mButtonType = button_type;
+
+ if (regenerate_buttons)
{
createButtons();
}