Explorar o código

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.
Andreas Kling %!s(int64=6) %!d(string=hai) anos
pai
achega
c3bc0eeb86
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      LibGUI/GFileSystemModel.cpp

+ 4 - 1
LibGUI/GFileSystemModel.cpp

@@ -153,8 +153,11 @@ GVariant GFileSystemModel::data(const GModelIndex& index, Role role) const
     if (role == GModel::Role::Display)
         return node.name;
     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-unknown");
     }
     return { };