mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:18:11 +00:00
GDirectoryModel: Add a 32x32 filetype icon for sound files
This commit is contained in:
parent
5cfd67ecbb
commit
c4d59f64d1
3 changed files with 4 additions and 0 deletions
BIN
Base/res/icons/32x32/filetype-sound.png
Normal file
BIN
Base/res/icons/32x32/filetype-sound.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 373 B |
|
@ -33,6 +33,7 @@ GDirectoryModel::GDirectoryModel()
|
||||||
m_socket_icon = GIcon::default_icon("filetype-socket");
|
m_socket_icon = GIcon::default_icon("filetype-socket");
|
||||||
m_executable_icon = GIcon::default_icon("filetype-executable");
|
m_executable_icon = GIcon::default_icon("filetype-executable");
|
||||||
m_filetype_image_icon = GIcon::default_icon("filetype-image");
|
m_filetype_image_icon = GIcon::default_icon("filetype-image");
|
||||||
|
m_filetype_sound_icon = GIcon::default_icon("filetype-sound");
|
||||||
|
|
||||||
setpwent();
|
setpwent();
|
||||||
while (auto* passwd = getpwent())
|
while (auto* passwd = getpwent())
|
||||||
|
@ -156,6 +157,8 @@ GIcon GDirectoryModel::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.to_lowercase().ends_with(".wav"))
|
||||||
|
return m_filetype_sound_icon;
|
||||||
if (entry.name.to_lowercase().ends_with(".png")) {
|
if (entry.name.to_lowercase().ends_with(".png")) {
|
||||||
if (!entry.thumbnail) {
|
if (!entry.thumbnail) {
|
||||||
if (!const_cast<GDirectoryModel*>(this)->fetch_thumbnail_for(entry))
|
if (!const_cast<GDirectoryModel*>(this)->fetch_thumbnail_for(entry))
|
||||||
|
|
|
@ -76,6 +76,7 @@ private:
|
||||||
GIcon m_socket_icon;
|
GIcon m_socket_icon;
|
||||||
GIcon m_executable_icon;
|
GIcon m_executable_icon;
|
||||||
GIcon m_filetype_image_icon;
|
GIcon m_filetype_image_icon;
|
||||||
|
GIcon m_filetype_sound_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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue