summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorVAN BOSSUYT Nicolas <nicolas.van.bossuyt@gmail.com>2020-04-05 23:35:22 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-06 14:44:09 +0200
commit5d2bfbd20bb2c6093c3e8f0ec03e4d9ee14915ea (patch)
treeb0cdff964d1a44880323ca2cd2c70b5f3a202593 /Libraries
parent0d043273184ddb7d71080e5865c7ac078b7eff64 (diff)
downloadserenity-5d2bfbd20bb2c6093c3e8f0ec03e4d9ee14915ea.zip
LibGUI: Added the new icons to FileSystemModel.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/FileSystemModel.cpp16
-rw-r--r--Libraries/LibGUI/FileSystemModel.h6
2 files changed, 22 insertions, 0 deletions
diff --git a/Libraries/LibGUI/FileSystemModel.cpp b/Libraries/LibGUI/FileSystemModel.cpp
index 6b2745e37e..77f75a4448 100644
--- a/Libraries/LibGUI/FileSystemModel.cpp
+++ b/Libraries/LibGUI/FileSystemModel.cpp
@@ -207,6 +207,11 @@ FileSystemModel::FileSystemModel(const StringView& root_path, Mode mode)
m_filetype_image_icon = Icon::default_icon("filetype-image");
m_filetype_sound_icon = Icon::default_icon("filetype-sound");
m_filetype_html_icon = Icon::default_icon("filetype-html");
+ m_filetype_cplusplus_icon = Icon::default_icon("filetype-cplusplus");
+ m_filetype_java_icon = Icon::default_icon("filetype-java");
+ m_filetype_javascript_icon = Icon::default_icon("filetype-javascript");
+ m_filetype_text_icon = Icon::default_icon("filetype-text");
+ m_filetype_pdf_icon = Icon::default_icon("filetype-pdf");
setpwent();
while (auto* passwd = getpwent())
@@ -425,6 +430,17 @@ Icon FileSystemModel::icon_for_file(const mode_t mode, const String& name) const
return m_filetype_html_icon;
if (name.to_lowercase().ends_with(".png"))
return m_filetype_image_icon;
+ if (name.to_lowercase().ends_with(".cpp"))
+ return m_filetype_cplusplus_icon;
+ if (name.to_lowercase().ends_with(".java"))
+ return m_filetype_java_icon;
+ if (name.to_lowercase().ends_with(".js"))
+ return m_filetype_javascript_icon;
+ if (name.to_lowercase().ends_with(".txt"))
+ return m_filetype_text_icon;
+ if (name.to_lowercase().ends_with(".pdf"))
+ return m_filetype_pdf_icon;
+
return m_file_icon;
}
diff --git a/Libraries/LibGUI/FileSystemModel.h b/Libraries/LibGUI/FileSystemModel.h
index 911e1956b0..5eb9ba7d06 100644
--- a/Libraries/LibGUI/FileSystemModel.h
+++ b/Libraries/LibGUI/FileSystemModel.h
@@ -155,6 +155,12 @@ private:
GUI::Icon m_filetype_image_icon;
GUI::Icon m_filetype_sound_icon;
GUI::Icon m_filetype_html_icon;
+
+ GUI::Icon m_filetype_cplusplus_icon;
+ GUI::Icon m_filetype_java_icon;
+ GUI::Icon m_filetype_javascript_icon;
+ GUI::Icon m_filetype_text_icon;
+ GUI::Icon m_filetype_pdf_icon;
unsigned m_thumbnail_progress { 0 };
unsigned m_thumbnail_progress_total { 0 };