panel: adjust floating margins

parent c7a353db
......@@ -73,6 +73,11 @@ window#waybar.right .modules-right {
margin: 5px 0;
}
window#waybar.islands .module,
window#waybar.islands .modules-right,
window#waybar.islands .modules-left {
margin: 0;
}
.module:hover {
background-color: alpha(@selected_bg, .4);
}
......
......@@ -31,10 +31,7 @@ func GenerateConfig(cfg Config, registry Registry) ([]byte, error) {
}
if cfg.Type == "floating" || cfg.Type == "islands" {
out["margin-top"] = 8
out["margin-bottom"] = 8
out["margin-left"] = 8
out["margin-right"] = 8
applyFloatingMargins(out, cfg.Position)
}
left, err := resolveModuleList(cfg.ModulesLeft, cfg.Position, registry)
......@@ -61,6 +58,27 @@ func GenerateConfig(cfg Config, registry Registry) ([]byte, error) {
return append(data, '\n'), nil
}
func applyFloatingMargins(out map[string]any, position string) {
switch position {
case "top":
out["margin-top"] = 8
out["margin-left"] = 8
out["margin-right"] = 8
case "bottom":
out["margin-bottom"] = 8
out["margin-left"] = 8
out["margin-right"] = 8
case "left":
out["margin-top"] = 8
out["margin-bottom"] = 8
out["margin-left"] = 8
case "right":
out["margin-top"] = 8
out["margin-bottom"] = 8
out["margin-right"] = 8
}
}
func GenerateRuntimeConfig() ([]byte, error) {
cfg, registry, err := loadInputs()
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment