mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +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
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue