From 687553afa9ed055d63b91f18510d86172fa4387a Mon Sep 17 00:00:00 2001 From: mjwybrow Date: Fri, 12 May 2006 04:13:28 +0000 Subject: [PATCH] * src/ui/dialog/inkscape-preferences.cpp, src/ui/dialog/inkscape-preferences.h, src/connector-context.cpp: Add a preferences setting to the connector tool for setting whether or not connectors attach to text objects. This addresses feature request #1434292. --- ChangeLog | 9 +++++++++ src/connector-context.cpp | 12 +++++++++++- src/ui/dialog/inkscape-preferences.cpp | 3 +++ src/ui/dialog/inkscape-preferences.h | 2 ++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 097ebdf7b..0bb541995 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-05-11 Michael Wybrow + + * src/ui/dialog/inkscape-preferences.cpp, + src/ui/dialog/inkscape-preferences.h, src/connector-context.cpp: + + Add a preferences setting to the connector tool for setting + whether or not connectors attach to text objects. This + addresses feature request #1434292. + 2006-05-09 Carl Hetherington * src/nodepath.cpp: fix silly bug with snapping node edits. * diff --git a/src/connector-context.cpp b/src/connector-context.cpp index 798725363..10312c411 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -17,13 +17,14 @@ * an object involves going inside C but without entering S.) * o Draw connectors to shape edges rather than bounding box. * o Show a visual indicator for objects with the 'avoid' property set. + * o Allow user to change a object between a path and connector through + * the interface. * o Create an interface for setting markers (arrow heads). * o Better distinguish between paths and connectors to prevent problems * in the node tool and paths accidently being turned into connectors * in the connector tool. Perhaps have a way to convert between. * o Only call libavoid's updateEndPoint as required. Currently we do it * for both endpoints, even if only one is moving. - * o Cleanup to remove unecessary borrowed DrawContext code. * o Allow user-placeable connection points. * o Deal sanely with connectors with both endpoints attached to the * same connection point, and drawing of connectors attaching @@ -68,6 +69,9 @@ #include "libavoid/vertices.h" #include "context-fns.h" #include "sp-namedview.h" +#include "sp-text.h" +#include "sp-flowtext.h" + static void sp_connector_context_class_init(SPConnectorContextClass *klass); static void sp_connector_context_init(SPConnectorContext *conn_context); @@ -1206,6 +1210,12 @@ static bool cc_item_is_shape(SPItem *item) return false; } } + else if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) { + if (prefs_get_int_attribute("tools.connector", "ignoretext", 1) == 1) { + // Don't count text as a shape we can connect connector to. + return false; + } + } return true; } diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 25ad8219a..78e6cd812 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -302,6 +302,7 @@ void InkscapePreferences::initPageTools() _path_tools = _page_list.get_model()->get_path(iter_tools); _calligrapy_use_abs_size.init ( _("Width is in absolute units"), "tools.calligraphic", "abs_width", false); + _connector_ignore_text.init( _("Don't attach connectors to text objects"), "tools.connector", "ignoretext", true); //Selector this->AddPage(_page_selector, _("Selector"), iter_tools, PREFS_PAGE_TOOLS_SELECTOR); @@ -384,6 +385,8 @@ void InkscapePreferences::initPageTools() //Connector this->AddPage(_page_connector, _("Connector"), iter_tools, PREFS_PAGE_TOOLS_CONNECTOR); this->AddSelcueCheckbox(_page_connector, "tools.connector", true); + _page_connector.add_line(false, "", _connector_ignore_text, "", + _("If on, conector attachment points will not be shown for text objects")); //Dropper this->AddPage(_page_dropper, _("Dropper"), iter_tools, PREFS_PAGE_TOOLS_DROPPER); this->AddSelcueCheckbox(_page_dropper, "tools.dropper", true); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index d850dd431..c3a3c0c9e 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -116,6 +116,8 @@ protected: PrefCheckButton _calligrapy_use_abs_size; + PrefCheckButton _connector_ignore_text; + PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform, _clone_option_unlink, _clone_option_delete; -- 2.30.2