summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-09-26 17:38:10 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-09-26 17:38:10 -0700
commit53a486649381af53d21de28aced388bc2aacac0f (patch)
tree9b7378da2c05e9dbd0c7a594b12d242e87ddf0dd /indra/newview
parentbb1776de6865715b2dd96185140d35e46d63c837 (diff)
EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars
* Command buttons are now enabled/disabled in toybox based on whether or not the LLToolBarView has them anywhere. * Commands now have argument to specify whether or not they should be in the toybox. * LLCommandId is now used a universal reference for commands. Reviewed by Richard.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/commands.xml23
-rw-r--r--indra/newview/llfloatertoybox.cpp9
-rw-r--r--indra/newview/skins/default/xui/en/floater_toybox.xml21
3 files changed, 42 insertions, 11 deletions
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index dbb0e8b7ca..4a33b24075 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<commands>
<command name="avatar"
+ available_in_toybox="true"
icon="Command_Avatar_Icon"
label_ref="Command_Avatar_Label"
tooltip_ref="Command_Avatar_Tooltip"
@@ -8,6 +9,7 @@
param="avatar"
/>
<command name="build"
+ available_in_toybox="true"
icon="Command_Build_Icon"
label_ref="Command_Build_Label"
tooltip_ref="Command_Build_Tooltip"
@@ -15,22 +17,23 @@
param="build"
/>
<command name="chat"
+ available_in_toybox="true"
icon="Command_Chat_Icon"
label_ref="Command_Chat_Label"
tooltip_ref="Command_Chat_Tooltip"
function="Floater.ToolbarToggle"
param="chat"
/>
- <!-- Compass it not supported by the viewer yet
<command name="compass"
+ available_in_toybox="false"
icon="Command_Compass_Icon"
label_ref="Command_Compass_Label"
tooltip_ref="Command_Compass_Tooltip"
function="Floater.ToolbarToggle"
param="compass"
/>
- -->
<command name="gestures"
+ available_in_toybox="true"
icon="Command_Gestures_Icon"
label_ref="Command_Gestures_Label"
tooltip_ref="Command_Gestures_Tooltip"
@@ -38,6 +41,7 @@
param="gestures"
/>
<command name="howto"
+ available_in_toybox="true"
icon="Command_HowTo_Icon"
label_ref="Command_HowTo_Label"
tooltip_ref="Command_HowTo_Tooltip"
@@ -45,6 +49,7 @@
param="howto"
/>
<command name="landmarks"
+ available_in_toybox="true"
icon="Command_Landmarks_Icon"
label_ref="Command_Landmarks_Label"
tooltip_ref="Command_Landmarks_Tooltip"
@@ -52,6 +57,7 @@
param="landmarks"
/>
<command name="map"
+ available_in_toybox="true"
icon="Command_Map_Icon"
label_ref="Command_Map_Label"
tooltip_ref="Command_Map_Tooltip"
@@ -59,6 +65,7 @@
param="map"
/>
<command name="minimap"
+ available_in_toybox="true"
icon="Command_MiniMap_Icon"
label_ref="Command_MiniMap_Label"
tooltip_ref="Command_MiniMap_Tooltip"
@@ -66,6 +73,7 @@
param="minimap"
/>
<command name="move"
+ available_in_toybox="true"
icon="Command_Move_Icon"
label_ref="Command_Move_Label"
tooltip_ref="Command_Move_Tooltip"
@@ -73,6 +81,7 @@
param="move"
/>
<command name="myland"
+ available_in_toybox="true"
icon="Command_MyLand_Icon"
label_ref="Command_MyLand_Label"
tooltip_ref="Command_MyLand_Tooltip"
@@ -80,6 +89,7 @@
param="myland"
/>
<command name="mystuff"
+ available_in_toybox="true"
icon="Command_MyStuff_Icon"
label_ref="Command_MyStuff_Label"
tooltip_ref="Command_MyStuff_Tooltip"
@@ -87,6 +97,7 @@
param="mystuff"
/>
<command name="people"
+ available_in_toybox="true"
icon="Command_People_Icon"
label_ref="Command_People_Label"
tooltip_ref="Command_People_Tooltip"
@@ -94,6 +105,7 @@
param="people"
/>
<command name="places"
+ available_in_toybox="true"
icon="Command_Places_Icon"
label_ref="Command_Places_Label"
tooltip_ref="Command_Places_Tooltip"
@@ -101,6 +113,7 @@
param="places"
/>
<command name="search"
+ available_in_toybox="true"
icon="Command_Search_Icon"
label_ref="Command_Search_Label"
tooltip_ref="Command_Search_Tooltip"
@@ -108,6 +121,7 @@
param="search"
/>
<command name="settings"
+ available_in_toybox="true"
icon="Command_Settings_Icon"
label_ref="Command_Settings_Label"
tooltip_ref="Command_Settings_Tooltip"
@@ -115,6 +129,7 @@
param="settings"
/>
<command name="shop"
+ available_in_toybox="true"
icon="Command_Shop_Icon"
label_ref="Command_Shop_Label"
tooltip_ref="Command_Shop_Tooltip"
@@ -122,6 +137,7 @@
param="shop"
/>
<command name="snapshot"
+ available_in_toybox="true"
icon="Command_Snapshot_Icon"
label_ref="Command_Snapshot_Label"
tooltip_ref="Command_Snapshot_Tooltip"
@@ -129,6 +145,7 @@
param="snapshot"
/>
<command name="speak"
+ available_in_toybox="true"
icon="Command_Speak_Icon"
label_ref="Command_Speak_Label"
tooltip_ref="Command_Speak_Tooltip"
@@ -136,6 +153,7 @@
param="speak"
/>
<command name="upload"
+ available_in_toybox="true"
icon="Command_Upload_Icon"
label_ref="Command_Upload_Label"
tooltip_ref="Command_Upload_Tooltip"
@@ -143,6 +161,7 @@
param="upload"
/>
<command name="view"
+ available_in_toybox="true"
icon="Command_View_Icon"
label_ref="Command_View_Label"
tooltip_ref="Command_View_Tooltip"
diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp
index eaaaeb3357..beb928ea36 100644
--- a/indra/newview/llfloatertoybox.cpp
+++ b/indra/newview/llfloatertoybox.cpp
@@ -32,6 +32,7 @@
#include "llcommandmanager.h"
#include "llpanel.h"
#include "lltoolbar.h"
+#include "lltoolbarview.h"
LLFloaterToybox::LLFloaterToybox(const LLSD& key)
@@ -63,7 +64,13 @@ BOOL LLFloaterToybox::postBuild()
{
LLCommand * command = cmdMgr.getCommand(i);
- mToolBar->addCommand(command);
+ if (command->availableInToybox())
+ {
+ mToolBar->addCommand(command->id());
+
+ llassert(gToolBarView != NULL);
+ mToolBar->enableCommand(command->id(), !gToolBarView->hasCommand(command->id()));
+ }
}
return TRUE;
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index 1c9f20c496..60a39b0bff 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -14,17 +14,17 @@
save_rect="true"
single_instance="true"
title="Customize toolbars"
- width="658">
+ width="650">
<text
follows="left|top"
font="SansSerifMedium"
halign="left"
height="20"
layout="topleft"
- left="40"
+ left="20"
length="1"
name="toybox label 1"
- right="-40"
+ right="-20"
top="35"
type="string">
Add or remove buttons by dragging them to or from the toolbars.
@@ -35,10 +35,10 @@
halign="left"
height="20"
layout="topleft"
- left="40"
+ left="20"
length="1"
name="toybox label 2"
- right="-40"
+ right="-20"
top="55"
type="string">
Buttons will appear as shown or as icon-only depending on each toolbar's settings.
@@ -46,12 +46,17 @@
<toolbar
bottom="395"
button_display_mode="icons_with_text"
- left="40"
+ left="20"
max_button_width="140"
min_button_width="70"
name="toybox_toolbar"
+ pad_left="5"
+ pad_right="5"
+ pad_top="5"
+ pad_bottom="5"
+ pad_between="15"
read_only="true"
- right="-40"
+ right="-20"
side="top"
top="85">
</toolbar>
@@ -61,7 +66,7 @@
label="Restore defaults"
label_selected="Restore defaults"
layout="topleft"
- left="40"
+ left="20"
name="btn_restore_defaults"
top="415"
width="130">