PixelPaint: Use new format functions.

This commit is contained in:
asynts 2020-10-06 14:28:58 +02:00 committed by Andreas Kling
parent 377afff33a
commit 0b29c5e41d
Notes: sideshowbarker 2024-07-19 02:00:55 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ void ToolboxWidget::setup_tools()
button.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
button.set_preferred_size(0, 32);
button.set_checkable(true);
button.set_icon(Gfx::Bitmap::load_from_file(String::format("/res/icons/pixelpaint/%s.png", icon_name.to_string().characters())));
button.set_icon(Gfx::Bitmap::load_from_file(String::formatted("/res/icons/pixelpaint/{}.png", icon_name)));
return button;
};

View file

@ -117,7 +117,7 @@ int main(int argc, char** argv)
auto bitmap = Gfx::Bitmap::load_from_file(open_path.value());
if (!bitmap) {
GUI::MessageBox::show(window, String::format("Failed to load '%s'", open_path.value().characters()), "Open failed", GUI::MessageBox::Type::Error);
GUI::MessageBox::show(window, String::formatted("Failed to load '{}'", open_path.value()), "Open failed", GUI::MessageBox::Type::Error);
return;
}
}));
@ -158,7 +158,7 @@ int main(int argc, char** argv)
if (dialog->exec() == GUI::Dialog::ExecOK) {
auto layer = PixelPaint::Layer::create_with_size(*image_editor.image(), dialog->layer_size(), dialog->layer_name());
if (!layer) {
GUI::MessageBox::show_error(window, String::format("Unable to create layer with size %s", dialog->size().to_string().characters()));
GUI::MessageBox::show_error(window, String::formatted("Unable to create layer with size {}", dialog->size().to_string()));
return;
}
image_editor.image()->add_layer(layer.release_nonnull());