elkowar / eww

ElKowars wacky widgets

Home Page:https://elkowar.github.io/eww

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Sibling elements have the same dimensions

lucalabs-de opened this issue · comments

Checklist before submitting an issue

  • I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • I have specifically verified that this bug is not a common user error
  • I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

Multiple widgets in the same box seem to take the same amount of horizontal and vertical space, regardless of content. For example, two labels, one containing text spanning multiple lines, look as follows.

multiline

I would expect the top label to have a lower height, simply wrapping its content.

And it's not just labels. Two of these text boxes in the same container look like this.

boxes

I can slightly improve this by setting :valign "start" (I suppose :valign fill is the default). This gives the individual widgets the correct height, however they still reserve the same amount of space:

withvalign

Reproducing the issue

The following config reproduces the issue for me.

(defwindow test 
 :monitor 0
 :geometry (geometry 
   :x "0px"
   :y "0px"
   :width "480px"
   :height "0px"
   :anchor "top right")
 :stacking "fg"
 :windowtype "dialog"
 :wm-ignore true
 (example))
(defwidget example []
      (box
        :orientation "vertical"
        :width 300
        (label 
          :valign "start"
          :yalign 0
          :xalign 0
          :text "Title") 
        (label
          :valign "start"
          :yalign 0
          :xalign 0
          :vexpand true
          :wrap true
          :text "Some very long text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed libero ex, sodales id odio sit amet, feugiat iaculis sapien. Praesent et suscipit massa. Integer pretium odio quis accumsan maximus.")))

It looks as follows, while I would expect the title to be right above the content.

example

Expected behaviour

Widgets should keep their own dimensions as resulting from their content and styling, regardless of which other widgets are in the same container.

Additional context

I'm inclined to believe that I'm doing something wrong, because this is such an obvious problem that others should have noticed before.

(I am not the maintainer of this project.)

You can get the behavior you expect by setting :space-evenly false on your box (documentation here).

I could have sworn that I tried that option. It works though, thank you!