From: johanengelen Date: Sat, 26 Jan 2008 02:06:29 +0000 (+0000) Subject: gray out widgets when grid is disabled. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cb94fe1f50d7c581f57b7fe6fbf2ff7e022791fd;p=inkscape.git gray out widgets when grid is disabled. --- diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index c9aec455e..f4f23764a 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -332,7 +332,13 @@ CanvasGrid::newWidget() vbox->pack_start(*_rcb_enabled, true, true); vbox->pack_start(*_rcb_visible, true, true); - vbox->pack_start(*newSpecificWidget(), true, true); + Gtk::Widget * gridwdg = newSpecificWidget(); + vbox->pack_start(*gridwdg, true, true); + + std::list slaves; + slaves.push_back(_rcb_visible); + slaves.push_back(gridwdg); + _rcb_enabled->setSlaveWidgets(slaves); // set widget values _rcb_visible->setActive(visible); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 4ed23d7b2..5ed737cf7 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -290,21 +290,21 @@ DocumentProperties::build_snap() //Other options to locate here: e.g. visual snapping indicators on/off - std::list slaves; + std::list slaves; slaves.push_back(&_rcbsnop); slaves.push_back(&_rcbsnon); - _rcbsnn.setSlaveButton(slaves); + _rcbsnn.setSlaveWidgets(slaves); slaves.clear(); slaves.push_back(&_rcbsnbbp); slaves.push_back(&_rcbsnbbn); - _rcbsnbb.setSlaveButton(slaves); + _rcbsnbb.setSlaveWidgets(slaves); slaves.clear(); slaves.push_back(&_rcbsnn); slaves.push_back(&_rcbsnbb); - _rcbsg.setSlaveButton(slaves); + _rcbsg.setSlaveWidgets(slaves); Gtk::Label *label_g = manage (new Gtk::Label); label_g->set_markup (_("Snapping")); diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 629de910f..f8abecdbe 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -98,7 +98,7 @@ RegisteredCheckButton::setActive (bool b) setProgrammatically = true; set_active (b); //The slave button is greyed out if the master button is unchecked - for (std::list::const_iterator i = _slavebuttons.begin(); i != _slavebuttons.end(); i++) { + for (std::list::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); i++) { (*i)->set_sensitive(b); } setProgrammatically = false; @@ -118,7 +118,7 @@ RegisteredCheckButton::on_toggled() write_to_xml(get_active() ? "true" : "false"); //The slave button is greyed out if the master button is unchecked - for (std::list::const_iterator i = _slavebuttons.begin(); i != _slavebuttons.end(); i++) { + for (std::list::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); i++) { (*i)->set_sensitive(get_active()); } diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index e6281e0ef..42bcf62d7 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -179,13 +179,13 @@ public: void setActive (bool); - std::list _slavebuttons; + std::list _slavewidgets; // 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 btns) { - _slavebuttons = btns; + void setSlaveWidgets(std::list btns) { + _slavewidgets = btns; } bool setProgrammatically; // true if the value was set by setActive, not changed by the user;