From c29bc9f0f21783dd6cb77baa516a91cf8e7a595d Mon Sep 17 00:00:00 2001 From: buliabyak Date: Tue, 10 Feb 2009 22:58:37 +0000 Subject: [PATCH] do not return any non-normal blend mode if we do not show blend mode chooser --- src/ui/widget/filter-effect-chooser.cpp | 15 ++++++++++----- src/ui/widget/filter-effect-chooser.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 5b5b70118..78ddbaa87 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -24,9 +24,11 @@ namespace Widget { SimpleFilterModifier::SimpleFilterModifier(int flags) : _lb_blend(_("_Blend mode:")), _lb_blur(_("B_lur:"), Gtk::ALIGN_LEFT), - _blend(BlendModeConverter), + _blend(BlendModeConverter, SP_ATTR_INVALID, false), _blur(0, 0, 100, 1, 0.01, 1) { + _flags = flags; + if (flags & BLEND) { add(_hb_blend); _hb_blend.pack_start(_lb_blend, false, false); @@ -56,14 +58,17 @@ sigc::signal& SimpleFilterModifier::signal_blend_blur_changed() const Glib::ustring SimpleFilterModifier::get_blend_mode() { + if (!(_flags & BLEND)) { + return "normal"; + } if (_blend.get_active_row_number() == 5) { - return "filter"; + return "normal"; } else { const Util::EnumData *d = _blend.get_active_data(); - if (d) + if (d) { return _blend.get_active_data()->key; - else - return "filter"; + } else + return "normal"; } } diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index e4e6796f4..7f2a980c3 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -51,6 +51,7 @@ public: void set_blur_sensitive(const bool); private: + int _flags; Gtk::HBox _hb_blend; Gtk::VBox _vb_blur; Gtk::Label _lb_blend, _lb_blur; -- 2.30.2