summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c28f03b)
raw | patch | inline | side by side (parent: c28f03b)
author | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Sat, 28 Jul 2007 00:57:35 +0000 (00:57 +0000) | ||
committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Sat, 28 Jul 2007 00:57:35 +0000 (00:57 +0000) |
* Added settings widgets for feConvolveMatrix's target attribute
* Changed the order attribute to show both spin widgets on the same row
* Changed the order attribute to show both spin widgets on the same row
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history | |
src/ui/widget/spin-slider.cpp | patch | blob | history | |
src/ui/widget/spin-slider.h | patch | blob | history |
index ca68667dc90ca4143fd6baec0e1a82f8a06dfd1a..5e69fc456b9d2bab29aab0e163d3567bcaaa690d 100644 (file)
}
}
+ ~Settings()
+ {
+ for(int i = 0; i < NR_FILTER_ENDPRIMITIVETYPE; ++i) {
+ for(unsigned j = 0; j < _attrwidgets[i].size(); ++j)
+ delete _attrwidgets[i][j];
+ }
+ }
+
// Show the active settings group and update all the AttrWidgets with new values
void show_and_update(const NR::FilterPrimitiveType t)
{
sigc::bind(sigc::mem_fun(_dialog, &FilterEffectsDialog::set_attr_direct), attr, combo));
return combo;
}
+
+ // Combine the two most recent settings widgets in to the same row
+ void combine()
+ {
+ Gtk::VBox& vb = _groups[_current_type];
+ const int size = vb.children().size();
+ if(size >= 2) {
+ Gtk::HBox* h1 = dynamic_cast<Gtk::HBox*>(vb.children()[size - 2].get_widget());
+ Gtk::HBox* h2 = dynamic_cast<Gtk::HBox*>(vb.children()[size - 1].get_widget());
+ Gtk::Widget* c1 = h1->children()[1].get_widget();
+ Gtk::Widget* c2 = h2->children()[1].get_widget();
+ h1->remove(*c1);
+ h2->remove(*c2);
+ h1->pack_start(*c1, false, false);
+ h1->pack_start(*c2, false, false);
+ vb.remove(*h2);
+ }
+ }
private:
/* Adds a new settings widget using the specified label. The label will be formatted with a colon
and all widgets within the setting group are aligned automatically. */
_k4 = _settings->add(SP_ATTR_K4, _("K4"), -10, 10, 1, 0.01, 1);
_settings->type(NR_FILTER_CONVOLVEMATRIX);
- DualSpinSlider* order = _settings->add(SP_ATTR_ORDER, _("Rows"), _("Columns"), 1, 5, 1, 1, 0);
+ DualSpinSlider* order = _settings->add(SP_ATTR_ORDER, _("Size"), "", 1, 5, 1, 1, 0);
+ order->remove_scale();
+ _settings->combine();
+ SpinSlider* tx = _settings->add(SP_ATTR_TARGETX, _("Target"), 1, 5, 1, 1, 0);
+ tx->remove_scale();
+ SpinSlider* ty = _settings->add(SP_ATTR_TARGETY, "", 1, 5, 1, 1, 0);
+ ty->remove_scale();
+ _settings->combine();
ConvolveMatrix* convmat = _settings->add(SP_ATTR_KERNELMATRIX, _("Kernel"));
order->signal_value_changed().connect(
sigc::bind(sigc::mem_fun(*convmat, &ConvolveMatrix::update_direct), this));
- order->get_spinslider1().remove_scale();
- order->get_spinslider2().remove_scale();
_settings->add(SP_ATTR_DIVISOR, _("Divisor"), 0.01, 10, 1, 0.01, 1);
_settings->add(SP_ATTR_BIAS, _("Bias"), -10, 10, 1, 0.01, 1);
index 71c5921a944338e9e72d3a70ccfc6ef147372aa8..e777542e3e3eb79e390939327557cdbd4685692b 100644 (file)
_s2.set_update_policy(u);
}
+void DualSpinSlider::remove_scale()
+{
+ _s1.remove_scale();
+ _s2.remove_scale();
+}
+
} // namespace Widget
} // namespace UI
} // namespace Inkscape
index 1abc7cf3e6d9cd800d4b249465e401282430cb93..5c0272d2a0828179dfbc759aa61878cb067293ba 100644 (file)
SpinSlider& get_spinslider2();
void set_update_policy(const Gtk::UpdateType);
+
+ void remove_scale();
private:
sigc::signal<void> _signal_value_changed;
SpinSlider _s1, _s2;