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:
parent
aa9387c76c
commit
1b30b510b9
7 changed files with 97 additions and 58 deletions
21
Ladybird/Qt/Icon.cpp
Normal file
21
Ladybird/Qt/Icon.cpp
Normal 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 };
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue