From: mental Date: Tue, 1 Jan 2008 04:40:48 +0000 (+0000) Subject: make blend versus blur more configurable on a case-by-case basis X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be6c4327fc304962b439fd503536678e029ad51d;p=inkscape.git make blend versus blur more configurable on a case-by-case basis --- diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index cec32426d..480b60b63 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -673,7 +673,7 @@ LayersPanel::LayersPanel() : _model(0), _pending(0), _toggleEvent(0), - _compositeSettings(SP_VERB_DIALOG_LAYERS, "layers") + _compositeSettings(SP_VERB_DIALOG_LAYERS, "layers", UI::Widget::SimpleFilterModifier::BLEND) { _maxNestDepth = prefs_get_int_attribute_limited("dialogs.layers", "maxDepth", 20, 1, 1000); diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index dd9404933..e03b80d0e 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -43,7 +43,7 @@ FillAndStroke::FillAndStroke() _page_fill(1, 1, true, true), _page_stroke_paint(1, 1, true, true), _page_stroke_style(1, 1, true, true), - _composite_settings(SP_VERB_DIALOG_FILL_STROKE, "fillstroke", true) + _composite_settings(SP_VERB_DIALOG_FILL_STROKE, "fillstroke", SimpleFilterModifier::BLEND | SimpleFilterModifier::BLUR) { Gtk::Box *contents = _getContents(); contents->set_spacing(0); diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index fb901526f..70db22843 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -21,17 +21,19 @@ namespace Inkscape { namespace UI { namespace Widget { -SimpleFilterModifier::SimpleFilterModifier(bool blur_enabled) +SimpleFilterModifier::SimpleFilterModifier(int flags) : _lb_blend(_("_Blend mode:")), _lb_blur(_("B_lur:"), Gtk::ALIGN_LEFT), _blend(BlendModeConverter), _blur(0, 0, 100, 1, 0.01, 1) { - add(_hb_blend); - add(_vb_blur); - _hb_blend.pack_start(_lb_blend, false, false); - _hb_blend.pack_start(_blend); - if (blur_enabled) { + if (flags & BLEND) { + add(_hb_blend); + _hb_blend.pack_start(_lb_blend, false, false); + _hb_blend.pack_start(_blend); + } + if (flags & BLUR) { + add(_vb_blur); _vb_blur.add(_lb_blur); _vb_blur.add(_blur); } diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index 740a7fe5e..141ec6bc0 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -32,7 +32,13 @@ namespace Widget { class SimpleFilterModifier : public Gtk::VBox { public: - SimpleFilterModifier(bool blur_enabled); + enum Flags { + NONE=0, + BLUR=1, + BLEND=2 + }; + + SimpleFilterModifier(int flags); sigc::signal& signal_blend_blur_changed(); @@ -43,6 +49,7 @@ public: double get_blur_value() const; void set_blur_value(const double); void set_blur_sensitive(const bool); + private: Gtk::HBox _hb_blend; Gtk::VBox _vb_blur; diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index 5c38a1370..b38775fc3 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -41,7 +41,7 @@ void ObjectCompositeSettings::_on_desktop_switch( } } -ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char const *history_prefix, bool blur_enabled) +ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char const *history_prefix, int flags) : _verb_code(verb_code), _blur_tag(Glib::ustring(history_prefix) + ":blur"), _opacity_tag(Glib::ustring(history_prefix) + ":opacity"), @@ -51,7 +51,7 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co _opacity_adjustment(100.0, 0.0, 100.0, 1.0, 1.0, 0.0), _opacity_hscale(_opacity_adjustment), _opacity_spin_button(_opacity_adjustment, 0.01, 1), - _fe_cb(blur_enabled), + _fe_cb(flags), _fe_vbox(false, 0), _fe_alignment(1, 1, 1, 1), _blocked(false) diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h index 6cef739d7..725a8a42b 100644 --- a/src/ui/widget/object-composite-settings.h +++ b/src/ui/widget/object-composite-settings.h @@ -31,7 +31,7 @@ namespace Widget { class ObjectCompositeSettings : public Gtk::VBox { public: - ObjectCompositeSettings(unsigned int verb_code, char const *history_prefix, bool blur_enabled=false); + ObjectCompositeSettings(unsigned int verb_code, char const *history_prefix, int flags); ~ObjectCompositeSettings(); void setSubject(StyleSubject *subject);