Fixed some icon size related bugs

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1568 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-05-12 15:45:43 +00:00
parent 7054c3fd95
commit f5a19b8fe7
2 changed files with 30 additions and 17 deletions

View File

@ -79,15 +79,18 @@
} }
#svg_editor #color_tools .icon_label { #svg_editor #color_tools .icon_label {
padding-right: 0; padding: 3px 19%;
height: 26px; width: 28px;
min-width: 18px; height: 100%;
cursor: pointer; cursor: pointer;
} }
#group_opacityLabel, #svg_editor #group_opacityLabel,
#zoomLabel { #svg_editor #zoomLabel {
cursor: pointer; cursor: pointer;
margin-right: 5px;
padding-top: 4px
} }
#color_tools .icon_label > * { #color_tools .icon_label > * {
@ -738,9 +741,9 @@ span.zoom_tool {
.color_tool > * { .color_tool > * {
display: table-cell; display: table-cell;
background: #f0f0f0; background: #f0f0f0;
padding: 0 5px; padding: 0 5px 0 0;
vertical-align: middle; vertical-align: middle;
height: 25px; /* height: 25px;*/
} }
#toggle_stroke_tools { #toggle_stroke_tools {
@ -841,7 +844,6 @@ span.zoom_tool {
-moz-border-radius-bottomright: 4px; -moz-border-radius-bottomright: 4px;
-webkit-border-top-right-radius: 4px; -webkit-border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-right-radius: 4px;
} }
#svg_editor #tool_opacity { #svg_editor #tool_opacity {

View File

@ -461,20 +461,18 @@
var togglePathEditMode = function(editmode, elems) { var togglePathEditMode = function(editmode, elems) {
$('#path_node_panel').toggle(editmode); $('#path_node_panel').toggle(editmode);
$('#tools_bottom_2,#tools_bottom_3').toggle(!editmode); $('#tools_bottom_2,#tools_bottom_3').toggle(!editmode);
var size = $('#tool_select > svg, #tool_select > img')[0].getAttribute('width');
if(editmode) { if(editmode) {
// Change select icon // Change select icon
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
$('#tool_select').addClass('tool_button_current').removeClass('tool_button') $('#tool_select').addClass('tool_button_current').removeClass('tool_button');
.empty().append($.getSvgIcon('select_node')); setIcon('#tool_select', 'select_node');
multiselected = false; multiselected = false;
if(elems.length) { if(elems.length) {
selectedElement = elems[0]; selectedElement = elems[0];
} }
} else { } else {
$('#tool_select').empty().append($.getSvgIcon('select')); setIcon('#tool_select', 'select');
} }
$.resizeSvgIcons({'#tool_select .svg_icon':size});
} }
// used to make the flyouts stay on the screen longer the very first time // used to make the flyouts stay on the screen longer the very first time
@ -1162,9 +1160,7 @@
$('#tool_node_delete').toggleClass('disabled', !path.canDeleteNodes); $('#tool_node_delete').toggleClass('disabled', !path.canDeleteNodes);
// Show open/close button based on selected point // Show open/close button based on selected point
$('#tool_openclose_path') setIcon('#tool_openclose_path', path.closed_subpath ? 'open_path' : 'close_path');
.empty()
.append($.getSvgIcon(path.closed_subpath ? 'open_path' : 'close_path'));
if(point) { if(point) {
var seg_type = $('#seg_type'); var seg_type = $('#seg_type');
@ -2296,6 +2292,17 @@
svgCanvas.setBackground(color, url); svgCanvas.setBackground(color, url);
} }
var setIcon = function(elem, icon_id) {
var icon = $.getSvgIcon(icon_id).clone();
$(elem).empty().append(icon);
var size = curPrefs.iconsize;
if(size !== 'm') {
var icon_sizes = { s:16, m:24, l:32, xl:48}, obj = {};
obj[elem + ' .svg_icon'] = icon_sizes[size];
$.resizeSvgIcons(obj);
}
}
var setIconSize = Editor.setIconSize = function(size, force) { var setIconSize = Editor.setIconSize = function(size, force) {
if(size == curPrefs.size && !force) return; if(size == curPrefs.size && !force) return;
$.pref('iconsize', size); $.pref('iconsize', size);
@ -2357,7 +2364,11 @@
'height': {s: '58px', l: '98px', xl: '145px'} 'height': {s: '58px', l: '98px', xl: '145px'}
}, },
"#color_tools": { "#color_tools": {
'border-spacing': {s: '0 1px'} 'border-spacing': {s: '0 1px'},
'margin-top': {s: '-1px'}
},
"#color_tools .icon_label": {
'width': {l:'43px', xl: '60px'}
}, },
".color_tool": { ".color_tool": {
'height': {s: '20px'} 'height': {s: '20px'}