diff options
| author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-08-17 04:41:39 +0000 |
|---|---|---|
| committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | 2007-08-17 04:41:39 +0000 |
| commit | 01308ae4c17f2837f72d137c5559b50dea99e681 (patch) | |
| tree | 3ac5f9b60c0f04c32aeb82881d1ec2893cbef850 /src/ui | |
| parent | fixing export to ocal uri (diff) | |
| download | inkscape-01308ae4c17f2837f72d137c5559b50dea99e681.tar.gz inkscape-01308ae4c17f2837f72d137c5559b50dea99e681.zip | |
Filter effects dialog:
* Added most of the settings for feComponentTransfer to the filter dialog (still haven't done the table attribute)
(bzr r3488)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 25 | ||||
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.h | 1 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 60e2c8c8c..0e3727ce8 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -37,6 +37,7 @@ #include "selection.h" #include "sp-feblend.h" #include "sp-fecolormatrix.h" +#include "sp-fecomponenttransfer.h" #include "sp-fecomposite.h" #include "sp-feconvolvematrix.h" #include "sp-fedisplacementmap.h" @@ -1887,6 +1888,14 @@ void FilterEffectsDialog::init_settings_widgets() _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_COMPONENTTRANSFER); + _settings->add_combo(SP_ATTR_TYPE, _("Type"), ComponentTransferTypeConverter); + _ct_slope = _settings->add_spinslider(SP_ATTR_SLOPE, _("Slope"), -100, 100, 1, 0.01, 1); + _ct_intercept = _settings->add_spinslider(SP_ATTR_INTERCEPT, _("Intercept"), -100, 100, 1, 0.01, 1); + _ct_amplitude = _settings->add_spinslider(SP_ATTR_AMPLITUDE, _("Amplitude"), 0, 100, 1, 0.01, 1); + _ct_exponent = _settings->add_spinslider(SP_ATTR_EXPONENT, _("Exponent"), 0, 100, 1, 0.01, 1); + _ct_offset = _settings->add_spinslider(SP_ATTR_OFFSET, _("Offset"), -100, 100, 1, 0.01, 1); + _settings->type(NR_FILTER_COMPOSITE); _settings->add_combo(SP_ATTR_OPERATOR, _("Operator"), CompositeOperatorConverter); _k1 = _settings->add_spinslider(SP_ATTR_K1, _("K1"), -10, 10, 1, 0.01, 1); @@ -2032,6 +2041,8 @@ void FilterEffectsDialog::set_attr(SPObject* o, const SPAttributeEnum attr, cons void FilterEffectsDialog::update_settings_view() { + update_settings_sensitivity(); + if(_attr_lock) return; @@ -2046,8 +2057,6 @@ void FilterEffectsDialog::update_settings_view() _settings_box.show(); _empty_settings.show(); } - - update_settings_sensitivity(); } void FilterEffectsDialog::update_settings_sensitivity() @@ -2058,6 +2067,18 @@ void FilterEffectsDialog::update_settings_sensitivity() _k2->set_sensitive(use_k); _k3->set_sensitive(use_k); _k4->set_sensitive(use_k); + + if(SP_IS_FECOMPONENTTRANSFER(prim)) { + SPFeComponentTransfer* ct = SP_FECOMPONENTTRANSFER(prim); + const bool linear = ct->type == COMPONENTTRANSFER_TYPE_LINEAR; + const bool gamma = ct->type == COMPONENTTRANSFER_TYPE_GAMMA; + //_ct_table->set_sensitive(ct->type == COMPONENTTRANSFER_TYPE_TABLE || ct->type == COMPONENTTRANSFER_TYPE_DISCRETE); + _ct_slope->set_sensitive(linear); + _ct_intercept->set_sensitive(linear); + _ct_amplitude->set_sensitive(gamma); + _ct_exponent->set_sensitive(gamma); + _ct_offset->set_sensitive(gamma); + } } void FilterEffectsDialog::update_color_matrix() diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index ac7b96fd6..1a4285dd9 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -259,6 +259,7 @@ private: // For controlling setting sensitivity Gtk::Widget* _k1, *_k2, *_k3, *_k4; + Gtk::Widget* _ct_table, *_ct_slope, *_ct_intercept, *_ct_amplitude, *_ct_exponent, *_ct_offset; // To prevent unwanted signals bool _locked; |
