summaryrefslogtreecommitdiff
path: root/Applications/TextEditor
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 13:39:17 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 13:39:17 +0100
commit5c06c32df4062a17e1caf7aa01ee51e87852070a (patch)
tree1590bbe4af3624accc6e30575c9ec6a64d692890 /Applications/TextEditor
parentf8b00aa29010cc3a99b285d0afd88314c40be079 (diff)
downloadserenity-5c06c32df4062a17e1caf7aa01ee51e87852070a.zip
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.
Diffstat (limited to 'Applications/TextEditor')
-rw-r--r--Applications/TextEditor/TextEditorWidget.cpp5
-rw-r--r--Applications/TextEditor/main.cpp3
2 files changed, 3 insertions, 5 deletions
diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp
index a90ae23083..1ccc84c792 100644
--- a/Applications/TextEditor/TextEditorWidget.cpp
+++ b/Applications/TextEditor/TextEditorWidget.cpp
@@ -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));
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp
index 8eb1f65867..dd94f70d43 100644
--- a/Applications/TextEditor/main.cpp
+++ b/Applications/TextEditor/main.cpp
@@ -25,7 +25,6 @@
*/
#include "TextEditorWidget.h"
-#include <LibGfx/PNGLoader.h>
#include <stdio.h>
int main(int argc, char** argv)
@@ -61,7 +60,7 @@ int main(int argc, char** argv)
text_widget->open_sesame(argv[1]);
window->show();
- window->set_icon(Gfx::load_png("/res/icons/TextEditor16.png"));
+ window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/TextEditor16.png"));
return app.exec();
}