Skip to content

Commit

Permalink
imp padstack: set needs_save when toggling required
Browse files Browse the repository at this point in the history
changelog: Bugfixes/Padstack Editor: set needs save when toggling
required in parameter editor
  • Loading branch information
carrotIndustries committed Sep 27, 2024
1 parent 4970401 commit b979731
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/imp/imp_padstack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ void ImpPadstack::construct()
});

auto editor = new ParameterSetEditor(&core_padstack.parameter_set, false); //, &core_padstack.parameters_required);
editor->signal_create_extra_widget().connect([this](ParameterID id) {
editor->signal_create_extra_widget().connect([this, editor](ParameterID id) {
auto w = Gtk::manage(new Gtk::CheckButton("Required"));
w->set_tooltip_text("Parameter has to be set in pad");
w->set_active(core_padstack.parameters_required.count(id));
w->signal_toggled().connect([this, id, w] {
w->signal_toggled().connect([this, id, w, editor] {
if (w->get_active()) {
core_padstack.parameters_required.insert(id);
}
else {
core_padstack.parameters_required.erase(id);
}
editor->signal_changed().emit();
});
return w;
});
Expand Down

0 comments on commit b979731

Please sign in to comment.