Added Bring to Front and Send to Back options to context menu and changed shortcut keys (fixes bug where shift+up/down changed stacking order while doing a large nudge)

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1760 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Adrian Jones 2010-09-27 14:20:20 +00:00
parent 06f6297ae3
commit de64f02567
3 changed files with 18 additions and 10 deletions

View File

@ -1251,7 +1251,7 @@ span.zoom_tool {
padding: 5px 0; padding: 5px 0;
margin: 0px; margin: 0px;
display: none; display: none;
font: 14px/17px Lucida Sans, Helvetica, Verdana, sans-serif; font: 12px/15px Lucida Sans, Helvetica, Verdana, sans-serif;
border-radius: 5px; border-radius: 5px;
-moz-border-radius: 5px; -moz-border-radius: 5px;
-moz-box-shadow: 2px 5px 10px rgba(0,0,0,.3); -moz-box-shadow: 2px 5px 10px rgba(0,0,0,.3);
@ -1266,7 +1266,7 @@ span.zoom_tool {
} }
.contextMenu .shortcut { .contextMenu .shortcut {
width: 80px; width: 115px;
text-align:right; text-align:right;
float:right; float:right;
} }

View File

@ -688,8 +688,10 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<li class="separator"><a href="#delete">Delete</a></li> <li class="separator"><a href="#delete">Delete</a></li>
<li class="separator"><a href="#group">Group<span class="shortcut">G</span></a></li> <li class="separator"><a href="#group">Group<span class="shortcut">G</span></a></li>
<li><a href="#ungroup">Ungroup<span class="shortcut">G</span></a></li> <li><a href="#ungroup">Ungroup<span class="shortcut">G</span></a></li>
<li class="separator"><a href="#move_up">Bring Forward<span class="shortcut">CTRL+]</span></a></li> <li class="separator"><a href="#move_front">Bring to Front<span class="shortcut">SHFT+CTRL+]</span></a></li>
<li><a href="#move_up">Bring Forward<span class="shortcut">CTRL+]</span></a></li>
<li><a href="#move_down">Send Backward<span class="shortcut">CTRL+[</span></a></li> <li><a href="#move_down">Send Backward<span class="shortcut">CTRL+[</span></a></li>
<li><a href="#move_back">Send to Back<span class="shortcut">SHFT+CTRL+[</span></a></li>
</ul> </ul>

View File

@ -1565,7 +1565,7 @@
.enableContextMenuItems('#group') .enableContextMenuItems('#group')
.disableContextMenuItems('#ungroup'); .disableContextMenuItems('#ungroup');
} else { } else {
menu_items.disableContextMenuItems('#delete,#cut,#copy,#group,#ungroup,#move_up,#move_down'); menu_items.disableContextMenuItems('#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back');
} }
// update history buttons // update history buttons
@ -1589,7 +1589,7 @@
$('#selLayerNames').removeAttr('disabled').val(currentLayer); $('#selLayerNames').removeAttr('disabled').val(currentLayer);
// Enable regular menu options // Enable regular menu options
canv_menu.enableContextMenuItems('#delete,#cut,#copy,#move_down,#move_up'); canv_menu.enableContextMenuItems('#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back');
} }
else { else {
$('#selLayerNames').attr('disabled', 'disabled'); $('#selLayerNames').attr('disabled', 'disabled');
@ -3656,8 +3656,8 @@
{sel:'#tool_node_delete', fn: deletePathNode, evt: 'click'}, {sel:'#tool_node_delete', fn: deletePathNode, evt: 'click'},
{sel:'#tool_openclose_path', fn: opencloseSubPath, evt: 'click'}, {sel:'#tool_openclose_path', fn: opencloseSubPath, evt: 'click'},
{sel:'#tool_add_subpath', fn: addSubPath, evt: 'click'}, {sel:'#tool_add_subpath', fn: addSubPath, evt: 'click'},
{sel:'#tool_move_top', fn: moveToTopSelected, evt: 'click', key: 'shift+up'}, {sel:'#tool_move_top', fn: moveToTopSelected, evt: 'click', key: 'ctrl+shift+]'},
{sel:'#tool_move_bottom', fn: moveToBottomSelected, evt: 'click', key: 'shift+down'}, {sel:'#tool_move_bottom', fn: moveToBottomSelected, evt: 'click', key: 'ctrl+shift+['},
{sel:'#tool_topath', fn: convertToPath, evt: 'click'}, {sel:'#tool_topath', fn: convertToPath, evt: 'click'},
{sel:'#tool_undo', fn: clickUndo, evt: 'click', key: ['Z', true]}, {sel:'#tool_undo', fn: clickUndo, evt: 'click', key: ['Z', true]},
{sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['Y', true]}, {sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['Y', true]},
@ -3683,8 +3683,8 @@
{key: 'shift+P', fn: selectNext}, {key: 'shift+P', fn: selectNext},
{key: [modKey+'up', true], fn: function(){zoomImage(2);}}, {key: [modKey+'up', true], fn: function(){zoomImage(2);}},
{key: [modKey+'down', true], fn: function(){zoomImage(.5);}}, {key: [modKey+'down', true], fn: function(){zoomImage(.5);}},
{key: [modKey+'[', true], fn: function(){moveUpDownSelected('Down');}},
{key: [modKey+']', true], fn: function(){moveUpDownSelected('Up');}}, {key: [modKey+']', true], fn: function(){moveUpDownSelected('Up');}},
{key: [modKey+'[', true], fn: function(){moveUpDownSelected('Down');}},
{key: ['up', true], fn: function(){moveSelected(0,-1);}}, {key: ['up', true], fn: function(){moveSelected(0,-1);}},
{key: ['down', true], fn: function(){moveSelected(0,1);}}, {key: ['down', true], fn: function(){moveSelected(0,1);}},
{key: ['left', true], fn: function(){moveSelected(-1,0);}}, {key: ['left', true], fn: function(){moveSelected(-1,0);}},
@ -3900,12 +3900,18 @@
case 'ungroup': case 'ungroup':
svgCanvas.ungroupSelectedElement(); svgCanvas.ungroupSelectedElement();
break; break;
case 'move_down': case 'move_front':
moveUpDownSelected('Down'); moveToTopSelected();
break; break;
case 'move_up': case 'move_up':
moveUpDownSelected('Up'); moveUpDownSelected('Up');
break; break;
case 'move_down':
moveUpDownSelected('Down');
break;
case 'move_back':
moveToBottomSelected();
break;
} }