简体   繁体   English

Awesome-WM - 如何在 wibox.container 中居中 wibox.widget.textbox?

[英]Awesome-WM - How to center a wibox.widget.textbox in a wibox.container?

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 .我想知道如何在wibox.widget.textbox中将wibox.container.background ,因为我想在此图像中居中文本。

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.我尝试添加expand = "outside"但这不起作用。 Also, I doesn't want to use a wibox.container.margin , because it's not precise enough.另外,我不想使用wibox.container.margin ,因为它不够精确。

Thanks in advance for your help.在此先感谢您的帮助。

Set the align and valign properties of thetextbox to "center" for horizontal and vertical center alignment.文本框alignvalign属性设置为"center"以实现水平和垂直居中 alignment。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM