Commit 1b2ca817 authored by Thibault Soucarre's avatar Thibault Soucarre
Browse files

correct a bug when changing color/visible many times before using apply button

parent e2bd249e
......@@ -208,8 +208,12 @@ void Settings_window::color_changed(string name, QTableWidget *table, const QCol
S.add_state_to_palette(name, palette_name, state_name, color, checked );
p->add_state(state_name, color, checked );
//_c->change_entity_color(state_name, color.get_red(), color.get_green(), color.get_blue());
if(_states_changes.count(state_name)>0)
_states_changes[state_name] = color;
else{
std::pair<std::string, Color> change(state_name, color);
_states_changes.insert(change);
}
return;
}
......@@ -234,9 +238,14 @@ void Settings_window::visible_changed(string name, QTableWidget *table, const bo
Color color(qc.red()/255, qc.green()/255, qc.blue()/255);
S.add_state_to_palette(name, palette_name, state_name, color, checked );
p->add_state(state_name, color, checked );
if(_states_visible_changes.count(state_name)>0)
_states_visible_changes[state_name] = checked;
else{
std::pair<std::string, bool> change(state_name, checked);
_states_visible_changes.insert(change);
}
return;
}
void Settings_window::add_table_line(QTableWidget *table,
const char *color_slot,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment