From 75a41da69f7abd4eecce1f7ddcd88b67d4271437 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 27 Jul 2021 17:24:45 +0200 Subject: [PATCH] LibGUI: Show dotfiles with 50% opacity (in FileSystemModel views) Use the new ModelRole::IconOpacity for this. :^) --- Userland/Libraries/LibGUI/FileSystemModel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index dfe7b37185a..797affd754c 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -515,6 +515,13 @@ Variant FileSystemModel::data(const ModelIndex& index, ModelRole role) const if (role == ModelRole::Icon) { return icon_for(node); } + + if (role == ModelRole::IconOpacity) { + if (node.name.starts_with('.')) + return 0.5f; + return {}; + } + return {}; }