summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2007-08-06 18:40:50 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2007-08-06 18:40:50 +0000
commitc480481ea1cfe62c4f3b8b39df9b307669641d43 (patch)
tree769529c9f1679eae3644d938b8048335a75b5c8f /src/ui/widget
parentadds export to ocal feature without dialog window (diff)
downloadinkscape-c480481ea1cfe62c4f3b8b39df9b307669641d43.tar.gz
inkscape-c480481ea1cfe62c4f3b8b39df9b307669641d43.zip
1) Make snapping of object's center optional 2) Optimize snapping preferences dialog
(bzr r3399)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/registered-widget.cpp9
-rw-r--r--src/ui/widget/registered-widget.h9
-rw-r--r--src/ui/widget/tolerance-slider.cpp7
3 files changed, 23 insertions, 2 deletions
diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp
index 86c76b236..6ef264b0d 100644
--- a/src/ui/widget/registered-widget.cpp
+++ b/src/ui/widget/registered-widget.cpp
@@ -81,6 +81,10 @@ void
RegisteredCheckButton::setActive (bool b)
{
_button->set_active (b);
+ //The slave button is greyed out if the master button is unchecked
+ for (std::list<Gtk::ToggleButton*>::const_iterator i = _slavebuttons.begin(); i != _slavebuttons.end(); i++) {
+ (*i)->set_sensitive(b);
+ }
}
void
@@ -104,6 +108,11 @@ RegisteredCheckButton::on_toggled()
_wr->setUpdating (true);
+ //The slave button is greyed out if the master button is unchecked
+ for (std::list<Gtk::ToggleButton*>::const_iterator i = _slavebuttons.begin(); i != _slavebuttons.end(); i++) {
+ (*i)->set_sensitive(_button->get_active());
+ }
+
bool saved = sp_document_get_undo_sensitive (local_doc);
sp_document_set_undo_sensitive (local_doc, false);
sp_repr_set_boolean(local_repr, _key.c_str(), _button->get_active());
diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h
index 43588a831..8e54e1bbd 100644
--- a/src/ui/widget/registered-widget.h
+++ b/src/ui/widget/registered-widget.h
@@ -42,6 +42,15 @@ public:
void setActive (bool);
Gtk::ToggleButton *_button;
+ std::list<Gtk::ToggleButton*> _slavebuttons;
+
+ // a slave button is only sensitive when the master button is active
+ // i.e. a slave button is greyed-out when the master button is not checked
+
+ void setSlaveButton(std::list<Gtk::ToggleButton*> btns) {
+ _slavebuttons = btns;
+ }
+
protected:
Gtk::Tooltips _tt;
diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp
index 92a6f76bb..d89d4cf5c 100644
--- a/src/ui/widget/tolerance-slider.cpp
+++ b/src/ui/widget/tolerance-slider.cpp
@@ -72,7 +72,8 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2,
Gtk::Label *theLabel1 = manage (new Gtk::Label (label1));
theLabel1->set_use_underline();
theLabel1->set_alignment(0, 0.5);
- _hbox->add (*theLabel1);
+ // align the label with the checkbox text above by indenting 22 px.
+ _hbox->pack_start(*theLabel1, Gtk::PACK_EXPAND_WIDGET, 22);
_hscale = manage (new Gtk::HScale (1.0, 51, 1.0));
theLabel1->set_mnemonic_widget (*_hscale);
_hscale->set_draw_value (true);
@@ -83,6 +84,7 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2,
_tt.set_tip (*_hscale, tip1);
_hbox->add (*_hscale);
+
Gtk::Label *theLabel2 = manage (new Gtk::Label (label2));
theLabel2->set_use_underline();
_button = manage (new Gtk::CheckButton);
@@ -91,7 +93,8 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2,
_button->set_alignment (0.0, 0.5);
_vbox->add (*_button);
- _vbox->add (*_hbox);
+ // Here we need some extra pixels to get the vertical spacing right. Why?
+ _vbox->pack_end(*_hbox, true, true, 3); // add 3 px.
_key = key;
_scale_changed_connection = _hscale->signal_value_changed().connect (sigc::mem_fun (*this, &ToleranceSlider::on_scale_changed));
_btn_toggled_connection = _button->signal_toggled().connect (sigc::mem_fun (*this, &ToleranceSlider::on_toggled));