mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
PixelPaint: Use new format functions.
This commit is contained in:
parent
377afff33a
commit
0b29c5e41d
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_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
button.set_preferred_size(0, 32);
|
button.set_preferred_size(0, 32);
|
||||||
button.set_checkable(true);
|
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;
|
return button;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto bitmap = Gfx::Bitmap::load_from_file(open_path.value());
|
auto bitmap = Gfx::Bitmap::load_from_file(open_path.value());
|
||||||
if (!bitmap) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -158,7 +158,7 @@ int main(int argc, char** argv)
|
||||||
if (dialog->exec() == GUI::Dialog::ExecOK) {
|
if (dialog->exec() == GUI::Dialog::ExecOK) {
|
||||||
auto layer = PixelPaint::Layer::create_with_size(*image_editor.image(), dialog->layer_size(), dialog->layer_name());
|
auto layer = PixelPaint::Layer::create_with_size(*image_editor.image(), dialog->layer_size(), dialog->layer_name());
|
||||||
if (!layer) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
image_editor.image()->add_layer(layer.release_nonnull());
|
image_editor.image()->add_layer(layer.release_nonnull());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue