From: buliabyak Date: Sun, 14 May 2006 03:27:13 +0000 (+0000) Subject: keep selected option for calligraphic X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c72200c516f2541e20b57a85baa5bfd4590f06e7;p=inkscape.git keep selected option for calligraphic --- diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 99cea177b..ebabeef31 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -156,6 +156,7 @@ sp_dyna_draw_context_init(SPDynaDrawContext *ddc) ddc->flatness = 0.9; ddc->abs_width = false; + ddc->keep_selected = true; } static void @@ -218,6 +219,7 @@ sp_dyna_draw_context_setup(SPEventContext *ec) sp_event_context_read(ec, "usepressure"); sp_event_context_read(ec, "usetilt"); sp_event_context_read(ec, "abs_width"); + sp_event_context_read(ec, "keep_selected"); ddc->is_drawing = false; @@ -256,6 +258,8 @@ sp_dyna_draw_context_set(SPEventContext *ec, gchar const *key, gchar const *val) ddc->usetilt = (val && strcmp(val, "0")); } else if (!strcmp(key, "abs_width")) { ddc->abs_width = (val && strcmp(val, "0")); + } else if (!strcmp(key, "keep_selected")) { + ddc->keep_selected = (val && strcmp(val, "0")); } //g_print("DDC: %g %g %g %g\n", ddc->mass, ddc->drag, ddc->angle, ddc->width); @@ -654,7 +658,8 @@ set_to_accumulated(SPDynaDrawContext *dc) Inkscape::GC::release(dc->repr); item->transform = SP_ITEM(desktop->currentRoot())->getRelativeTransform(desktop->currentLayer()); item->updateRepr(); - sp_desktop_selection(desktop)->set(dc->repr); + if (dc->keep_selected) + sp_desktop_selection(desktop)->set(dc->repr); } abp = nr_artpath_affine(sp_curve_first_bpath(dc->accumulated), sp_desktop_dt2root_affine(desktop)); str = sp_svg_write_path(abp); diff --git a/src/dyna-draw-context.h b/src/dyna-draw-context.h index fef6f1ea3..27d3291da 100644 --- a/src/dyna-draw-context.h +++ b/src/dyna-draw-context.h @@ -101,6 +101,9 @@ struct SPDynaDrawContext /** uses absolute width independent of zoom */ bool abs_width; + + /** newly created object remain selected */ + bool keep_selected; }; struct SPDynaDrawContextClass diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 6fd5b235d..073fdbb78 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -60,7 +60,7 @@ static char const preferences_skeleton[] = " \n" " \n" +" usepressure=\"0\" usetilt=\"0\" keep_selected=\"1\"/>\n" " \n" " \n" diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index f5b447e26..b3eac4336 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); + _calligrapy_keep_selected.init ( _("Keep selected"), "tools.calligraphic", "keep_selected", true); _connector_ignore_text.init( _("Don't attach connectors to text objects"), "tools.connector", "ignoretext", true); //Selector @@ -374,6 +375,8 @@ void InkscapePreferences::initPageTools() this->AddNewObjectsStyle(_page_calligraphy, "tools.calligraphic"); _page_calligraphy.add_line( false, "", _calligrapy_use_abs_size, "", _("If on, pen width is in absolute units (px) independent of zoom; otherwise pen width depends on zoom so that it looks the same at any zoom")); + _page_calligraphy.add_line( false, "", _calligrapy_keep_selected, "", + _("If on, each object created with this tool will remain selected after you finish drawing it")); //Text this->AddPage(_page_text, _("Text"), iter_tools, PREFS_PAGE_TOOLS_TEXT); this->AddSelcueCheckbox(_page_text, "tools.text", true); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index c3a3c0c9e..077c2c416 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -115,6 +115,7 @@ protected: PrefCheckButton _win_save_geom, _win_hide_task, _win_zoom_resize; PrefCheckButton _calligrapy_use_abs_size; + PrefCheckButton _calligrapy_keep_selected; PrefCheckButton _connector_ignore_text;