diff --git a/editor/images/svg_edit_icons.svg b/editor/images/svg_edit_icons.svg index 3d45e1ff..c91d8ac1 100644 --- a/editor/images/svg_edit_icons.svg +++ b/editor/images/svg_edit_icons.svg @@ -312,6 +312,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -657,6 +688,32 @@ + + + + + + + + + + diff --git a/editor/svg-editor.css b/editor/svg-editor.css index 463d482f..d842e9a0 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -78,6 +78,23 @@ margin-top: 0; } +#svg_editor #color_tools .icon_label { + padding-right: 0; + height: 23px; + min-width: 18px; + cursor: pointer; +} + +#group_opacityLabel, +#zoomLabel { + cursor: pointer; +} + +#color_tools .icon_label > * { + position: relative; + top: 1px; +} + #svg_editor div#palette { float: left; width: 6848px; @@ -475,8 +492,8 @@ span.zoom_tool { padding: 3px; } -#zoom_panel label { - margin-top: 2px; +#zoom_panel { + margin-top: 5px; } .dropdown { @@ -690,7 +707,7 @@ span.zoom_tool { } #svg_editor #tools_bottom_2 { - width: 215px; + width: 180px; position: relative; float: left; } @@ -714,7 +731,7 @@ span.zoom_tool { background: #f0f0f0; padding: 0 5px; vertical-align: middle; - height: 26px; + height: 25px; } #toggle_stroke_tools { @@ -766,7 +783,7 @@ span.zoom_tool { } -#tools_top .dropdown div { +#tools_top .dropdown .icon_label { border: 1px solid transparent; margin-top: 3px; } @@ -829,7 +846,7 @@ span.zoom_tool { padding: 0 3px; } -#tool_opacity .dropdown button { +#tools_bottom .dropdown button { margin-top: 2px; } diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 36f8c03e..1451f643 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -166,9 +166,9 @@ script type="text/javascript" src="locale/locale.min.js"> - - angle: - + + + @@ -404,10 +404,10 @@ script type="text/javascript" src="locale/locale.min.js"> - + - zoom: - + + @@ -430,20 +430,16 @@ script type="text/javascript" src="locale/locale.min.js"> - - - fill: - + + - + - - stroke: - + @@ -485,10 +481,10 @@ script type="text/javascript" src="locale/locale.min.js"> - + - opac: - + + diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 21b645e5..80fee2fc 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -336,6 +336,11 @@ '#rwidthLabel, #iwidthLabel':'width', '#rheightLabel, #iheightLabel':'height', '#cornerRadiusLabel span':'c_radius', + '#angleLabel':'angle', + '#zoomLabel':'zoom', + '#tool_fill label': 'fill', + '#tool_stroke .icon_label': 'stroke', + '#group_opacityLabel': 'opacity', '.flyout_arrow_horiz':'arrow_right', '.dropdown button, #main_button .dropdown':'arrow_down', @@ -349,7 +354,8 @@ '#main_button .dropdown .svg_icon': 9, '.palette_item:first .svg_icon, #fill_bg .svg_icon, #stroke_bg .svg_icon': 16, '.toolbar_button button .svg_icon':16, - '.stroke_tool div div .svg_icon': 20 + '.stroke_tool div div .svg_icon': 20, + '#tools_bottom label .svg_icon': 18 }, callback: function(icons) { $('.toolbar_button button > svg, .toolbar_button button > img').each(function() { @@ -1811,7 +1817,23 @@ // holder.empty().append(icon) // .attr('data-curopt', holder_sel.replace('_show','')); // This sets the current mode // } - + + // Unfocus text input when workarea is mousedowned. + (function() { + var inp; + + var unfocus = function() { + $(inp).blur(); + } + + $('#svg_editor input:text').focus(function() { + inp = this; + workarea.mousedown(unfocus); + }).blur(function() { + workarea.unbind('mousedown', unfocus); + }); + }()); + var clickSelect = function() { if (toolButtonClick('#tool_select')) { svgCanvas.setMode('select'); @@ -2707,16 +2729,26 @@ }); },1000); - $('#fill_color').click(function(){ - colorPicker($(this)); + $('#fill_color, #tool_fill .icon_label').click(function(){ + colorPicker($('#fill_color')); updateToolButtonState(); }); - $('#stroke_color').click(function(){ - colorPicker($(this)); + $('#stroke_color, #tool_stroke .icon_label').click(function(){ + colorPicker($('#stroke_color')); updateToolButtonState(); }); - + + $('#group_opacityLabel').click(function() { + $('#opacity_dropdown button').mousedown(); + $(window).mouseup(); + }); + + $('#zoomLabel').click(function() { + $('#zoom_dropdown button').mousedown(); + $(window).mouseup(); + }); + $('#tool_move_top').mousedown(function(evt){ $('#tools_stacking').show(); evt.preventDefault();