1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

Ladybird: Load all icons uses Core::Resource URIs

This commit is contained in:
Timothy Flynn 2023-11-05 07:45:43 -05:00 committed by Andreas Kling
parent aa9387c76c
commit 1b30b510b9
7 changed files with 97 additions and 58 deletions

21
Ladybird/Qt/Icon.cpp Normal file
View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "Icon.h"
#include "StringUtils.h"
#include <LibCore/Resource.h>
namespace Ladybird {
QIcon load_icon_from_uri(StringView uri)
{
auto resource = MUST(Core::Resource::load_from_uri(uri));
auto path = qstring_from_ak_string(resource->filesystem_path());
return QIcon { path };
}
}