mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
PixelPaint: Use new format functions.
This commit is contained in:
parent
377afff33a
commit
0b29c5e41d
Notes:
sideshowbarker
2024-07-19 02:00:55 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/0b29c5e41d4 Pull-request: https://github.com/SerenityOS/serenity/pull/3699
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue