summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltoolbar.cpp29
-rw-r--r--indra/llui/lltoolbar.h1
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml316
3 files changed, 188 insertions, 158 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index e67e18872c..7fcd1da7b1 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -418,6 +418,7 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
while (it_button != end_button)
{
button_rect = (*it_button)->getRect();
+ mDragCommand = (*it_button)->mId;
S32 point_x, point_y;
if (orientation == LLLayoutStack::HORIZONTAL)
{
@@ -436,7 +437,6 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
{
break;
}
- mDragCommand = (*it_button)->mId;
rank++;
++it_button;
}
@@ -480,6 +480,27 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
return rank;
}
+int LLToolBar::getRankFromPosition(const LLCommandId& id)
+{
+ if (!hasCommand(id))
+ {
+ return RANK_NONE;
+ }
+ int rank = 0;
+ std::list<LLToolBarButton*>::iterator it_button = mButtons.begin();
+ std::list<LLToolBarButton*>::iterator end_button = mButtons.end();
+ while (it_button != end_button)
+ {
+ if ((*it_button)->mId == id)
+ {
+ break;
+ }
+ rank++;
+ ++it_button;
+ }
+ return rank;
+}
+
void LLToolBar::updateLayoutAsNeeded()
{
if (!mNeedsLayout) return;
@@ -823,10 +844,12 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
LLAssetType::EType type = inv_item->getType();
if (type == LLAssetType::AT_WIDGET)
{
+ LLCommandId dragged_command(inv_item->getUUID());
+ int orig_rank = getRankFromPosition(dragged_command);
mDragRank = getRankFromPosition(x, y);
// Don't DaD if we're dragging a command on itself
- mDragAndDropTarget = (mDragCommand.uuid() != inv_item->getUUID());
- //llinfos << "Merov debug : DaD, rank = " << mDragRank << ", hit uuid = " << mDragCommand.uuid() << ", dragged uui = " << inv_item->getUUID() << llendl;
+ mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank-1) == orig_rank)) ? false : true);
+ llinfos << "Merov debug : DaD, rank = " << mDragRank << ", hit uuid = " << mDragCommand.uuid() << ", dragged uui = " << inv_item->getUUID() << llendl;
/* Do the following if you want to animate the button itself
LLCommandId dragged_command(inv_item->getUUID());
removeCommand(dragged_command);
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 8d38bc0234..3be252298d 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -161,6 +161,7 @@ public:
void draw();
void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
int getRankFromPosition(S32 x, S32 y);
+ int getRankFromPosition(const LLCommandId& id);
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index c586e3a098..69029d2ab9 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -8,7 +8,168 @@
label="Me"
name="Me"
tear_off="true">
+ <menu_item_call
+ label="Dashboard..."
+ name="Manage My Account">
+ <menu_item_call.on_click
+ function="PromptShowURL"
+ name="ManageMyAccount_url"
+ parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
+ </menu_item_call>
+ <menu_item_call
+ label="Profile..."
+ name="Profile">
+ <menu_item_call.on_click
+ function="ShowAgentProfile"
+ parameter="agent" />
+ </menu_item_call>
+ <menu_item_call
+ label="Appearance..."
+ name="ChangeOutfit">
+ <menu_item_call.on_click
+ function="CustomizeAvatar" />
+ <menu_item_call.on_enable
+ function="Edit.EnableCustomizeAvatar" />
+ </menu_item_call>
+ <menu_item_check
+ label="Inventory..."
+ name="Inventory"
+ shortcut="control|shift|I"
+ visible="false">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="inventory" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="inventory" />
+ </menu_item_check>
+ <menu_item_check
+ label="Inventory..."
+ name="ShowSidetrayInventory"
+ shortcut="control|I"
+ visible="true">
+ <menu_item_check.on_check
+ function="SidetrayPanelVisible"
+ parameter="my_inventory" />
+ <menu_item_check.on_click
+ function="ShowSidetrayPanel"
+ parameter="my_inventory" />
+ </menu_item_check>
+ <menu_item_check
+ label="Gestures..."
+ name="Gestures"
+ shortcut="control|G">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="gestures" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="gestures" />
+ </menu_item_check>
+ <menu_item_check
+ label="Voice..."
+ name="ShowVoice"
+ visibility_control="VoiceMorphingEnabled">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ Parameter="voice_effect" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="voice_effect" />
+ </menu_item_check>
+
+ <menu
+ create_jump_keys="true"
+ label="Movement"
+ name="Movement"
+ tear_off="true">
+ <menu_item_call
+ label="Sit Down"
+ layout="topleft"
+ shortcut="alt|shift|S"
+ name="Sit Down Here">
+ <menu_item_call.on_click
+ function="Self.SitDown"
+ parameter="" />
+ <menu_item_call.on_enable
+ function="Self.EnableSitDown" />
+ </menu_item_call>
+ <menu_item_check
+ label="Fly"
+ name="Fly"
+ shortcut="Home">
+ <menu_item_check.on_check
+ function="Agent.getFlying" />
+ <menu_item_check.on_click
+ function="Agent.toggleFlying" />
+ <menu_item_check.on_enable
+ function="Agent.enableFlying" />
+ </menu_item_check>
+ <menu_item_check
+ label="Always Run"
+ name="Always Run"
+ shortcut="control|R">
+ <menu_item_check.on_check
+ function="World.CheckAlwaysRun" />
+ <menu_item_check.on_click
+ function="World.AlwaysRun" />
+ </menu_item_check>
+ <menu_item_call
+ label="Stop Animating Me"
+ name="Stop Animating My Avatar">
+ <menu_item_call.on_click
+ function="Tools.StopAllAnimations" />
+ </menu_item_call>
+ </menu>
+
+ <menu
+ create_jump_keys="true"
+ label="Status"
+ name="Status"
+ tear_off="true">
<menu_item_call
+ label="Away"
+ name="Set Away">
+ <menu_item_call.on_click
+ function="World.SetAway" />
+ </menu_item_call>
+ <menu_item_call
+ label="Busy"
+ name="Set Busy">
+ <menu_item_call.on_click
+ function="World.SetBusy"/>
+ </menu_item_call>
+ </menu>
+
+ <menu_item_call
+ label="Request Admin Status"
+ name="Request Admin Options"
+ shortcut="control|alt|G"
+ visible="false">
+ <menu_item_call.on_click
+ function="Advanced.RequestAdminStatus" />
+ </menu_item_call>
+ <menu_item_call
+ label="Leave Admin Status"
+ name="Leave Admin Options"
+ shortcut="control|alt|shift|G"
+ visible="false">
+ <menu_item_call.on_click
+ function="Advanced.LeaveAdminStatus" />
+ </menu_item_call>
+
+ <menu_item_separator/>
+
+ <menu_item_call
+ label="Buy L$"
+ name="Buy and Sell L$">
+ <menu_item_call.on_click
+ function="BuyCurrency" />
+ </menu_item_call>
+
+ <menu_item_separator/>
+
+ <menu_item_call
label="Preferences..."
name="Preferences"
shortcut="control|P">
@@ -31,161 +192,6 @@
<menu_item_call.on_click
function="View.ToggleUI" />
</menu_item_call>
- <menu_item_call
- label="My Dashboard"
- name="Manage My Account">
- <menu_item_call.on_click
- function="PromptShowURL"
- name="ManageMyAccount_url"
- parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
- </menu_item_call>
- <menu_item_call
- label="Buy L$"
- name="Buy and Sell L$">
- <menu_item_call.on_click
- function="BuyCurrency" />
- </menu_item_call>
-
- <menu_item_separator/>
-
- <menu_item_call
- label="My Profile"
- name="Profile">
- <menu_item_call.on_click
- function="ShowAgentProfile"
- parameter="agent" />
- </menu_item_call>
- <menu_item_call
- label="My Appearance"
- name="ChangeOutfit">
- <menu_item_call.on_click
- function="CustomizeAvatar" />
- <menu_item_call.on_enable
- function="Edit.EnableCustomizeAvatar" />
- </menu_item_call>
- <menu_item_check
- label="My Inventory"
- name="Inventory"
- shortcut="control|shift|I"
- visible="false">
- <menu_item_check.on_check
- function="Floater.Visible"
- parameter="inventory" />
- <menu_item_check.on_click
- function="Floater.Toggle"
- parameter="inventory" />
- </menu_item_check>
- <menu_item_check
- label="My Inventory"
- name="ShowSidetrayInventory"
- shortcut="control|I"
- visible="true">
- <menu_item_check.on_check
- function="SidetrayPanelVisible"
- parameter="my_inventory" />
- <menu_item_check.on_click
- function="ShowSidetrayPanel"
- parameter="my_inventory" />
- </menu_item_check>
- <menu_item_check
- label="My Gestures"
- name="Gestures"
- shortcut="control|G">
- <menu_item_check.on_check
- function="Floater.Visible"
- parameter="gestures" />
- <menu_item_check.on_click
- function="Floater.Toggle"
- parameter="gestures" />
- </menu_item_check>
- <menu_item_check
- label="My Voice"
- name="ShowVoice"
- visibility_control="VoiceMorphingEnabled">
- <menu_item_check.on_check
- function="Floater.Visible"
- Parameter="voice_effect" />
- <menu_item_check.on_click
- function="Floater.Toggle"
- parameter="voice_effect" />
- </menu_item_check>
- <menu
- create_jump_keys="true"
- label="Movement"
- name="Movement"
- tear_off="true">
- <menu_item_call
- label="Sit Down"
- layout="topleft"
- shortcut="alt|shift|S"
- name="Sit Down Here">
- <menu_item_call.on_click
- function="Self.SitDown"
- parameter="" />
- <menu_item_call.on_enable
- function="Self.EnableSitDown" />
- </menu_item_call>
- <menu_item_check
- label="Fly"
- name="Fly"
- shortcut="Home">
- <menu_item_check.on_check
- function="Agent.getFlying" />
- <menu_item_check.on_click
- function="Agent.toggleFlying" />
- <menu_item_check.on_enable
- function="Agent.enableFlying" />
- </menu_item_check>
- <menu_item_check
- label="Always Run"
- name="Always Run"
- shortcut="control|R">
- <menu_item_check.on_check
- function="World.CheckAlwaysRun" />
- <menu_item_check.on_click
- function="World.AlwaysRun" />
- </menu_item_check>
- <menu_item_call
- label="Stop Animating Me"
- name="Stop Animating My Avatar">
- <menu_item_call.on_click
- function="Tools.StopAllAnimations" />
- </menu_item_call>
- </menu>
- <menu
- create_jump_keys="true"
- label="My Status"
- name="Status"
- tear_off="true">
- <menu_item_call
- label="Away"
- name="Set Away">
- <menu_item_call.on_click
- function="World.SetAway" />
- </menu_item_call>
- <menu_item_call
- label="Busy"
- name="Set Busy">
- <menu_item_call.on_click
- function="World.SetBusy"/>
- </menu_item_call>
- </menu>
- <menu_item_call
- label="Request Admin Status"
- name="Request Admin Options"
- shortcut="control|alt|G"
- visible="false">
- <menu_item_call.on_click
- function="Advanced.RequestAdminStatus" />
- </menu_item_call>
- <menu_item_call
- label="Leave Admin Status"
- name="Leave Admin Options"
- shortcut="control|alt|shift|G"
- visible="false">
- <menu_item_call.on_click
- function="Advanced.LeaveAdminStatus" />
- </menu_item_call>
<menu_item_separator/>