1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:05:08 +00:00

LibGfx: Prefer using Gfx::Bitmap::load_from_file instead of load_png()

Code that just wants to open a Gfx::Bitmap from a file should not be
calling the PNG codec directly.
This commit is contained in:
Andreas Kling 2020-02-06 13:39:17 +01:00
parent f8b00aa290
commit 5c06c32df4
31 changed files with 48 additions and 77 deletions

View file

@ -27,7 +27,6 @@
#include "History.h"
#include "ManualModel.h"
#include <LibCore/CFile.h>
#include <LibGfx/PNGLoader.h>
#include <LibGUI/GAboutDialog.h>
#include <LibGUI/GAction.h>
#include <LibGUI/GApplication.h>
@ -180,7 +179,7 @@ int main(int argc, char* argv[])
auto app_menu = GUI::Menu::construct("Help");
app_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
GUI::AboutDialog::show("Help", Gfx::load_png("/res/icons/16x16/book.png"), window);
GUI::AboutDialog::show("Help", Gfx::Bitmap::load_from_file("/res/icons/16x16/book.png"), window);
}));
app_menu->add_separator();
app_menu->add_action(GUI::CommonActions::make_quit_action([](auto&) {
@ -199,7 +198,7 @@ int main(int argc, char* argv[])
window->set_focused_widget(tree_view);
window->show();
window->set_icon(Gfx::load_png("/res/icons/16x16/book.png"));
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/book.png"));
return app.exec();
}