Fix icon loading for third-party apps with file:// URL scheme
- Add file:// URL handling to AssetFilesInterface in kernel.cpp - Update home.lua to use file:// prefix for absolute filesystem paths - Add file:// URL handling to desktop file interface for consistency This fixes RmlUi stripping the leading slash from absolute paths when resolving img src URLs relative to the document base. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,11 @@ void DesktopFileInterface::SetAssetsPath(const std::string& path) {
|
||||
std::string DesktopFileInterface::ResolvePath(const std::string& path) const {
|
||||
std::string resolved = path;
|
||||
|
||||
// Handle file:// URLs
|
||||
if (resolved.rfind("file://", 0) == 0) {
|
||||
resolved = resolved.substr(7); // Strip "file://"
|
||||
}
|
||||
|
||||
// Handle URL-encoded Windows drive letters (D| -> D:)
|
||||
// RmlUi sometimes encodes the colon in Windows paths
|
||||
if (resolved.size() >= 2 && std::isalpha(resolved[0]) && resolved[1] == '|') {
|
||||
|
||||
Reference in New Issue
Block a user