summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3d225e)
raw | patch | inline | side by side (parent: f3d225e)
author | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Wed, 8 Aug 2007 06:15:42 +0000 (06:15 +0000) | ||
committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Wed, 8 Aug 2007 06:15:42 +0000 (06:15 +0000) |
* Removed the "Filter" option from the Blend mode combobox in the Fill and Stroke dialog.
index 126deff3834967a3ffea298331b3ce40d333af30..7bd5e4b43a0f6c550e1aa91cb0912dcef5c0a3a5 100644 (file)
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()));
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) {
index d43093dafccbcbdd42c9fc547981fa01ba60cc7a..8cf6bcfb484839b26b19ce18f8ec5415ca657f80 100644 (file)
_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
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) {
index 0820a2f28edf1f0d46ae48b3809995d8fafd5686..bf71c33d158263c96d00c6bdf656d8c6f12a3506 100644 (file)
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<void> 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<void>& SimpleFilterModifier::signal_blend_blur_changed()
_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();
- }
-}
-
}
}
}
index 6733fb7845515c433c205eedbfce44af791c1fed..673118ac3e24349862e6513e068ece9c5e8096d9 100644 (file)
public:
virtual ~FilterEffectChooser();
- virtual SPFilter* get_selected_filter() = 0;
- virtual void select_filter(const SPFilter*) = 0;
protected:
FilterEffectChooser();
/* 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<void> signal_selection_changed();
- virtual SPFilter* get_selected_filter();
- virtual void select_filter(const SPFilter*);
-
sigc::signal<void>& signal_blend_blur_changed();
const Glib::ustring get_blend_mode();
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<NR::FilterBlendMode> _blend;
SpinSlider _blur;
- Gtk::ComboBox _filter;
- Gtk::Button _edit_filters;
sigc::signal<void> _signal_blend_blur_changed;
};