mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
FileManager: Add a default icon for image files.
This commit is contained in:
parent
5ca62f356b
commit
9d4b4c2689
3 changed files with 4 additions and 0 deletions
|
@ -14,6 +14,7 @@ DirectoryTableModel::DirectoryTableModel()
|
||||||
m_symlink_icon = GraphicsBitmap::load_from_file("/res/icons/link16.png");
|
m_symlink_icon = GraphicsBitmap::load_from_file("/res/icons/link16.png");
|
||||||
m_socket_icon = GraphicsBitmap::load_from_file("/res/icons/socket16.png");
|
m_socket_icon = GraphicsBitmap::load_from_file("/res/icons/socket16.png");
|
||||||
m_executable_icon = GraphicsBitmap::load_from_file("/res/icons/executable16.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();
|
setpwent();
|
||||||
while (auto* passwd = getpwent())
|
while (auto* passwd = getpwent())
|
||||||
|
@ -78,6 +79,8 @@ const GraphicsBitmap& DirectoryTableModel::icon_for(const Entry& entry) const
|
||||||
return *m_socket_icon;
|
return *m_socket_icon;
|
||||||
if (entry.mode & S_IXUSR)
|
if (entry.mode & S_IXUSR)
|
||||||
return *m_executable_icon;
|
return *m_executable_icon;
|
||||||
|
if (entry.name.ends_with(".png"))
|
||||||
|
return *m_filetype_image_icon;
|
||||||
return *m_file_icon;
|
return *m_file_icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ private:
|
||||||
RetainPtr<GraphicsBitmap> m_symlink_icon;
|
RetainPtr<GraphicsBitmap> m_symlink_icon;
|
||||||
RetainPtr<GraphicsBitmap> m_socket_icon;
|
RetainPtr<GraphicsBitmap> m_socket_icon;
|
||||||
RetainPtr<GraphicsBitmap> m_executable_icon;
|
RetainPtr<GraphicsBitmap> m_executable_icon;
|
||||||
|
RetainPtr<GraphicsBitmap> m_filetype_image_icon;
|
||||||
|
|
||||||
HashMap<uid_t, String> m_user_names;
|
HashMap<uid_t, String> m_user_names;
|
||||||
HashMap<gid_t, String> m_group_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…
Add table
Add a link
Reference in a new issue