summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-08-07 06:53:24 +0000
committernicholasbishop <nicholasbishop@users.sourceforge.net>2007-08-07 06:53:24 +0000
commit8c55e0bd53e0804d7e1918215da5c2c93383a688 (patch)
tree5daf499728d419d6ec7f3fcf0fba0ca89f74f7c4 /src/ui/dialog
parentenable Path_for_item to work on flowtext (diff)
downloadinkscape-8c55e0bd53e0804d7e1918215da5c2c93383a688.tar.gz
inkscape-8c55e0bd53e0804d7e1918215da5c2c93383a688.zip
Filter effects:
* Fixed a few bugs with the feColorMatrix settings, such as bad sensitivity settings and missing updates. * Changed matrix loading (for the values attribute of feColorMatrix) so that it can handle values separated by more than one space. (bzr r3407)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp47
-rw-r--r--src/ui/dialog/filter-effects-dialog.h4
2 files changed, 28 insertions, 23 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index edcb1e9ca..116d0ec89 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -330,12 +330,11 @@ private:
_tree.remove_all_columns();
- SPFeColorMatrix* col = 0;
- SPFeConvolveMatrix* conv = 0;
+ std::vector<gdouble>* values = NULL;
if(SP_IS_FECOLORMATRIX(o))
- col = SP_FECOLORMATRIX(o);
+ values = &SP_FECOLORMATRIX(o)->values;
else if(SP_IS_FECONVOLVEMATRIX(o))
- conv = SP_FECONVOLVEMATRIX(o);
+ values = &SP_FECONVOLVEMATRIX(o)->kernelMatrix;
else
return;
@@ -344,18 +343,15 @@ private:
for(int i = 0; i < cols; ++i) {
_tree.append_column_numeric_editable("", _columns.cols[i], "%.2f");
- dynamic_cast<Gtk::CellRendererText*>(_tree.get_column(i)->get_first_cell_renderer())->signal_edited().connect(
- sigc::mem_fun(*this, &MatrixAttr::rebind));
+ dynamic_cast<Gtk::CellRendererText*>(
+ _tree.get_column(i)->get_first_cell_renderer())->signal_edited().connect(
+ sigc::mem_fun(*this, &MatrixAttr::rebind));
}
for(int r = 0; r < rows; ++r) {
Gtk::TreeRow row = *(_model->append());
- for(int c = 0; c < cols; ++c, ++ndx) {
- if(col)
- row[_columns.cols[c]] = ndx < (int)col->values.size() ? col->values[ndx] : 0;
- else
- row[_columns.cols[c]] = ndx < (int)conv->kernelMatrix.size() ? conv->kernelMatrix[ndx] : 0;
- }
+ for(int c = 0; c < cols; ++c, ++ndx)
+ row[_columns.cols[c]] = ndx < (int)values->size() ? (*values)[ndx] : 0;
}
}
}
@@ -381,12 +377,15 @@ public:
_angle(0, 0, 360, 0.1, 0.01, 1, SP_ATTR_VALUES),
_label(_("None"), Gtk::ALIGN_LEFT)
{
+ _matrix.signal_attr_changed().connect(signal_attr_changed().make_slot());
+ _saturation.signal_attr_changed().connect(signal_attr_changed().make_slot());
+ _angle.signal_attr_changed().connect(signal_attr_changed().make_slot());
+
_matrix.show();
_saturation.show();
_angle.show();
-
- _label.set_sensitive(false);
_label.show();
+ _label.set_sensitive(false);
set_shadow_type(Gtk::SHADOW_NONE);
}
@@ -1653,8 +1652,9 @@ void FilterEffectsDialog::init_settings_widgets()
_settings->add_combo(SP_ATTR_MODE, _("Mode"), BlendModeConverter);
_settings->type(NR_FILTER_COLORMATRIX);
- _settings->add_combo(SP_ATTR_TYPE, _("Type"), ColorMatrixTypeConverter);
- _settings->add_colormatrixvalues(_("Value(s)"));
+ ComboBoxEnum<FilterColorMatrixType>* colmat = _settings->add_combo(SP_ATTR_TYPE, _("Type"), ColorMatrixTypeConverter);
+ _color_matrix_values = _settings->add_colormatrixvalues(_("Value(s)"));
+ colmat->signal_attr_changed().connect(sigc::mem_fun(*this, &FilterEffectsDialog::update_color_matrix));
_settings->type(NR_FILTER_COMPOSITE);
_settings->add_combo(SP_ATTR_OPERATOR, _("Operator"), CompositeOperatorConverter);
@@ -1794,14 +1794,10 @@ void FilterEffectsDialog::update_settings_view()
_settings_box.hide_all();
_settings_box.show();
- _settings_box.set_sensitive(false);
- _empty_settings.show();
-
- if(prim) {
+ if(prim)
_settings->show_and_update(FPConverter.get_id_from_key(prim->repr->name()), prim);
- _settings_box.set_sensitive(true);
- _empty_settings.hide();
- }
+ else
+ _empty_settings.show();
update_settings_sensitivity();
}
@@ -1816,6 +1812,11 @@ void FilterEffectsDialog::update_settings_sensitivity()
_k4->set_sensitive(use_k);
}
+void FilterEffectsDialog::update_color_matrix()
+{
+ _color_matrix_values->set_from_attribute(_primitive_list.get_selected());
+}
+
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h
index 9e272fbab..96fb481a0 100644
--- a/src/ui/dialog/filter-effects-dialog.h
+++ b/src/ui/dialog/filter-effects-dialog.h
@@ -179,6 +179,7 @@ private:
void set_attr(SPObject*, const SPAttributeEnum, const gchar* val);
void update_settings_view();
void update_settings_sensitivity();
+ void update_color_matrix();
// Filter effect selection
FilterModifier _filter_modifier;
@@ -200,6 +201,9 @@ private:
Settings* _settings;
Glib::RefPtr<Gtk::SizeGroup> _sizegroup;
+ // Color Matrix
+ ColorMatrixValues* _color_matrix_values;
+
// Convolve Matrix
MatrixAttr* _convolve_matrix;
DualSpinButton* _convolve_order;