FileManager: Add an icon for socket files.
This commit is contained in:
parent
bf6b0ea181
commit
420b7bd55f
Notes:
sideshowbarker
2024-07-19 15:40:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/420b7bd55f5
4 changed files with 4 additions and 0 deletions
|
@ -15,6 +15,7 @@ DirectoryView::DirectoryView(GWidget* parent)
|
|||
m_directory_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/folder16.rgb", { 16, 16 });
|
||||
m_file_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/file16.rgb", { 16, 16 });
|
||||
m_symlink_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/link16.rgb", { 16, 16 });
|
||||
m_socket_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/socket16.rgb", { 16, 16 });
|
||||
|
||||
m_scrollbar = new GScrollBar(Orientation::Vertical, this);
|
||||
m_scrollbar->set_step(4);
|
||||
|
@ -91,6 +92,8 @@ const GraphicsBitmap& DirectoryView::icon_for(const Entry& entry) const
|
|||
return *m_directory_icon;
|
||||
if (S_ISLNK(entry.mode))
|
||||
return *m_symlink_icon;
|
||||
if (S_ISSOCK(entry.mode))
|
||||
return *m_socket_icon;
|
||||
return *m_file_icon;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ private:
|
|||
RetainPtr<GraphicsBitmap> m_directory_icon;
|
||||
RetainPtr<GraphicsBitmap> m_file_icon;
|
||||
RetainPtr<GraphicsBitmap> m_symlink_icon;
|
||||
RetainPtr<GraphicsBitmap> m_socket_icon;
|
||||
|
||||
GScrollBar* m_scrollbar { nullptr };
|
||||
};
|
||||
|
|
BIN
Base/res/icons/socket16.png
Normal file
BIN
Base/res/icons/socket16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 335 B |
BIN
Base/res/icons/socket16.rgb
Normal file
BIN
Base/res/icons/socket16.rgb
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue