Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systray gets some unwanted margin with a base size too big #3739

Open
Vermoot opened this issue Nov 15, 2022 · 0 comments
Open

Systray gets some unwanted margin with a base size too big #3739

Vermoot opened this issue Nov 15, 2022 · 0 comments

Comments

@Vermoot
Copy link

Vermoot commented Nov 15, 2022

Output of awesome --version:

awesome v4.3-1539-gb16f62862 (Too long)
 • Compiled against Lua 5.4.4 (running with 0.9.2)
 • API level: 4
 • D-Bus support: yes
 • xcb-errors support: no
 • execinfo support: yes
 • xcb-randr version: 1.6
 • LGI version: /usr/share/lua/5.4/lgi/version.lua
 • Transparency enabled: yes
 • Custom search paths: no

How to reproduce the issue:

Setting up a systray for my bar, I've had a weird issue with it having some unwanted, inconsistend margin depending on how many icons were in it.
Here's the code I ran:

local systray = wibox.widget.systray()
local systray_widget = wibox.widget {
    {
        systray,
        margins = 2,
        widget = wibox.container.margin
    },
    widget = wibox.container.background,
    bg = "#665c54",
    shape = function(cr, width, height)
        gears.shape.rounded_rect(cr, width, height, 5)
    end,
}
systray:set_horizontal(false)
systray:set_base_size(24)
beautiful.bg_systray = "#aa0000"
beautiful.systray_icon_spacing = 4

The systray background color is here to visualize where it is exactly.

Here's what it looks like with 2 icons only:
image

And here's what it looks like with 4:
image

As you can see there's a bottom margin that's different on those, and what's more the margin isn't red.

I asked about it on Discord and been advised to remove systray:set_base_size(24), which did fix the issue. Now I have consistent margins no matter how many icons I have in the systray, everything is working as expected.

Crylia on discord who's helped me with this said:

you basically made every icon have 24x24 space. But since you added a margin to every icon it overflew into the above. (just a guess)

I'm reporting this on here as asked by @Aire-One, because they believe this to be a bug that should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant