mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 05:32:44 +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 "CalculatorWidget.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -76,7 +75,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #include "BoardListModel.h" | #include "BoardListModel.h" | ||||||
| #include "ThreadCatalogModel.h" | #include "ThreadCatalogModel.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -55,7 +54,7 @@ int main(int argc, char** argv) | ||||||
|     auto window = GUI::Window::construct(); |     auto window = GUI::Window::construct(); | ||||||
|     window->set_title("ChanViewer"); |     window->set_title("ChanViewer"); | ||||||
|     window->set_rect(100, 100, 800, 500); |     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(); |     auto widget = GUI::Widget::construct(); | ||||||
|     window->set_main_widget(widget); |     window->set_main_widget(widget); | ||||||
|  | @ -104,7 +103,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #include "ItemListModel.h" | #include "ItemListModel.h" | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibCore/CDirIterator.h> | #include <LibCore/CDirIterator.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
|  | @ -151,7 +150,7 @@ void DisplayPropertiesWidget::create_frame() | ||||||
|         m_selected_wallpaper = m_wallpapers.at(index.row()); |         m_selected_wallpaper = m_wallpapers.at(index.row()); | ||||||
|         builder.append("/res/wallpapers/"); |         builder.append("/res/wallpapers/"); | ||||||
|         builder.append(m_selected_wallpaper); |         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); |         m_wallpaper_preview->set_should_stretch_icon(true); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "DisplayProperties.h" | #include "DisplayProperties.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -58,7 +57,7 @@ int main(int argc, char** argv) | ||||||
|     window->resize(400, 448); |     window->resize(400, 448); | ||||||
|     window->set_resizable(false); |     window->set_resizable(false); | ||||||
|     window->set_main_widget(instance.root_widget()); |     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
 |     // Let's create the menubar first
 | ||||||
|     auto menubar = make<GUI::MenuBar>(); |     auto menubar = make<GUI::MenuBar>(); | ||||||
|  | @ -71,7 +70,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -31,7 +31,6 @@ | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibCore/CConfigFile.h> | #include <LibCore/CConfigFile.h> | ||||||
| #include <LibCore/CUserInfo.h> | #include <LibCore/CUserInfo.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GActionGroup.h> | #include <LibGUI/GActionGroup.h> | ||||||
|  | @ -445,7 +444,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  | @ -587,7 +586,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_main_widget(widget); |     window->set_main_widget(widget); | ||||||
|     window->show(); |     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.
 |     // Read direcory read mode from config.
 | ||||||
|     auto dir_view_mode = config->read_entry("DirectoryView", "ViewMode", "Icon"); |     auto dir_view_mode = config->read_entry("DirectoryView", "ViewMode", "Icon"); | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "FontEditor.h" | #include "FontEditor.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -71,7 +70,7 @@ int main(int argc, char** argv) | ||||||
|     auto font_editor = FontEditorWidget::construct(path, move(edited_font)); |     auto font_editor = FontEditorWidget::construct(path, move(edited_font)); | ||||||
|     window->set_main_widget(font_editor); |     window->set_main_widget(font_editor); | ||||||
|     window->show(); |     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>(); |     auto menubar = make<GUI::MenuBar>(); | ||||||
| 
 | 
 | ||||||
|  | @ -84,7 +83,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #include "ManualNode.h" | #include "ManualNode.h" | ||||||
| #include "ManualPageNode.h" | #include "ManualPageNode.h" | ||||||
| #include "ManualSectionNode.h" | #include "ManualSectionNode.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| 
 | 
 | ||||||
| static ManualSectionNode s_sections[] = { | static ManualSectionNode s_sections[] = { | ||||||
|     { "1", "Command-line programs" }, |     { "1", "Command-line programs" }, | ||||||
|  | @ -44,8 +43,8 @@ static ManualSectionNode s_sections[] = { | ||||||
| ManualModel::ManualModel() | ManualModel::ManualModel() | ||||||
| { | { | ||||||
|     // FIXME: need some help from the icon fairy ^)
 |     // 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_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::load_png("/res/icons/16x16/filetype-unknown.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 | String ManualModel::page_path(const GUI::ModelIndex& index) const | ||||||
|  |  | ||||||
|  | @ -27,7 +27,6 @@ | ||||||
| #include "History.h" | #include "History.h" | ||||||
| #include "ManualModel.h" | #include "ManualModel.h" | ||||||
| #include <LibCore/CFile.h> | #include <LibCore/CFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -180,7 +179,7 @@ int main(int argc, char* argv[]) | ||||||
| 
 | 
 | ||||||
|     auto app_menu = GUI::Menu::construct("Help"); |     auto app_menu = GUI::Menu::construct("Help"); | ||||||
|     app_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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_separator(); | ||||||
|     app_menu->add_action(GUI::CommonActions::make_quit_action([](auto&) { |     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->set_focused_widget(tree_view); | ||||||
|     window->show(); |     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(); |     return app.exec(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #include <AK/Optional.h> | #include <AK/Optional.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibCore/CFile.h> | #include <LibCore/CFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
|  | @ -202,7 +201,7 @@ HexEditorWidget::HexEditorWidget() | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "HexEditorWidget.h" | #include "HexEditorWidget.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | int main(int argc, char** argv) | ||||||
|  | @ -56,7 +55,7 @@ int main(int argc, char** argv) | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     window->show(); |     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) |     if (argc >= 2) | ||||||
|         hex_editor_widget->open_file(argv[1]); |         hex_editor_widget->open_file(argv[1]); | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #include "IRCChannel.h" | #include "IRCChannel.h" | ||||||
| #include "IRCWindow.h" | #include "IRCWindow.h" | ||||||
| #include "IRCWindowListModel.h" | #include "IRCWindowListModel.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -55,7 +54,7 @@ IRCAppWindow::IRCAppWindow() | ||||||
|     ASSERT(!s_the); |     ASSERT(!s_the); | ||||||
|     s_the = this; |     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(); |     update_title(); | ||||||
|     set_rect(200, 200, 600, 400); |     set_rect(200, 200, 600, 400); | ||||||
|  | @ -170,7 +169,7 @@ void IRCAppWindow::setup_menus() | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [this](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,7 +34,6 @@ | ||||||
| #include "PickerTool.h" | #include "PickerTool.h" | ||||||
| #include "RectangleTool.h" | #include "RectangleTool.h" | ||||||
| #include "SprayTool.h" | #include "SprayTool.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
| #include <LibGUI/GButton.h> | #include <LibGUI/GButton.h> | ||||||
| 
 | 
 | ||||||
|  | @ -83,7 +82,7 @@ ToolboxWidget::ToolboxWidget(GUI::Widget* parent) | ||||||
|         button->set_checkable(true); |         button->set_checkable(true); | ||||||
|         button->set_exclusive(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) { |         button->on_checked = [button = button.ptr()](auto checked) { | ||||||
|             if (checked) |             if (checked) | ||||||
|  |  | ||||||
|  | @ -27,7 +27,6 @@ | ||||||
| #include "PaintableWidget.h" | #include "PaintableWidget.h" | ||||||
| #include "PaletteWidget.h" | #include "PaletteWidget.h" | ||||||
| #include "ToolboxWidget.h" | #include "ToolboxWidget.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -56,7 +55,7 @@ int main(int argc, char** argv) | ||||||
|     auto window = GUI::Window::construct(); |     auto window = GUI::Window::construct(); | ||||||
|     window->set_title("PaintBrush"); |     window->set_title("PaintBrush"); | ||||||
|     window->set_rect(100, 100, 640, 480); |     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(); |     auto horizontal_container = GUI::Widget::construct(); | ||||||
|     window->set_main_widget(horizontal_container); |     window->set_main_widget(horizontal_container); | ||||||
|  | @ -84,7 +83,7 @@ int main(int argc, char** argv) | ||||||
|         if (!open_path.has_value()) |         if (!open_path.has_value()) | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|         auto bitmap = Gfx::load_png(open_path.value()); |         auto bitmap = Gfx::Bitmap::load_from_file(open_path.value()); | ||||||
|         if (!bitmap) { |         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); |             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; |             return; | ||||||
|  | @ -104,7 +103,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](auto&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,7 +29,6 @@ | ||||||
| #include "MainWidget.h" | #include "MainWidget.h" | ||||||
| #include <LibAudio/AClientConnection.h> | #include <LibAudio/AClientConnection.h> | ||||||
| #include <LibCore/CFile.h> | #include <LibCore/CFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -51,7 +50,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_main_widget(main_widget); |     window->set_main_widget(main_widget); | ||||||
|     window->set_title("Piano"); |     window->set_title("Piano"); | ||||||
|     window->set_rect(90, 90, 840, 600); |     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(); |     window->show(); | ||||||
| 
 | 
 | ||||||
|     LibThread::Thread audio_thread([&] { |     LibThread::Thread audio_thread([&] { | ||||||
|  | @ -82,7 +81,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "QSWidget.h" | #include "QSWidget.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
|  |  | ||||||
|  | @ -35,7 +35,6 @@ | ||||||
| #include "ProcessTableView.h" | #include "ProcessTableView.h" | ||||||
| #include "ProcessUnveiledPathsWidget.h" | #include "ProcessUnveiledPathsWidget.h" | ||||||
| #include <LibCore/CTimer.h> | #include <LibCore/CTimer.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GActionGroup.h> | #include <LibGUI/GActionGroup.h> | ||||||
|  | @ -222,7 +221,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  | @ -251,7 +250,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     window->show(); |     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(); |     return app.exec(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -27,7 +27,6 @@ | ||||||
| #include <Kernel/KeyCode.h> | #include <Kernel/KeyCode.h> | ||||||
| #include <LibCore/CArgsParser.h> | #include <LibCore/CArgsParser.h> | ||||||
| #include <LibCore/CUserInfo.h> | #include <LibCore/CUserInfo.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GActionGroup.h> | #include <LibGUI/GActionGroup.h> | ||||||
|  | @ -235,7 +234,7 @@ int main(int argc, char** argv) | ||||||
|     window->move_to(300, 300); |     window->move_to(300, 300); | ||||||
|     terminal->apply_size_increments_to_window(*window); |     terminal->apply_size_increments_to_window(*window); | ||||||
|     window->show(); |     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)); |     terminal->set_should_beep(config->read_bool_entry("Window", "AudibleBeep", false)); | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::Window> settings_window; |     RefPtr<GUI::Window> settings_window; | ||||||
|  | @ -253,7 +252,7 @@ int main(int argc, char** argv) | ||||||
|             exit(1); |             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&) { |         [&](const GUI::Action&) { | ||||||
|             if (!settings_window) { |             if (!settings_window) { | ||||||
|                 settings_window = create_settings_window(*terminal); |                 settings_window = create_settings_window(*terminal); | ||||||
|  | @ -300,7 +299,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,7 +29,6 @@ | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <AK/URL.h> | #include <AK/URL.h> | ||||||
| #include <LibCore/CFile.h> | #include <LibCore/CFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
|  | @ -243,7 +242,7 @@ TextEditorWidget::TextEditorWidget() | ||||||
|         m_editor->set_focus(true); |         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_replace_widget->set_visible(true); | ||||||
|         m_find_widget->set_visible(true); |         m_find_widget->set_visible(true); | ||||||
|         m_replace_widget->set_visible(true); |         m_replace_widget->set_visible(true); | ||||||
|  | @ -384,7 +383,7 @@ TextEditorWidget::TextEditorWidget() | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     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)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "TextEditorWidget.h" | #include "TextEditorWidget.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | int main(int argc, char** argv) | ||||||
|  | @ -61,7 +60,7 @@ int main(int argc, char** argv) | ||||||
|         text_widget->open_sesame(argv[1]); |         text_widget->open_sesame(argv[1]); | ||||||
| 
 | 
 | ||||||
|     window->show(); |     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(); |     return app.exec(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/String.h> | #include <AK/String.h> | ||||||
| #include <AK/Vector.h> | #include <AK/Vector.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
| #include <LibGUI/GButton.h> | #include <LibGUI/GButton.h> | ||||||
|  | @ -34,6 +33,7 @@ | ||||||
| #include <LibGUI/GLabel.h> | #include <LibGUI/GLabel.h> | ||||||
| #include <LibGUI/GStackWidget.h> | #include <LibGUI/GStackWidget.h> | ||||||
| #include <LibGUI/GWindow.h> | #include <LibGUI/GWindow.h> | ||||||
|  | #include <LibGfx/PNGLoader.h> | ||||||
| 
 | 
 | ||||||
| #include "TextWidget.h" | #include "TextWidget.h" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -43,7 +43,6 @@ | ||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
| #include <LibGUI/GLabel.h> | #include <LibGUI/GLabel.h> | ||||||
| #include <LibGUI/GPainter.h> | #include <LibGUI/GPainter.h> | ||||||
|  | @ -257,7 +256,7 @@ int main(int argc, char** argv) | ||||||
|     fire->set_stat_label(time); |     fire->set_stat_label(time); | ||||||
| 
 | 
 | ||||||
|     window->show(); |     window->show(); | ||||||
|     window->set_icon(Gfx::load_png("/res/icons/16x16/app-demo.png")); |     window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-demo.png")); | ||||||
| 
 | 
 | ||||||
|     return app.exec(); |     return app.exec(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -29,15 +29,14 @@ | ||||||
| #include "RemoteProcess.h" | #include "RemoteProcess.h" | ||||||
| #include <AK/JsonObject.h> | #include <AK/JsonObject.h> | ||||||
| #include <AK/JsonValue.h> | #include <AK/JsonValue.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
| RemoteObjectGraphModel::RemoteObjectGraphModel(RemoteProcess& process) | RemoteObjectGraphModel::RemoteObjectGraphModel(RemoteProcess& process) | ||||||
|     : m_process(process) |     : m_process(process) | ||||||
| { | { | ||||||
|     m_object_icon.set_bitmap_for_size(16, Gfx::load_png("/res/icons/16x16/inspector-object.png")); |     m_object_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png")); | ||||||
|     m_window_icon.set_bitmap_for_size(16, Gfx::load_png("/res/icons/16x16/window.png")); |     m_window_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png")); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| RemoteObjectGraphModel::~RemoteObjectGraphModel() | RemoteObjectGraphModel::~RemoteObjectGraphModel() | ||||||
|  |  | ||||||
|  | @ -32,7 +32,6 @@ | ||||||
| #include <AK/JsonObject.h> | #include <AK/JsonObject.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibCore/CFile.h> | #include <LibCore/CFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
| #include <LibGUI/GMenu.h> | #include <LibGUI/GMenu.h> | ||||||
|  | @ -63,13 +62,13 @@ VBForm::VBForm(const String& name, GUI::Widget* parent) | ||||||
|             widget->gwidget()->move_to_back(); |             widget->gwidget()->move_to_back(); | ||||||
|     })); |     })); | ||||||
|     m_context_menu->add_separator(); |     m_context_menu->add_separator(); | ||||||
|     m_context_menu->add_action(GUI::Action::create("Lay out horizontally", Gfx::load_png("/res/icons/16x16/layout-horizontally.png"), [this](auto&) { |     m_context_menu->add_action(GUI::Action::create("Lay out horizontally", Gfx::Bitmap::load_from_file("/res/icons/16x16/layout-horizontally.png"), [this](auto&) { | ||||||
|         if (auto* widget = single_selected_widget()) { |         if (auto* widget = single_selected_widget()) { | ||||||
|             dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout"; |             dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout"; | ||||||
|             widget->gwidget()->set_layout(make<GUI::HBoxLayout>()); |             widget->gwidget()->set_layout(make<GUI::HBoxLayout>()); | ||||||
|         } |         } | ||||||
|     })); |     })); | ||||||
|     m_context_menu->add_action(GUI::Action::create("Lay out vertically", Gfx::load_png("/res/icons/16x16/layout-vertically.png"), [this](auto&) { |     m_context_menu->add_action(GUI::Action::create("Lay out vertically", Gfx::Bitmap::load_from_file("/res/icons/16x16/layout-vertically.png"), [this](auto&) { | ||||||
|         if (auto* widget = single_selected_widget()) { |         if (auto* widget = single_selected_widget()) { | ||||||
|             dbg() << "Giving " << *widget->gwidget() << " a vertical box layout"; |             dbg() << "Giving " << *widget->gwidget() << " a vertical box layout"; | ||||||
|             widget->gwidget()->set_layout(make<GUI::VBoxLayout>()); |             widget->gwidget()->set_layout(make<GUI::VBoxLayout>()); | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #include "VBPropertiesWindow.h" | #include "VBPropertiesWindow.h" | ||||||
| #include "VBWidget.h" | #include "VBWidget.h" | ||||||
| #include "VBWidgetPropertyModel.h" | #include "VBWidgetPropertyModel.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -82,7 +81,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { | ||||||
|         GUI::AboutDialog::show("Visual Builder", Gfx::load_png("/res/icons/32x32/app-visual-builder.png"), window); |         GUI::AboutDialog::show("Visual Builder", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-visual-builder.png"), window); | ||||||
|     })); |     })); | ||||||
|     menubar->add_menu(move(help_menu)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #include "Field.h" | #include "Field.h" | ||||||
| #include <LibCore/CConfigFile.h> | #include <LibCore/CConfigFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -129,7 +128,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { | ||||||
|         GUI::AboutDialog::show("Minesweeper", Gfx::load_png("/res/icons/32x32/app-minesweeper.png"), window); |         GUI::AboutDialog::show("Minesweeper", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-minesweeper.png"), window); | ||||||
|     })); |     })); | ||||||
|     menubar->add_menu(move(help_menu)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  | @ -137,7 +136,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     window->show(); |     window->show(); | ||||||
| 
 | 
 | ||||||
|     window->set_icon(Gfx::load_png("/res/icons/minesweeper/mine.png")); |     window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/mine.png")); | ||||||
| 
 | 
 | ||||||
|     return app.exec(); |     return app.exec(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "SnakeGame.h" | #include "SnakeGame.h" | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAboutDialog.h> | #include <LibGUI/GAboutDialog.h> | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
|  | @ -74,7 +73,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto help_menu = GUI::Menu::construct("Help"); |     auto help_menu = GUI::Menu::construct("Help"); | ||||||
|     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { |     help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) { | ||||||
|         GUI::AboutDialog::show("Snake", Gfx::load_png("/res/icons/32x32/app-snake.png"), window); |         GUI::AboutDialog::show("Snake", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-snake.png"), window); | ||||||
|     })); |     })); | ||||||
|     menubar->add_menu(move(help_menu)); |     menubar->add_menu(move(help_menu)); | ||||||
| 
 | 
 | ||||||
|  | @ -82,7 +81,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     window->show(); |     window->show(); | ||||||
| 
 | 
 | ||||||
|     window->set_icon(Gfx::load_png("/res/icons/16x16/app-snake.png")); |     window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-snake.png")); | ||||||
| 
 | 
 | ||||||
|     return app.exec(); |     return app.exec(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/FileSystemPath.h> | #include <AK/FileSystemPath.h> | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GAction.h> | #include <LibGUI/GAction.h> | ||||||
| #include <LibGUI/GBoxLayout.h> | #include <LibGUI/GBoxLayout.h> | ||||||
| #include <LibGUI/GButton.h> | #include <LibGUI/GButton.h> | ||||||
|  | @ -254,7 +253,7 @@ FilePicker::~FilePicker() | ||||||
| void FilePicker::set_preview(const FileSystemPath& path) | void FilePicker::set_preview(const FileSystemPath& path) | ||||||
| { | { | ||||||
|     if (path.has_extension(".png")) { |     if (path.has_extension(".png")) { | ||||||
|         auto bitmap = Gfx::load_png(path.string()); |         auto bitmap = Gfx::Bitmap::load_from_file(path.string()); | ||||||
|         if (!bitmap) { |         if (!bitmap) { | ||||||
|             clear_preview(); |             clear_preview(); | ||||||
|             return; |             return; | ||||||
|  |  | ||||||
|  | @ -24,7 +24,6 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibHTML/CSS/StyleResolver.h> | #include <LibHTML/CSS/StyleResolver.h> | ||||||
| #include <LibHTML/DOM/Document.h> | #include <LibHTML/DOM/Document.h> | ||||||
| #include <LibHTML/DOM/HTMLImageElement.h> | #include <LibHTML/DOM/HTMLImageElement.h> | ||||||
|  |  | ||||||
|  | @ -26,11 +26,11 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/FileSystemPath.h> | #include <AK/FileSystemPath.h> | ||||||
| #include <LibCore/CFile.h> | #include <LibCore/CFile.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGUI/GApplication.h> | #include <LibGUI/GApplication.h> | ||||||
| #include <LibGUI/GPainter.h> | #include <LibGUI/GPainter.h> | ||||||
| #include <LibGUI/GScrollBar.h> | #include <LibGUI/GScrollBar.h> | ||||||
| #include <LibGUI/GWindow.h> | #include <LibGUI/GWindow.h> | ||||||
|  | #include <LibGfx/PNGLoader.h> | ||||||
| #include <LibHTML/DOM/Element.h> | #include <LibHTML/DOM/Element.h> | ||||||
| #include <LibHTML/DOM/ElementFactory.h> | #include <LibHTML/DOM/ElementFactory.h> | ||||||
| #include <LibHTML/DOM/HTMLAnchorElement.h> | #include <LibHTML/DOM/HTMLAnchorElement.h> | ||||||
|  |  | ||||||
|  | @ -31,7 +31,6 @@ | ||||||
| #include "WSWindow.h" | #include "WSWindow.h" | ||||||
| #include "WSWindowManager.h" | #include "WSWindowManager.h" | ||||||
| #include <LibGfx/Font.h> | #include <LibGfx/Font.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGfx/Painter.h> | #include <LibGfx/Painter.h> | ||||||
| #include <LibThread/BackgroundAction.h> | #include <LibThread/BackgroundAction.h> | ||||||
| 
 | 
 | ||||||
|  | @ -328,7 +327,7 @@ bool WSCompositor::set_wallpaper(const String& path, Function<void(bool)>&& call | ||||||
| { | { | ||||||
|     LibThread::BackgroundAction<RefPtr<Gfx::Bitmap>>::create( |     LibThread::BackgroundAction<RefPtr<Gfx::Bitmap>>::create( | ||||||
|         [path] { |         [path] { | ||||||
|             return Gfx::load_png(path); |             return Gfx::Bitmap::load_from_file(path); | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|         [this, path, callback = move(callback)](RefPtr<Gfx::Bitmap> bitmap) { |         [this, path, callback = move(callback)](RefPtr<Gfx::Bitmap> bitmap) { | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #include <AK/QuickSort.h> | #include <AK/QuickSort.h> | ||||||
| #include <LibCore/CDirIterator.h> | #include <LibCore/CDirIterator.h> | ||||||
| #include <LibGfx/Font.h> | #include <LibGfx/Font.h> | ||||||
| #include <LibGfx/PNGLoader.h> |  | ||||||
| #include <LibGfx/Painter.h> | #include <LibGfx/Painter.h> | ||||||
| #include <WindowServer/WSMenuManager.h> | #include <WindowServer/WSMenuManager.h> | ||||||
| #include <WindowServer/WSScreen.h> | #include <WindowServer/WSScreen.h> | ||||||
|  | @ -102,7 +101,7 @@ WSMenuManager::WSMenuManager() | ||||||
|     int app_identifier = 1; |     int app_identifier = 1; | ||||||
|     for (const auto& app : m_apps) { |     for (const auto& app : m_apps) { | ||||||
|         auto parent_menu = m_app_category_menus.get(app.category).value_or(*m_system_menu); |         auto parent_menu = m_app_category_menus.get(app.category).value_or(*m_system_menu); | ||||||
|         parent_menu->add_item(make<WSMenuItem>(*m_system_menu, app_identifier++, app.name, String(), true, false, false, Gfx::load_png(app.icon_path))); |         parent_menu->add_item(make<WSMenuItem>(*m_system_menu, app_identifier++, app.name, String(), true, false, false, Gfx::Bitmap::load_from_file(app.icon_path))); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); |     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); | ||||||
|  | @ -140,7 +139,7 @@ WSMenuManager::WSMenuManager() | ||||||
|     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 100, "Reload WM Config File")); |     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 100, "Reload WM Config File")); | ||||||
| 
 | 
 | ||||||
|     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); |     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); | ||||||
|     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 200, "About...", String(), true, false, false, Gfx::load_png("/res/icons/16x16/ladybug.png"))); |     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 200, "About...", String(), true, false, false, Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"))); | ||||||
|     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); |     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); | ||||||
|     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 300, "Shutdown...")); |     m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 300, "Shutdown...")); | ||||||
|     m_system_menu->on_item_activation = [this](WSMenuItem& item) { |     m_system_menu->on_item_activation = [this](WSMenuItem& item) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling