Code

Add option to only flash paths for node tool when none is selected. Applies patch...
authorjoncruz <joncruz@users.sourceforge.net>
Thu, 5 Mar 2009 06:00:11 +0000 (06:00 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Thu, 5 Mar 2009 06:00:11 +0000 (06:00 +0000)
src/node-context.cpp
src/preferences-skeleton.h
src/ui/dialog/inkscape-preferences.cpp
src/ui/dialog/inkscape-preferences.h

index a8f6fcf972931dc00fd9ede1d97d5e0c8d3d547f..33b4a53e06c93dfe3d10d01f27f285f56aa1a99d 100644 (file)
@@ -236,7 +236,14 @@ sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
     Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
     if (prefs->getBool("/tools/nodes/pathflash_enabled")) {
-        guint timeout = prefs->getInt("/tools/nodes/pathflash_timeout", 500);
+        if (prefs->getBool("/tools/nodes/pathflash_unselected")) {
+            SPDesktop *desktop = event_context->desktop;
+            ShapeEditor* se = event_context->shape_editor;
+            Inkscape::Selection *selection = sp_desktop_selection (desktop);
+            if (se->has_nodepath() && selection->singleItem()) {
+                return ret;
+            }
+        }
         if (SP_IS_LPE_ITEM(item)) {
             Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item));
             if (lpe && (lpe->providesOwnFlashPaths() ||
@@ -246,6 +253,7 @@ sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
                 return ret;
             }
         }
+        guint timeout = prefs->getInt("/tools/nodes/pathflash_timeout", 500);
         sp_node_context_flash_path(event_context, item, timeout);
     }
 
index ae39a22720927f9cf453e2e25609e876bd0a0146..16e1472204e351180ccc2d96a43411192499bb9d 100644 (file)
@@ -107,7 +107,7 @@ static char const preferences_skeleton[] =
 "    <eventcontext id=\"text\"  usecurrent=\"0\" gradientdrag=\"1\"\n"
 "                       font_sample=\"AaBbCcIiPpQq12369$\342\202\254\302\242?.;/()\"\n"
 "                  style=\"fill:black;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;font-style:normal;font-weight:normal;font-size:40px;\" selcue=\"1\"/>\n"
-"    <eventcontext id=\"nodes\" selcue=\"1\" gradientdrag=\"1\" highlight_color=\"4278190335\" pathflash_enabled=\"1\" pathflash_timeout=\"500\" show_handles=\"1\" show_helperpath=\"0\" sculpting_profile=\"1\" />\n"
+"    <eventcontext id=\"nodes\" selcue=\"1\" gradientdrag=\"1\" highlight_color=\"4278190335\" pathflash_enabled=\"1\" pathflash_unselected=\"0\" pathflash_timeout=\"500\" show_handles=\"1\" show_helperpath=\"0\" sculpting_profile=\"1\" />\n"
 "    <eventcontext id=\"tweak\" selcue=\"0\" gradientdrag=\"0\" show_handles=\"0\" width=\"0.2\" force=\"0.2\" fidelity=\"0.5\" usepressure=\"1\" style=\"fill:red;stroke:none;\" usecurrent=\"0\"/>\n"
 "    <eventcontext id=\"gradient\" selcue=\"1\"/>\n"
 "    <eventcontext id=\"zoom\" selcue=\"1\" gradientdrag=\"0\"/>\n"
index fe7b1f7c13dd68ab9ec32431b5f4ee40fd7432a8..d29ac37dbc34b7ef636a4ac361486cac0f44d00a 100644 (file)
@@ -431,6 +431,8 @@ void InkscapePreferences::initPageTools()
     _page_node.add_line( false, _("Path outline color"), _t_node_pathoutline_color, "", _("Selects the color used for showing the path outline."), false);
     _t_node_pathflash_enabled.init ( _("Path outline flash on mouse-over"), "/tools/nodes/pathflash_enabled", false);
     _page_node.add_line( true, "", _t_node_pathflash_enabled, "", _("When hovering over a path, briefly flash its outline."));
+    _t_node_pathflash_unselected.init ( _("Suppress path outline flash when one path selected"), "/tools/nodes/pathflash_unselected", false);
+    _page_node.add_line( true, "", _t_node_pathflash_unselected, "", _("If a path is selected, do not continue flashing path outlines."));
     _t_node_pathflash_timeout.init("/tools/nodes/pathflash_timeout", 0, 10000.0, 100.0, 100.0, 1000.0, true, false);
     _page_node.add_line( false, _("Flash time"), _t_node_pathflash_timeout, "ms", _("Specifies how long the path outline will be visible after a mouse-over (in milliseconds). Specify 0 to have the outline shown until mouse leaves the path."), false);
 
index ac3c96a88d5a9013653886b21a19a80a336f590f..a68303ab9e99f26de6916855da9974ae649b5681 100644 (file)
@@ -139,6 +139,7 @@ protected:
                     _t_sel_cue_box, _t_bbox_visual, _t_bbox_geometric;
     PrefCheckButton _t_cvg_keep_objects, _t_cvg_convert_whole_groups;
     PrefCheckButton _t_node_pathflash_enabled;
+    PrefCheckButton _t_node_pathflash_unselected;
     PrefSpinButton  _t_node_pathflash_timeout;
     PrefColorPicker _t_node_pathoutline_color;