summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/path.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-05-28 05:40:43 +0000
committerJabiertxof <jtx@jtx>2017-05-28 05:40:43 +0000
commit5f75967b19b3cc95f249194fa13a2e04ef582c36 (patch)
treedc99c11e6bf21288957f45663a6e4ed7103e65db /src/live_effects/parameter/path.cpp
parentAllow LPE clip or mask hasent effect applied (diff)
downloadinkscape-5f75967b19b3cc95f249194fa13a2e04ef582c36.tar.gz
inkscape-5f75967b19b3cc95f249194fa13a2e04ef582c36.zip
Force not original-d if the clip-path or mask has not a LPE allowed to change it
(bzr r15707)
Diffstat (limited to 'src/live_effects/parameter/path.cpp')
-rw-r--r--src/live_effects/parameter/path.cpp104
1 files changed, 62 insertions, 42 deletions
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index 6e90c9279..54f5d93e8 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -69,7 +69,10 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip,
defvalue = g_strdup(default_value);
param_readSVGValue(defvalue);
oncanvas_editable = true;
-
+ _edit_button = true;
+ _copy_button = true;
+ _paste_button = true;
+ _link_button = true;
ref_changed_connection = ref.changedSignal().connect(sigc::mem_fun(*this, &PathParam::ref_changed));
}
@@ -167,6 +170,15 @@ PathParam::param_getSVGValue() const
}
}
+void
+PathParam::set_buttons(bool edit_button, bool copy_button, bool paste_button, bool link_button)
+{
+ _edit_button = edit_button;
+ _copy_button = copy_button;
+ _paste_button = paste_button;
+ _link_button = link_button;
+}
+
Gtk::Widget *
PathParam::param_newWidget()
{
@@ -175,47 +187,55 @@ PathParam::param_newWidget()
Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true);
pLabel->set_tooltip_text(param_tooltip);
-
- Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) );
- Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
- pButton->set_relief(Gtk::RELIEF_NONE);
- pIcon->show();
- pButton->add(*pIcon);
- pButton->show();
- pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
- pButton->set_tooltip_text(_("Edit on-canvas"));
-
- pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) );
- pButton = Gtk::manage(new Gtk::Button());
- pButton->set_relief(Gtk::RELIEF_NONE);
- pIcon->show();
- pButton->add(*pIcon);
- pButton->show();
- pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_copy_button_click));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
- pButton->set_tooltip_text(_("Copy path"));
-
- pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) );
- pButton = Gtk::manage(new Gtk::Button());
- pButton->set_relief(Gtk::RELIEF_NONE);
- pIcon->show();
- pButton->add(*pIcon);
- pButton->show();
- pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
- pButton->set_tooltip_text(_("Paste path"));
-
- pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) );
- pButton = Gtk::manage(new Gtk::Button());
- pButton->set_relief(Gtk::RELIEF_NONE);
- pIcon->show();
- pButton->add(*pIcon);
- pButton->show();
- pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_link_button_click));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
- pButton->set_tooltip_text(_("Link to path on clipboard"));
-
+ Gtk::Widget * pIcon = NULL;
+ Gtk::Button * pButton = NULL;
+ if (_edit_button) {
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) );
+ pButton = Gtk::manage(new Gtk::Button());
+ pButton->set_relief(Gtk::RELIEF_NONE);
+ pIcon->show();
+ pButton->add(*pIcon);
+ pButton->show();
+ pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click));
+ static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
+ pButton->set_tooltip_text(_("Edit on-canvas"));
+ }
+
+ if (_copy_button) {
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) );
+ pButton = Gtk::manage(new Gtk::Button());
+ pButton->set_relief(Gtk::RELIEF_NONE);
+ pIcon->show();
+ pButton->add(*pIcon);
+ pButton->show();
+ pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_copy_button_click));
+ static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
+ pButton->set_tooltip_text(_("Copy path"));
+ }
+
+ if (_paste_button) {
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) );
+ pButton = Gtk::manage(new Gtk::Button());
+ pButton->set_relief(Gtk::RELIEF_NONE);
+ pIcon->show();
+ pButton->add(*pIcon);
+ pButton->show();
+ pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click));
+ static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
+ pButton->set_tooltip_text(_("Paste path"));
+ }
+ if (_link_button) {
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) );
+ pButton = Gtk::manage(new Gtk::Button());
+ pButton->set_relief(Gtk::RELIEF_NONE);
+ pIcon->show();
+ pButton->add(*pIcon);
+ pButton->show();
+ pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_link_button_click));
+ static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
+ pButton->set_tooltip_text(_("Link to path on clipboard"));
+ }
+
static_cast<Gtk::HBox*>(_widget)->show_all_children();
return dynamic_cast<Gtk::Widget *> (_widget);