diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-04 21:48:03 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-04 21:48:03 +0200 |
commit | c4d59f64d1275d7ef85fc739063e402023316ae4 (patch) | |
tree | 902015696fe0f4c44612f5114b9ea99174803ae5 /Libraries/LibGUI | |
parent | 5cfd67ecbb7c7f8ba148632dc5756649aa652b0e (diff) | |
download | serenity-c4d59f64d1275d7ef85fc739063e402023316ae4.zip |
GDirectoryModel: Add a 32x32 filetype icon for sound files
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r-- | Libraries/LibGUI/GDirectoryModel.cpp | 3 | ||||
-rw-r--r-- | Libraries/LibGUI/GDirectoryModel.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GDirectoryModel.cpp b/Libraries/LibGUI/GDirectoryModel.cpp index abf38a0a78..7a71cb61a6 100644 --- a/Libraries/LibGUI/GDirectoryModel.cpp +++ b/Libraries/LibGUI/GDirectoryModel.cpp @@ -33,6 +33,7 @@ GDirectoryModel::GDirectoryModel() m_socket_icon = GIcon::default_icon("filetype-socket"); m_executable_icon = GIcon::default_icon("filetype-executable"); m_filetype_image_icon = GIcon::default_icon("filetype-image"); + m_filetype_sound_icon = GIcon::default_icon("filetype-sound"); setpwent(); while (auto* passwd = getpwent()) @@ -156,6 +157,8 @@ GIcon GDirectoryModel::icon_for(const Entry& entry) const return m_socket_icon; if (entry.mode & S_IXUSR) 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.thumbnail) { if (!const_cast<GDirectoryModel*>(this)->fetch_thumbnail_for(entry)) diff --git a/Libraries/LibGUI/GDirectoryModel.h b/Libraries/LibGUI/GDirectoryModel.h index 2391c4460a..580454ec65 100644 --- a/Libraries/LibGUI/GDirectoryModel.h +++ b/Libraries/LibGUI/GDirectoryModel.h @@ -76,6 +76,7 @@ private: GIcon m_socket_icon; GIcon m_executable_icon; GIcon m_filetype_image_icon; + GIcon m_filetype_sound_icon; HashMap<uid_t, String> m_user_names; HashMap<gid_t, String> m_group_names; |