mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +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
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include "CalculatorWidget.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
@ -76,7 +75,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("Calculator", Gfx::load_png("/res/icons/16x16/app-calculator.png"), window);
|
||||
GUI::AboutDialog::show("Calculator", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-calculator.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "ItemListModel.h"
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/CDirIterator.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
|
@ -151,7 +150,7 @@ void DisplayPropertiesWidget::create_frame()
|
|||
m_selected_wallpaper = m_wallpapers.at(index.row());
|
||||
builder.append("/res/wallpapers/");
|
||||
builder.append(m_selected_wallpaper);
|
||||
m_wallpaper_preview->set_icon(Gfx::load_png(builder.to_string()));
|
||||
m_wallpaper_preview->set_icon(Gfx::Bitmap::load_from_file(builder.to_string()));
|
||||
m_wallpaper_preview->set_should_stretch_icon(true);
|
||||
};
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include "DisplayProperties.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
@ -58,7 +57,7 @@ int main(int argc, char** argv)
|
|||
window->resize(400, 448);
|
||||
window->set_resizable(false);
|
||||
window->set_main_widget(instance.root_widget());
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-display-properties.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-properties.png"));
|
||||
|
||||
// Let's create the menubar first
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
|
@ -71,7 +70,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("Display Properties", Gfx::load_png("/res/icons/32x32/app-display-properties.png"), window);
|
||||
GUI::AboutDialog::show("Display Properties", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-display-properties.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/CConfigFile.h>
|
||||
#include <LibCore/CUserInfo.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GActionGroup.h>
|
||||
|
@ -445,7 +444,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("File Manager", Gfx::load_png("/res/icons/32x32/filetype-folder.png"), window);
|
||||
GUI::AboutDialog::show("File Manager", Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-folder.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
@ -587,7 +586,7 @@ int main(int argc, char** argv)
|
|||
window->set_main_widget(widget);
|
||||
window->show();
|
||||
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/filetype-folder.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-folder.png"));
|
||||
|
||||
// Read direcory read mode from config.
|
||||
auto dir_view_mode = config->read_entry("DirectoryView", "ViewMode", "Icon");
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include "FontEditor.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
@ -71,7 +70,7 @@ int main(int argc, char** argv)
|
|||
auto font_editor = FontEditorWidget::construct(path, move(edited_font));
|
||||
window->set_main_widget(font_editor);
|
||||
window->show();
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-font-editor.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"));
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
|
||||
|
@ -84,7 +83,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("Font Editor", Gfx::load_png("/res/icons/FontEditor.png"), window);
|
||||
GUI::AboutDialog::show("Font Editor", Gfx::Bitmap::load_from_file("/res/icons/FontEditor.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "ManualNode.h"
|
||||
#include "ManualPageNode.h"
|
||||
#include "ManualSectionNode.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
|
||||
static ManualSectionNode s_sections[] = {
|
||||
{ "1", "Command-line programs" },
|
||||
|
@ -44,8 +43,8 @@ static ManualSectionNode s_sections[] = {
|
|||
ManualModel::ManualModel()
|
||||
{
|
||||
// FIXME: need some help from the icon fairy ^)
|
||||
m_section_icon.set_bitmap_for_size(16, Gfx::load_png("/res/icons/16x16/book.png"));
|
||||
m_page_icon.set_bitmap_for_size(16, Gfx::load_png("/res/icons/16x16/filetype-unknown.png"));
|
||||
m_section_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/book.png"));
|
||||
m_page_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"));
|
||||
}
|
||||
|
||||
String ManualModel::page_path(const GUI::ModelIndex& index) const
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <AK/Optional.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
|
@ -202,7 +201,7 @@ HexEditorWidget::HexEditorWidget()
|
|||
|
||||
auto help_menu = GUI::Menu::construct("Help");
|
||||
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
|
||||
GUI::AboutDialog::show("Hex Editor", Gfx::load_png("/res/icons/32x32/app-hexeditor.png"), window());
|
||||
GUI::AboutDialog::show("Hex Editor", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hexeditor.png"), window());
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include "HexEditorWidget.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -56,7 +55,7 @@ int main(int argc, char** argv)
|
|||
};
|
||||
|
||||
window->show();
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-hexeditor.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hexeditor.png"));
|
||||
|
||||
if (argc >= 2)
|
||||
hex_editor_widget->open_file(argv[1]);
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "IRCChannel.h"
|
||||
#include "IRCWindow.h"
|
||||
#include "IRCWindowListModel.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
@ -55,7 +54,7 @@ IRCAppWindow::IRCAppWindow()
|
|||
ASSERT(!s_the);
|
||||
s_the = this;
|
||||
|
||||
set_icon(Gfx::load_png("/res/icons/16x16/app-irc-client.png"));
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-irc-client.png"));
|
||||
|
||||
update_title();
|
||||
set_rect(200, 200, 600, 400);
|
||||
|
@ -170,7 +169,7 @@ void IRCAppWindow::setup_menus()
|
|||
|
||||
auto help_menu = GUI::Menu::construct("Help");
|
||||
help_menu->add_action(GUI::Action::create("About", [this](const GUI::Action&) {
|
||||
GUI::AboutDialog::show("IRC Client", Gfx::load_png("/res/icons/32x32/app-irc-client.png"), this);
|
||||
GUI::AboutDialog::show("IRC Client", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-irc-client.png"), this);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "PickerTool.h"
|
||||
#include "RectangleTool.h"
|
||||
#include "SprayTool.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
|
||||
|
@ -83,7 +82,7 @@ ToolboxWidget::ToolboxWidget(GUI::Widget* parent)
|
|||
button->set_checkable(true);
|
||||
button->set_exclusive(true);
|
||||
|
||||
button->set_icon(Gfx::load_png(String::format("/res/icons/paintbrush/%s.png", String(icon_name).characters())));
|
||||
button->set_icon(Gfx::Bitmap::load_from_file(String::format("/res/icons/paintbrush/%s.png", String(icon_name).characters())));
|
||||
|
||||
button->on_checked = [button = button.ptr()](auto checked) {
|
||||
if (checked)
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "PaintableWidget.h"
|
||||
#include "PaletteWidget.h"
|
||||
#include "ToolboxWidget.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
@ -56,7 +55,7 @@ int main(int argc, char** argv)
|
|||
auto window = GUI::Window::construct();
|
||||
window->set_title("PaintBrush");
|
||||
window->set_rect(100, 100, 640, 480);
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-paintbrush.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-paintbrush.png"));
|
||||
|
||||
auto horizontal_container = GUI::Widget::construct();
|
||||
window->set_main_widget(horizontal_container);
|
||||
|
@ -84,7 +83,7 @@ int main(int argc, char** argv)
|
|||
if (!open_path.has_value())
|
||||
return;
|
||||
|
||||
auto bitmap = Gfx::load_png(open_path.value());
|
||||
auto bitmap = Gfx::Bitmap::load_from_file(open_path.value());
|
||||
if (!bitmap) {
|
||||
GUI::MessageBox::show(String::format("Failed to load '%s'", open_path.value().characters()), "Open failed", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window);
|
||||
return;
|
||||
|
@ -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", [&](auto&) {
|
||||
GUI::AboutDialog::show("PaintBrush", Gfx::load_png("/res/icons/32x32/app-paintbrush.png"), window);
|
||||
GUI::AboutDialog::show("PaintBrush", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-paintbrush.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "MainWidget.h"
|
||||
#include <LibAudio/AClientConnection.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
@ -51,7 +50,7 @@ int main(int argc, char** argv)
|
|||
window->set_main_widget(main_widget);
|
||||
window->set_title("Piano");
|
||||
window->set_rect(90, 90, 840, 600);
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-piano.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-piano.png"));
|
||||
window->show();
|
||||
|
||||
LibThread::Thread audio_thread([&] {
|
||||
|
@ -82,7 +81,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("Piano", Gfx::load_png("/res/icons/32x32/app-piano.png"), window);
|
||||
GUI::AboutDialog::show("Piano", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-piano.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include "QSWidget.h"
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "ProcessTableView.h"
|
||||
#include "ProcessUnveiledPathsWidget.h"
|
||||
#include <LibCore/CTimer.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GActionGroup.h>
|
||||
|
@ -222,7 +221,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("System Monitor", Gfx::load_png("/res/icons/32x32/app-system-monitor.png"), window);
|
||||
GUI::AboutDialog::show("System Monitor", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-system-monitor.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
@ -251,7 +250,7 @@ int main(int argc, char** argv)
|
|||
|
||||
window->show();
|
||||
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-system-monitor.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-system-monitor.png"));
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <Kernel/KeyCode.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
#include <LibCore/CUserInfo.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GAboutDialog.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GActionGroup.h>
|
||||
|
@ -235,7 +234,7 @@ int main(int argc, char** argv)
|
|||
window->move_to(300, 300);
|
||||
terminal->apply_size_increments_to_window(*window);
|
||||
window->show();
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/app-terminal.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"));
|
||||
terminal->set_should_beep(config->read_bool_entry("Window", "AudibleBeep", false));
|
||||
|
||||
RefPtr<GUI::Window> settings_window;
|
||||
|
@ -253,7 +252,7 @@ int main(int argc, char** argv)
|
|||
exit(1);
|
||||
}
|
||||
}));
|
||||
app_menu->add_action(GUI::Action::create("Settings...", Gfx::load_png("/res/icons/gear16.png"),
|
||||
app_menu->add_action(GUI::Action::create("Settings...", Gfx::Bitmap::load_from_file("/res/icons/gear16.png"),
|
||||
[&](const GUI::Action&) {
|
||||
if (!settings_window) {
|
||||
settings_window = create_settings_window(*terminal);
|
||||
|
@ -300,7 +299,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("Terminal", Gfx::load_png("/res/icons/32x32/app-terminal.png"), window);
|
||||
GUI::AboutDialog::show("Terminal", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-terminal.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
|
@ -34,6 +33,7 @@
|
|||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GStackWidget.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <LibGfx/PNGLoader.h>
|
||||
|
||||
#include "TextWidget.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue