mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibGUI: Added the new icons to FileSystemModel.
This commit is contained in:
parent
0d04327318
commit
5d2bfbd20b
Notes:
sideshowbarker
2024-07-19 07:51:26 +09:00
Author: https://github.com/sleepy-monax Commit: https://github.com/SerenityOS/serenity/commit/5d2bfbd20bb Pull-request: https://github.com/SerenityOS/serenity/pull/1656 Reviewed-by: https://github.com/oriko1010
2 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 };
|
||||
|
|
Loading…
Add table
Reference in a new issue