AdamWagner / stackline

Visualize yabai window stacks on macOS. Works with yabai & hammerspoon.
944 stars 47 forks source link

Inactive pills disappear when in minimal mode #85

Open jesseleite opened 3 years ago

jesseleite commented 3 years ago

I notice that when icons are enabled, if you focus away from the stack, the inactive stack icons lose their background colour and become completely transparent.

This looks fine when icons are enabled, but causes the whole pill to disappear when in minimal mode with icons disabled. Here's a gif showing how the pills disappear when the focus is moved away from the stack...

CleanShot 2021-06-24 at 13 49 10

b4rlw commented 2 years ago

I'm also looking for a fix for this. Any luck?

mizlan commented 9 months ago

It has to do with the getColorAttrs, by modifying that function you can do as suits you

mizlan commented 9 months ago
diff --git a/stackline/window.lua b/stackline/window.lua
index 82a6eb5..be962f2 100644
--- a/stackline/window.lua
+++ b/stackline/window.lua
@@ -265,20 +265,13 @@ function Window:getColorAttrs(isStackFocused, isWinFocused) -- {{{
             ['false'] = {
                 window = {
                     ['true'] = {
-                        bg = u.extend(u.copy(opts.color), {
-                            alpha = opts.alpha / (opts.dimmer / 1.2),
-                        }),
-                        -- last-focused icon stays full alpha when stack unfocused
+                        bg = u.extend(opts.color, {alpha = opts.alpha}),
                         img = opts.alpha,
                     },
                     ['false'] = {
-                        bg = u.extend(u.copy(opts.color), {
-                            alpha = stackline.manager:getShowIconsState() and 0 or
-                                0.2,
-                        }),
-                        -- unfocused icon has slightly lower alpha when stack also unfocused
-                        img = opts.alpha /
-                            (opts.iconDimmer + (opts.iconDimmer * 0.70)),
+                        bg = u.extend(u.copy(opts.color),
+                            {alpha = opts.alpha / opts.dimmer}),
+                        img = opts.alpha / opts.iconDimmer,
                     },
                 },
             },