From 5ae629c910bd31486272c4dc7c31f450b7b454fd Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 26 Mar 2007 16:26:22 +0000 Subject: [PATCH] fix range, make integer, remove unnecessary document_done, fix 1635388 --- src/ui/widget/tolerance-slider.cpp | 13 +++++++------ src/ui/widget/tolerance-slider.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index fd98b0a37..f9a991c24 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -61,11 +61,13 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, Gtk::Label *theLabel1 = manage (new Gtk::Label (label1)); theLabel1->set_use_underline(); _hbox->add (*theLabel1); - _hscale = manage (new Gtk::HScale (0.4, 50.1, 0.1)); + _hscale = manage (new Gtk::HScale (1.0, 51, 1.0)); theLabel1->set_mnemonic_widget (*_hscale); _hscale->set_draw_value (true); _hscale->set_value_pos (Gtk::POS_RIGHT); _hscale->set_size_request (100, -1); + _old_val = 10; + _hscale->set_value (_old_val); _tt.set_tip (*_hscale, tip1); _hbox->add (*_hscale); _vbox->add (*_hbox); @@ -89,7 +91,7 @@ ToleranceSlider::setValue (double val) Gtk::Adjustment *adj = _hscale->get_adjustment(); adj->set_lower (1.0); - adj->set_upper (50.0); + adj->set_upper (51.0); adj->set_step_increment (1.0); if (val > 9999.9) // magic value 10000.0 @@ -125,6 +127,7 @@ ToleranceSlider::on_toggled() { if (_button->get_active()) { + _old_val = _hscale->get_value(); _hbox->set_sensitive (false); _hbox->show_all(); setValue (10000.0); @@ -134,8 +137,8 @@ ToleranceSlider::on_toggled() { _hbox->set_sensitive (true); _hbox->show_all(); - setValue (50.0); - update (50.0); + setValue (_old_val); + update (_old_val); } } @@ -161,8 +164,6 @@ ToleranceSlider::update (double val) repr->setAttribute(_key.c_str(), os.str().c_str()); doc->rroot->setAttribute("sodipodi:modified", "true"); sp_document_set_undo_sensitive (doc, saved); - sp_document_done (doc, SP_VERB_NONE, - /* TODO: annotate */ "tolerance-slider.cpp:173"); _wr->setUpdating (false); } diff --git a/src/ui/widget/tolerance-slider.h b/src/ui/widget/tolerance-slider.h index 5cca8d644..e395ede14 100644 --- a/src/ui/widget/tolerance-slider.h +++ b/src/ui/widget/tolerance-slider.h @@ -49,6 +49,7 @@ protected: Glib::ustring _key; sigc::connection _scale_changed_connection; sigc::connection _btn_toggled_connection; + double _old_val; }; -- 2.30.2