Code

* convolve matrix code refactoring
[inkscape.git] / src / ui / dialog / livepatheffect-editor.cpp
index 93e17c324c59feb2426384b1e26701f99120dcee..29ec03a8ca6294ed7cd6278b6e5d98adda534e32 100644 (file)
@@ -46,11 +46,6 @@ static void lpeeditor_selection_changed (Inkscape::Selection * selection, gpoint
     lpeeditor->onSelectionChanged(selection);
 }
 
-static void lpeeditor_selection_modified( Inkscape::Selection *selection, guint /*flags*/, gpointer data )
-{
-    lpeeditor_selection_changed (selection, data);
-}
-
 
 /*#######################
  * LivePathEffectEditor
@@ -81,8 +76,8 @@ LivePathEffectEditor::LivePathEffectEditor()
     effectcontrol_vbox.pack_end(button_remove, true, true);
     effectcontrol_frame.add(effectcontrol_vbox);
 
-    contents->pack_start(effectapplication_frame, true, true);
-    contents->pack_start(effectcontrol_frame, true, true);
+    contents->pack_start(effectapplication_frame, false, false);
+    contents->pack_start(effectcontrol_frame, false, false);
 
     // connect callback functions to buttons
     button_apply.signal_clicked().connect(sigc::mem_fun(*this, &LivePathEffectEditor::onApply));
@@ -103,7 +98,6 @@ LivePathEffectEditor::~LivePathEffectEditor()
 
     if (current_desktop) {
         selection_changed_connection.disconnect();
-        selection_modified_connection.disconnect();
     }
 }
 
@@ -124,7 +118,7 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect* effect)
     button_remove.show();
 
     effectcontrol_vbox.show_all_children();
-    // fixme: do resizing of dialog 
+    // fixme: add resizing of dialog
 }
 
 void
@@ -195,7 +189,6 @@ LivePathEffectEditor::setDesktop(SPDesktop *desktop)
 
     if (current_desktop) {
         selection_changed_connection.disconnect();
-        selection_modified_connection.disconnect();
     }
 
     current_desktop = desktop;
@@ -203,8 +196,6 @@ LivePathEffectEditor::setDesktop(SPDesktop *desktop)
         Inkscape::Selection *selection = sp_desktop_selection(desktop);
         selection_changed_connection = selection->connectChanged(
             sigc::bind (sigc::ptr_fun(&lpeeditor_selection_changed), this ) );
-        selection_modified_connection = selection->connectModified(
-            sigc::bind (sigc::ptr_fun(&lpeeditor_selection_modified), this ) );
 
         onSelectionChanged(selection);
     } else {
@@ -260,6 +251,8 @@ LivePathEffectEditor::onApply()
 
             sp_document_done(doc, SP_VERB_DIALOG_LIVE_PATH_EFFECT, 
                              _("Create and apply path effect"));
+
+            onSelectionChanged(sel);
         }
     }
 }
@@ -272,6 +265,8 @@ LivePathEffectEditor::onRemove()
         SPItem *item = sel->singleItem();
         if ( item && SP_IS_SHAPE(item) ) {
             sp_shape_remove_path_effect(SP_SHAPE(item));
+            showText(_("No effect applied"));
+            button_remove.set_sensitive(false);
             sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, 
                                _("Remove path effect") );
         }