Add String::remove_char(s) methods for performance and convenience

This commit is contained in:
A Thousand Ships 2024-05-28 12:55:07 +02:00
parent cae3d722a3
commit 331a43a9d8
No known key found for this signature in database
GPG key ID: DEFC5A5B1306947D
35 changed files with 221 additions and 54 deletions

View file

@ -721,7 +721,7 @@ void ColorPicker::_update_presets() {
}
if (palette_edited) {
palette_name->set_text(vformat("%s*", palette_name->get_text().replace("*", "")));
palette_name->set_text(vformat("%s*", palette_name->get_text().remove_char('*')));
palette_name->set_tooltip_text(ETR("The changes to this palette have not been saved to a file."));
}
}
@ -1086,7 +1086,7 @@ void ColorPicker::erase_preset(const Color &p_color) {
}
}
palette_name->set_text(vformat("%s*", palette_name->get_text().replace("*", "")));
palette_name->set_text(vformat("%s*", palette_name->get_text().remove_char('*')));
palette_name->set_tooltip_text(ETR("The changes to this palette have not been saved to a file."));
if (presets.is_empty()) {
palette_name->set_text("");