From 9b7d76f9ebab0e4fd38162f909b0226e83ddade1 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Mon, 18 Aug 2008 18:42:37 +0000 Subject: [PATCH] Add convenience button to open LPE dialog (e.g., to adapt construction parameters numerically) --- src/widgets/toolbox.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 5ddfa1bdf..ab2153fe0 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -452,6 +452,8 @@ static gchar const * ui_descr = " " " " " " + " " + " " " " " " @@ -4994,6 +4996,17 @@ sp_lpetool_change_line_segment_type(EgeSelectOneAction* act, GObject* tbl) { g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); } +static void +lpetool_open_lpe_dialog (GtkToggleAction *act, gpointer data) { + SPDesktop *desktop = static_cast(data); + + if (tools_isactive(desktop, TOOLS_LPETOOL)) { + SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(desktop->event_context); + sp_action_perform(Inkscape::Verb::get(SP_VERB_DIALOG_LIVE_PATH_EFFECT)->get_action(desktop), NULL); + } + gtk_toggle_action_set_active(act, false); +} + static void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { UnitTracker* tracker = new UnitTracker(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); @@ -5103,6 +5116,18 @@ static void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActi g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(lpetool_unit_changed), (GObject*)holder ); } + /* Open LPE dialog (to adapt parameters numerically) */ + { + InkToggleAction* act = ink_toggle_action_new( "LPEOpenLPEDialogAction", + _("Open LPE dialog"), + _("Open LPE dialog (to adapt parameters numerically)"), + "lpetool_open_lpe_dialog", + Inkscape::ICON_SIZE_DECORATION ); + gtk_action_group_add_action( mainActions, GTK_ACTION( act ) ); + g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(lpetool_open_lpe_dialog), desktop ); + gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), FALSE ); + } + //watch selection Inkscape::ConnectionPool* pool = Inkscape::ConnectionPool::new_connection_pool ("ISNodeToolbox"); -- 2.30.2