0

I would like to know how to center a wibox.widget.textbox in wibox.container.background, because I would like to center the text in this image.

s.mytaglist = awful.widget.taglist {
    screen  = s,
    filter  = awful.widget.taglist.filter.all,
    buttons = tag_list_buttons,
    widget_template = {
        id = 'background_role',
        widget = wibox.container.background,
        forced_width = 40,
        {
            layout = wibox.layout.fixed.horizontal,
            {
                id = 'text_role',
                widget = wibox.widget.textbox,
            },
        },
    },
}

I have try to add expand = "outside" but that doesn't work. Also, I doesn't want to use a wibox.container.margin, because it's not precise enough.

Thanks in advance for your help.

Malcret
  • 3
  • 4

1 Answers1

1

Set the align and valign properties of the textbox to "center" for horizontal and vertical center alignment.

Piglet
  • 27,501
  • 3
  • 20
  • 43
  • Ok, so I have move `force_width` in the textbox properties and also set `aligne = "center"` . Now it work. Thank you. – Malcret Dec 13 '21 at 09:12