mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
GFileSystemModel: Add a special icon for the selected folder.
I don't know if this will always make sense but it does make sense within the only current client (FileManager) so let's go with it for now.
This commit is contained in:
parent
025a50d9cb
commit
c3bc0eeb86
1 changed files with 4 additions and 1 deletions
|
@ -153,8 +153,11 @@ GVariant GFileSystemModel::data(const GModelIndex& index, Role role) const
|
||||||
if (role == GModel::Role::Display)
|
if (role == GModel::Role::Display)
|
||||||
return node.name;
|
return node.name;
|
||||||
if (role == GModel::Role::Icon) {
|
if (role == GModel::Role::Icon) {
|
||||||
if (node.type == Node::Directory)
|
if (node.type == Node::Directory) {
|
||||||
|
if (selected_index() == index)
|
||||||
|
return GIcon::default_icon("filetype-folder-open");
|
||||||
return GIcon::default_icon("filetype-folder");
|
return GIcon::default_icon("filetype-folder");
|
||||||
|
}
|
||||||
return GIcon::default_icon("filetype-unknown");
|
return GIcon::default_icon("filetype-unknown");
|
||||||
}
|
}
|
||||||
return { };
|
return { };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue