Przeglądaj źródła

LibGUI: Show dotfiles with 50% opacity (in FileSystemModel views)

Use the new ModelRole::IconOpacity for this. :^)
Andreas Kling 4 lat temu
rodzic
commit
75a41da69f
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      Userland/Libraries/LibGUI/FileSystemModel.cpp

+ 7 - 0
Userland/Libraries/LibGUI/FileSystemModel.cpp

@@ -515,6 +515,13 @@ Variant FileSystemModel::data(const ModelIndex& index, ModelRole role) const
     if (role == ModelRole::Icon) {
     if (role == ModelRole::Icon) {
         return icon_for(node);
         return icon_for(node);
     }
     }
+
+    if (role == ModelRole::IconOpacity) {
+        if (node.name.starts_with('.'))
+            return 0.5f;
+        return {};
+    }
+
     return {};
     return {};
 }
 }