Fix bug causing error if icons.spacing isn't specified (#206)

This commit is contained in:
magnouvean 2024-06-13 16:35:36 +02:00 committed by GitHub
parent d48204d2be
commit 8d48bb7ba1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,15 +26,17 @@ in
Could be an integer unit, or "small" (1 unit), "medium" (2 units) or "large" (6 units).
'';
apply = spacing:
if builtins.isInt spacing then
toString spacing
(if (spacing == null) then null
else
builtins.elemAt [ "1" "2" "6" ] (
lib.lists.findFirstIndex
(x: x == spacing)
(throw "systemTray: nonexistent spacing ${spacing}! This is a bug!")
enum
);
(if builtins.isInt spacing then
toString spacing
else
builtins.elemAt [ "1" "2" "6" ] (
lib.lists.findFirstIndex
(x: x == spacing)
(throw "systemTray: nonexistent spacing ${spacing}! This is a bug!")
enum
)));
};
scaleToFit = mkBoolOption ''
Whether to automatically scale System Tray icons to fix the available thickness of the panel.