mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 15:55: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:
parent
f8b00aa290
commit
5c06c32df4
31 changed files with 48 additions and 77 deletions
|
@ -29,7 +29,6 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <AK/URL.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
|
@ -243,7 +242,7 @@ TextEditorWidget::TextEditorWidget()
|
|||
m_editor->set_focus(true);
|
||||
};
|
||||
|
||||
m_find_replace_action = GUI::Action::create("Find/Replace...", { Mod_Ctrl, Key_F }, Gfx::load_png("/res/icons/16x16/find.png"), [this](auto&) {
|
||||
m_find_replace_action = GUI::Action::create("Find/Replace...", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"), [this](auto&) {
|
||||
m_find_replace_widget->set_visible(true);
|
||||
m_find_widget->set_visible(true);
|
||||
m_replace_widget->set_visible(true);
|
||||
|
@ -384,7 +383,7 @@ TextEditorWidget::TextEditorWidget()
|
|||
|
||||
auto help_menu = GUI::Menu::construct("Help");
|
||||
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
|
||||
GUI::AboutDialog::show("Text Editor", Gfx::load_png("/res/icons/32x32/app-texteditor.png"), window());
|
||||
GUI::AboutDialog::show("Text Editor", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-texteditor.png"), window());
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue