mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
FileManager: Add a default icon for image files.
This commit is contained in:
parent
5ca62f356b
commit
9d4b4c2689
Notes:
sideshowbarker
2024-07-19 14:58:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9d4b4c26895
@ -14,6 +14,7 @@ DirectoryTableModel::DirectoryTableModel()
|
||||
m_symlink_icon = GraphicsBitmap::load_from_file("/res/icons/link16.png");
|
||||
m_socket_icon = GraphicsBitmap::load_from_file("/res/icons/socket16.png");
|
||||
m_executable_icon = GraphicsBitmap::load_from_file("/res/icons/executable16.png");
|
||||
m_filetype_image_icon = GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-image.png");
|
||||
|
||||
setpwent();
|
||||
while (auto* passwd = getpwent())
|
||||
@ -78,6 +79,8 @@ const GraphicsBitmap& DirectoryTableModel::icon_for(const Entry& entry) const
|
||||
return *m_socket_icon;
|
||||
if (entry.mode & S_IXUSR)
|
||||
return *m_executable_icon;
|
||||
if (entry.name.ends_with(".png"))
|
||||
return *m_filetype_image_icon;
|
||||
return *m_file_icon;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@ private:
|
||||
RetainPtr<GraphicsBitmap> m_symlink_icon;
|
||||
RetainPtr<GraphicsBitmap> m_socket_icon;
|
||||
RetainPtr<GraphicsBitmap> m_executable_icon;
|
||||
RetainPtr<GraphicsBitmap> m_filetype_image_icon;
|
||||
|
||||
HashMap<uid_t, String> m_user_names;
|
||||
HashMap<gid_t, String> m_group_names;
|
||||
|
BIN
Base/res/icons/16x16/filetype-image.png
Normal file
BIN
Base/res/icons/16x16/filetype-image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
Loading…
Reference in New Issue
Block a user