mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
WidgetGallery: Split cursor/icon names based on full paths
Fixes [null] icons since switching to next_full_path iteration
This commit is contained in:
parent
1099521514
commit
a697a2a37a
Notes:
sideshowbarker
2024-07-18 19:13:27 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/a697a2a37a0 Pull-request: https://github.com/SerenityOS/serenity/pull/6569
@ -64,8 +64,8 @@ public:
|
|||||||
Cursor cursor;
|
Cursor cursor;
|
||||||
cursor.path = move(path);
|
cursor.path = move(path);
|
||||||
cursor.bitmap = Gfx::Bitmap::load_from_file(cursor.path);
|
cursor.bitmap = Gfx::Bitmap::load_from_file(cursor.path);
|
||||||
auto filename_split = cursor.path.split('.');
|
auto filename_split = cursor.path.split('/');
|
||||||
cursor.name = filename_split[0];
|
cursor.name = filename_split[2];
|
||||||
m_cursors.append(move(cursor));
|
m_cursors.append(move(cursor));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,8 +143,8 @@ public:
|
|||||||
continue;
|
continue;
|
||||||
IconSet icon_set;
|
IconSet icon_set;
|
||||||
icon_set.big_icon = Gfx::Bitmap::load_from_file(path);
|
icon_set.big_icon = Gfx::Bitmap::load_from_file(path);
|
||||||
auto filename_split = path.split('.');
|
auto filename_split = path.split('/');
|
||||||
icon_set.name = filename_split[0];
|
icon_set.name = filename_split[3];
|
||||||
m_icon_sets.append(move(icon_set));
|
m_icon_sets.append(move(icon_set));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +158,8 @@ public:
|
|||||||
continue;
|
continue;
|
||||||
IconSet icon_set;
|
IconSet icon_set;
|
||||||
icon_set.little_icon = Gfx::Bitmap::load_from_file(path);
|
icon_set.little_icon = Gfx::Bitmap::load_from_file(path);
|
||||||
auto filename_split = path.split('.');
|
auto filename_split = path.split('/');
|
||||||
icon_set.name = filename_split[0];
|
icon_set.name = filename_split[3];
|
||||||
for (size_t i = 0; i < big_icons_found; i++) {
|
for (size_t i = 0; i < big_icons_found; i++) {
|
||||||
if (icon_set.name == m_icon_sets[i].name) {
|
if (icon_set.name == m_icon_sets[i].name) {
|
||||||
m_icon_sets[i].little_icon = icon_set.little_icon;
|
m_icon_sets[i].little_icon = icon_set.little_icon;
|
||||||
|
Loading…
Reference in New Issue
Block a user