elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.17k stars 378 forks source link

[BUG] Label not in supposed size #372

Closed matthis-k closed 2 years ago

matthis-k commented 2 years ago

Checklist before submitting an issue

Description of the bug

The label does not fill the window, althogh it is hardcoded to do so.

Reproducing the issue

eww.yuck

(defvar powermenu_ext false)

(defwindow powermenu 
    :class "shutdown-window"
    :monitor 0
    :geometry (geometry 
        :x "0%"
        :y "0%"
        :width "30px"
        :height "30px"
        :anchor "top right"
    )
    :stacking "overlay"
    :exclusive false
    :focusable false
    (eventbox
        :width "30px"
        :height "30px"
        :hextend true
        :vextend true
        :orientation "center"
        :space-evenly false
        :onhover "eww update powermenu_ext=true"
        :onhoverlost "eww update powermenu_ext=false"
        (box
            :width "30px"
            :height "30px"
            :hextend true
            :vextend true
            :class "shutdown-content"
            :orientation "v"
            :valign "start"
            :space-evenly false
            (label
                :width "30px"
                :height "30px"
                :hextend true
                :vextend true
                :class "shutdown-content"
                :text {powermenu_ext ? "^" : ""}
            )
        )
    )
)

eww.scss

@define-color tn0 #1a1b26;
@define-color tn1 #15161E;
@define-color tn2 #414868;
@define-color tn3 #a9b1d6;
@define-color tn4 #c0caf5;
@define-color tn7  #7dcfff;
@define-color tn10 #7aa2f7;
@define-color tn11 #f7768e;
@define-color tn12 #d08770;
@define-color tn13 #e0af68;
@define-color tn14 #9ece6a;
@define-color tn15 #bb9af7;

/* Simple color names */
window {
  background-color: #ffffff;
}

.shutdown-window {
  background-color: transparent;
}

.shutdown-content {
  background-color: #f7768e;
  color: #1a1b26;
  border-radius: 5px;
}

Expected behaviour

The label fills the whole window. Expected: something like on top Acutal: bottom

image

Additional context

Additional context

I want to remake and improve my statusbar with eww. For that i want a poweroff box, which expands on hover to show options like reboot/poweroff/slepp etc. To stay consitent with my current styling, i want that to be in an 30px x 30px box, but for some reason, i can not get it to fit that, even tho it easily could fit and i hardcoded some widths/heights. Here is an image (top is waybar, bottom eww)

elkowar commented 2 years ago

I'd urge you to actually look at the eww logs output, there's many issues with your provided config here, such as tons of properties just not existing ^^ Once you fix those, the layout issues should also behave as documented, hopefully