From 14dad9f1c82ceee5f613cb174fbd71bf57ef0d19 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Thu, 15 Oct 2009 14:49:06 +0000 Subject: [PATCH] Fix Issue 180: contextual tool buttons show as pressed in when pressed, also highlighted when hovered git-svn-id: http://svg-edit.googlecode.com/svn/trunk@833 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.css | 15 +++++++++++---- editor/svg-editor.html | 42 +++++++++++++++++++++--------------------- editor/svg-editor.js | 10 ++++++++++ 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/editor/svg-editor.css b/editor/svg-editor.css index 9af54c99..a0808a61 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -352,7 +352,10 @@ span.zoom_tool { background-color: #B0B0B0; } -#svg_editor .tool_button, #svg_editor .tool_button_current, #svg_editor .tool_button_disabled { +#svg_editor .tool_button, +#svg_editor .push_button, +#svg_editor .tool_button_current, +#svg_editor .tool_button_disabled { height: 24px; width: 24px; margin: 2px; @@ -364,7 +367,8 @@ span.zoom_tool { cursor: pointer; } -#svg_editor .tool_button_current { +#svg_editor .tool_button_current, +#svg_editor .push_button_pressed { border-left: 1px solid #808080; border-top: 1px solid #808080; border-right: 1px solid #FFFFFF; @@ -420,8 +424,6 @@ span.zoom_tool { #svg_editor #tool_aligncenter { background: 2px 2px url('images/align-center.png') no-repeat; } #svg_editor #tool_alignright { background: 2px 2px url('images/align-right.png') no-repeat; } #svg_editor .tool_sep { background: 2px 2px url('images/sep.png') no-repeat; } -#svg_editor #tool_undo { background: 2px 2px url('images/undo.png') no-repeat; } -#svg_editor #tool_redo { background: 2px 2px url('images/redo.png') no-repeat; } /* TODO: figure out what more-specific selector causes me to write this atrocity and not simply .tool_flyout_button */ @@ -436,6 +438,11 @@ span.zoom_tool { width: 28px; } +#svg_editor .tool_button:hover, +#svg_editor .push_button:hover { + background-color: #FFF; +} + #svg_editor #tools_rect .tool_flyout_button_current, #svg_editor #tools_ellipse .tool_flyout_button_current { border-left: 1px solid #808080; border-top: 1px solid #808080; diff --git a/editor/svg-editor.html b/editor/svg-editor.html index ad881cce..14339ca4 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -84,28 +84,28 @@ script type="text/javascript" src="locale/locale.min.js">
- Clear - - Save - - Source + Clear + + Save + + Source
-
-
+ +
| - Copy - Delete + Copy + Delete | - Top - Bottom + Top + Bottom | @@ -144,12 +144,12 @@ script type="text/javascript" src="locale/locale.min.js"> | - Group + Group
| - Ungroup + Ungroup
diff --git a/editor/svg-editor.js b/editor/svg-editor.js index df2d9195..bbeee544 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1169,6 +1169,16 @@ function svg_edit_setup() { }).mouseup(function() { $(this).removeClass('layer_buttonpressed'); }); + + $('.push_button').mousedown(function() { + if (!$(this).hasClass('tool_button_disabled')) { + $(this).addClass('push_button_pressed'); + } + }).mouseout(function() { + $(this).removeClass('push_button_pressed'); + }).mouseup(function() { + $(this).removeClass('push_button_pressed'); + }); $('#layer_new').click(function() { var curNames = new Array(svgCanvas.getNumLayers());