1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:35:07 +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

@ -26,7 +26,6 @@
#include "BoardListModel.h"
#include "ThreadCatalogModel.h"
#include <LibGfx/PNGLoader.h>
#include <LibGUI/GAboutDialog.h>
#include <LibGUI/GAction.h>
#include <LibGUI/GApplication.h>
@ -55,7 +54,7 @@ int main(int argc, char** argv)
auto window = GUI::Window::construct();
window->set_title("ChanViewer");
window->set_rect(100, 100, 800, 500);
window->set_icon(Gfx::load_png("/res/icons/16x16/app-chanviewer.png"));
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-chanviewer.png"));
auto widget = GUI::Widget::construct();
window->set_main_widget(widget);
@ -104,7 +103,7 @@ int main(int argc, char** argv)
auto help_menu = GUI::Menu::construct("Help");
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
GUI::AboutDialog::show("ChanViewer", Gfx::load_png("/res/icons/32x32/app-chanviewer.png"), window);
GUI::AboutDialog::show("ChanViewer", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-chanviewer.png"), window);
}));
menubar->add_menu(move(help_menu));