【问题标题】:Awesome-WM - How to center a wibox.widget.textbox in a wibox.container?Awesome-WM - 如何在 wibox.container 中居中 wibox.widget.textbox?
【发布时间】:2022-01-16 17:45:04
【问题描述】:

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

我尝试添加expand = "outside",但这不起作用。另外,我不想使用wibox.container.margin,因为它不够精确。

提前感谢您的帮助。

【问题讨论】:

    标签: lua window-managers awesome-wm


    【解决方案1】:

    textboxalignvalign 属性设置为"center" 以实现水平和垂直居中对齐。

    【讨论】:

    • 好的,所以我在文本框属性中移动了 force_width 并设置了 aligne = "center" 。现在它起作用了。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多