From 3c67ff5f567c568139c94665518b4e01293feccd Mon Sep 17 00:00:00 2001 From: nicholasbishop Date: Wed, 8 Aug 2007 06:15:42 +0000 Subject: [PATCH] Filter effects: * Removed the "Filter" option from the Blend mode combobox in the Fill and Stroke dialog. --- src/dialogs/object-properties.cpp | 4 +- src/ui/dialog/fill-and-stroke.cpp | 3 +- src/ui/widget/filter-effect-chooser.cpp | 86 +------------------------ src/ui/widget/filter-effect-chooser.h | 18 +----- 4 files changed, 5 insertions(+), 106 deletions(-) diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index 126deff38..7bd5e4b43 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -197,8 +197,6 @@ sp_object_properties_dialog (void) gtk_alignment_set_padding(GTK_ALIGNMENT(al_fe), 0, 0, 4, 0); SimpleFilterModifier *cb_fe = Gtk::manage(new SimpleFilterModifier); g_object_set_data(G_OBJECT(dlg), "filter_modifier", cb_fe); - cb_fe->signal_selection_changed().connect( - sigc::bind(sigc::ptr_fun(sp_fillstroke_blend_blur_changed), cb_fe)); cb_fe->signal_blend_blur_changed().connect( sigc::bind(sigc::ptr_fun(sp_fillstroke_blend_blur_changed), cb_fe)); gtk_container_add(GTK_CONTAINER(al_fe), GTK_WIDGET(cb_fe->gobj())); @@ -432,7 +430,7 @@ sp_fillstroke_blend_blur_changed (SimpleFilterModifier *m) const Glib::ustring blendmode = m->get_blend_mode(); double radius = m->get_blur_value() * perimeter / 400; - SPFilter *filter = m->get_selected_filter(); + SPFilter *filter = NULL; const bool remfilter = (blendmode == "normal" && radius == 0) || (blendmode == "filter" && !filter); if(blendmode != "filter" || filter) { diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index d43093daf..8cf6bcfb4 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -89,7 +89,6 @@ FillAndStroke::FillAndStroke() _fe_alignment.add(_fe_cb); _fe_vbox.pack_start(_fe_alignment, false, false, 0); - _fe_cb.signal_selection_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::FillAndStroke::_blendBlurValueChanged)); _fe_cb.signal_blend_blur_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::FillAndStroke::_blendBlurValueChanged)); // Opacity @@ -171,7 +170,7 @@ FillAndStroke::_blendBlurValueChanged() const Glib::ustring blendmode = _fe_cb.get_blend_mode(); double radius = _fe_cb.get_blur_value() * perimeter / 400; - SPFilter *filter = _fe_cb.get_selected_filter(); + SPFilter *filter = 0; const bool remfilter = (blendmode == "normal" && radius == 0) || (blendmode == "filter" && !filter); if(blendmode != "filter" || filter) { diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 0820a2f28..bf71c33d1 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -81,72 +81,25 @@ void FilterEffectChooser::update_filters() SimpleFilterModifier::SimpleFilterModifier() : _lb_blend(_("_Blend mode:")), _lb_blur(_("B_lur:"), Gtk::ALIGN_LEFT), - _lb_filter(_("F_ilter:"), Gtk::ALIGN_LEFT), _blend(BlendModeConverter), - _blur(0, 0, 100, 1, 0.01, 1), - _edit_filters(_("_Edit")) + _blur(0, 0, 100, 1, 0.01, 1) { add(_hb_blend); add(_vb_blur); - add(_hb_filter); _hb_blend.pack_start(_lb_blend, false, false); _hb_blend.pack_start(_blend); _vb_blur.add(_lb_blur); _vb_blur.add(_blur); - _hb_filter.pack_start(_lb_filter, false, false); - _hb_filter.pack_start(_hb_filter_sub); - _hb_filter_sub.add(_filter); - _hb_filter_sub.add(_edit_filters); show_all_children(); - signal_show().connect(sigc::mem_fun(*this, &SimpleFilterModifier::blend_mode_changed)); _hb_blend.set_spacing(12); - _hb_filter.set_spacing(12); _lb_blend.set_use_underline(); _lb_blend.set_mnemonic_widget(_blend); _lb_blur.set_use_underline(); _lb_blur.set_mnemonic_widget(_blur.get_scale()); - _lb_filter.set_use_underline(); - _lb_filter.set_mnemonic_widget(_filter); - _blend.add_row("Filter"); - _blend.signal_changed().connect(sigc::mem_fun(*this, &SimpleFilterModifier::blend_mode_changed)); _blend.signal_changed().connect(signal_blend_blur_changed()); _blur.signal_value_changed().connect(signal_blend_blur_changed()); - _filter.set_model(_model); - _filter.pack_start(_columns.label); - _edit_filters.signal_clicked().connect(sigc::mem_fun(*this, &SimpleFilterModifier::show_filter_dialog)); - _edit_filters.set_use_underline(); - - update_filters(); -} - -Glib::SignalProxy0 SimpleFilterModifier::signal_selection_changed() -{ - return _filter.signal_changed(); -} - -SPFilter* SimpleFilterModifier::get_selected_filter() -{ - Gtk::TreeModel::iterator i = _filter.get_active(); - - if(i) - return (*i)[_columns.filter]; - - return 0; -} - -void SimpleFilterModifier::select_filter(const SPFilter* filter) -{ - if(filter) { - for(Gtk::TreeModel::iterator i = _model->children().begin(); - i != _model->children().end(); ++i) { - if((*i)[_columns.filter] == filter) { - _filter.set_active(i); - break; - } - } - } } sigc::signal& SimpleFilterModifier::signal_blend_blur_changed() @@ -179,43 +132,6 @@ void SimpleFilterModifier::set_blur_sensitive(const bool s) _blur.set_sensitive(s); } -void SimpleFilterModifier::update_filters() -{ - const SPFilter* active_filter = get_selected_filter(); - - FilterEffectChooser::update_filters(); - - if(_model->children().empty()) { - // Set state if no filters exist - Gtk::TreeModel::Row row = *_model->prepend(); - row[_columns.filter] = 0; - row[_columns.label] = "None"; - _filter.set_sensitive(false); - _filter.set_active(0); - } - else { - _filter.set_sensitive(true); - select_filter(active_filter); - } -} - -void SimpleFilterModifier::show_filter_dialog() -{ - SP_ACTIVE_DESKTOP->_dlg_mgr->showDialog("FilterEffectsDialog"); -} - -void SimpleFilterModifier::blend_mode_changed() -{ - if(_blend.get_active_row_number() == 5) { - _vb_blur.hide(); - _hb_filter.show(); - } - else { - _hb_filter.hide(); - _vb_blur.show(); - } -} - } } } diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index 6733fb784..673118ac3 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -32,8 +32,6 @@ class FilterEffectChooser public: virtual ~FilterEffectChooser(); - virtual SPFilter* get_selected_filter() = 0; - virtual void select_filter(const SPFilter*) = 0; protected: FilterEffectChooser(); @@ -68,15 +66,11 @@ private: /* Allows basic control over feBlend and feGaussianBlur effects, with an option to use the full filter effect controls. */ -class SimpleFilterModifier : public Gtk::VBox, public FilterEffectChooser +class SimpleFilterModifier : public Gtk::VBox { public: SimpleFilterModifier(); - Glib::SignalProxy0 signal_selection_changed(); - virtual SPFilter* get_selected_filter(); - virtual void select_filter(const SPFilter*); - sigc::signal& signal_blend_blur_changed(); const Glib::ustring get_blend_mode(); @@ -86,20 +80,12 @@ public: double get_blur_value() const; void set_blur_value(const double); void set_blur_sensitive(const bool); -protected: - virtual void update_filters(); private: - void show_filter_dialog(); - void blend_mode_changed(); - Gtk::HBox _hb_blend; Gtk::VBox _vb_blur; - Gtk::HBox _hb_filter, _hb_filter_sub; - Gtk::Label _lb_blend, _lb_blur, _lb_filter; + Gtk::Label _lb_blend, _lb_blur; ComboBoxEnum _blend; SpinSlider _blur; - Gtk::ComboBox _filter; - Gtk::Button _edit_filters; sigc::signal _signal_blend_blur_changed; }; -- 2.30.2