textbox: Rename `align` to `halign`.

`halign` is used in multiple place in the API. Once upon a time,
Awesome only supported horizontal widgets, but this era has long
passed.

Fix #3640
This commit is contained in:
Emmanuel Lepage Vallee 2022-09-04 00:33:09 -07:00
parent b16505733a
commit 88c65a71dd
88 changed files with 138 additions and 121 deletions

View File

@ -541,7 +541,7 @@ client.connect_signal("request::titlebars", function(c)
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,

View File

@ -277,7 +277,7 @@ Code:
{
{
markup = "<b>Hello World!</b>",
align = "center",
halign = "center",
widget = wibox.widget.textbox
},
bg = "#ff0000",

View File

@ -79,7 +79,7 @@ local function wb_label(item, _, textbox)
end
if textbox and item.style.align or beautiful.layoutlist_align then
textbox:set_align(item.style.align or beautiful.layoutlist_align)
textbox:set_halign(item.style.align or beautiful.layoutlist_align)
end
local text = ""

View File

@ -464,7 +464,7 @@ local function tasklist_label(c, args, tb)
local minimized = args.minimized or theme.tasklist_minimized or '<b>_</b>'
if tb then
tb:set_align(align)
tb:set_halign(align)
end
if not theme.tasklist_plain_task_name then

View File

@ -155,7 +155,7 @@ local properties = { "date" , "font" , "spacing" , "week_numbers"
local function make_cell(text, font, center)
local w = textbox()
w:set_markup(text)
w:set_align(center and "center" or "right")
w:set_halign(center and "center" or "right")
w:set_valign("center")
w:set_font(font)
return w

View File

@ -324,14 +324,22 @@ end
--
--@DOC_wibox_widget_textbox_align1_EXAMPLE@
--
-- @property align
-- @tparam[opt="left"] string align
-- @property halign
-- @tparam[opt="left"] string halign
-- @propertyvalue "left"
-- @propertyvalue "center"
-- @propertyvalue "right"
-- @propemits true false
function textbox:set_align(mode)
--- The horizontal text alignment.
--
-- Renamed to `halign` for consistency with other APIs.
--
-- @deprecatedproperty align
-- @tparam[opt="left"] string align
-- @propemits true false
function textbox:set_halign(mode)
local allowed = { left = "LEFT", center = "CENTER", right = "RIGHT" }
if allowed[mode] then
if self._private.layout:get_alignment() == allowed[mode] then
@ -341,9 +349,18 @@ function textbox:set_align(mode)
self:emit_signal("widget::redraw_needed")
self:emit_signal("widget::layout_changed")
self:emit_signal("property::align", mode)
self:emit_signal("property::halign", mode)
end
end
function textbox:set_align(mode)
gdebug.deprecate(
"Use `textbox.halign` instead of `textbox.align`",
{deprecated_in=5, raw=true}
)
self:set_halign(mode)
end
--- Set a textbox font.
--
-- There is multiple valid font string representation. The most precise is
@ -500,7 +517,7 @@ local function new(text, ignore_markup)
ret:set_ellipsize("end")
ret:set_wrap("word_char")
ret:set_valign("center")
ret:set_align("left")
ret:set_halign("left")
if text then
if ignore_markup then

View File

@ -98,15 +98,15 @@ describe("wibox.widget.textbox", function()
assert.is.equal(1, layout_changed)
end)
it("set_align", function()
it("set_halign", function()
assert.is.equal(0, redraw_needed)
assert.is.equal(0, layout_changed)
widget:set_align("left")
widget:set_halign("left")
assert.is.equal(0, redraw_needed)
assert.is.equal(0, layout_changed)
widget:set_align("right")
widget:set_halign("right")
assert.is.equal(1, redraw_needed)
assert.is.equal(1, layout_changed)
end)

View File

@ -395,7 +395,7 @@ local function show_screens()
"+",s.geometry.x,",",s.geometry.y
},
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
bg = colors[i],

View File

@ -29,7 +29,7 @@ client.connect_signal("request::titlebars", function(c)--DOC_HIDE
},--DOC_HIDE
{ -- Middle--DOC_HIDE
{ -- Title--DOC_HIDE
align = "center",--DOC_HIDE
halign = "center",--DOC_HIDE
widget = awful.titlebar.widget.titlewidget(c)--DOC_HIDE
},--DOC_HIDE
layout = wibox.layout.flex.horizontal--DOC_HIDE

View File

@ -29,7 +29,7 @@ client.connect_signal("request::titlebars", function(c)
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal

View File

@ -29,7 +29,7 @@ client.connect_signal("request::titlebars", function(c)
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal

View File

@ -33,7 +33,7 @@ client.connect_signal("request::titlebars", function(c)
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal

View File

@ -29,7 +29,7 @@ client.connect_signal("request::titlebars", function(c)
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal

View File

@ -29,7 +29,7 @@ client.connect_signal("request::titlebars", function(c)
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal

View File

@ -79,7 +79,7 @@ beautiful.notification_action_label_only = true --DOC_HIDE
{
{
text = "Dismiss all",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox
},

View File

@ -52,7 +52,7 @@ local function create_info(text, x, y, width, height)
{
{
text = text,
align = "center",
halign = "center",
ellipsize = "none",
wrap = "word",
widget = wibox.widget.textbox

View File

@ -210,7 +210,7 @@ local function create_info(text, x, y, width, height)
{
{
text = text,
align = "center",
halign = "center",
ellipsize = "none",
wrap = "word",
widget = wibox.widget.textbox

View File

@ -160,7 +160,7 @@ local function client_widget(c, col, label)
l,
{
text = label or "",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox
},

View File

@ -21,7 +21,7 @@ local function setup(bar)
bar:setup {
awful.titlebar.widget.iconwidget(c),
{
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
{

View File

@ -50,7 +50,7 @@ place.maximize(c, {honor_padding=true, honor_workarea=true})
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,

View File

@ -52,7 +52,7 @@ local function create_info(text, x, y, width, height)
{
{
text = text,
align = "center",
halign = "center",
ellipsize = "none",
wrap = "word",
widget = wibox.widget.textbox
@ -93,7 +93,7 @@ local function create_section(x1, y, x2, text)
canvas:add_at(wibox.widget {
text = text,
align = "center",
halign = "center",
ellipsize = "none",
wrap = "word",
forced_width = x2-x1,

View File

@ -36,9 +36,9 @@ require("_default_look")
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -36,9 +36,9 @@ require("_default_look")
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -37,9 +37,9 @@ require("_default_look")
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -45,7 +45,7 @@ require("_default_look")
--DOC_HIDE_END
text = "DPI: " .. dpi,
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
}, --DOC_HIDE
widget = wibox.layout.stack --DOC_HIDE

View File

@ -62,9 +62,9 @@ for i=0, 1 do
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -47,9 +47,9 @@ for i=0, 1 do
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -47,9 +47,9 @@ for i=0, 1 do
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -47,9 +47,9 @@ for i=0, 1 do
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -45,9 +45,9 @@ for i=0, 1 do
widget = wibox.widget.base.make_widget()
},
{
text = "Center",
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -39,7 +39,7 @@ require("_default_look")
{
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -39,7 +39,7 @@ require("_default_look")
{
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -43,7 +43,7 @@ require("_default_look")
{
text = "Center",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -30,7 +30,7 @@ screen[1]._resize {x = 0, y = 0, width = 320, height = 196} --DOC_HIDE
{
markup = "<tt><b>[SYSTEM FAILURE]</b></tt>",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox
},
fg = "#00ff00",

View File

@ -39,7 +39,7 @@ require("_default_look")
{
text = "honor_workarea = " .. (s.index == 2 and "true" or "false"),
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
widget = wibox.layout.stack

View File

@ -22,7 +22,7 @@ for s, align in ipairs { "left", "centered", "right" } do
align = align,
widget = {
text = align,
align = "center",
halign = "center",
widget = wibox.widget.textbox
},
}

View File

@ -43,7 +43,7 @@ local function create_info(text, x, y, width, height)
{
{
text = text,
align = "center",
halign = "center",
ellipsize = "none",
wrap = "word",
widget = wibox.widget.textbox

View File

@ -40,7 +40,7 @@ for _, c in ipairs {c1, c2} do
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal
@ -66,7 +66,7 @@ awful.wibar {
width = 196,
margins = 24,
widget = {
align = "center",
halign = "center",
text = "unform margins",
widget = wibox.widget.textbox
}
@ -84,7 +84,7 @@ awful.wibar {
bottom = 5
},
widget = {
align = "center",
halign = "center",
text = "non unform margins",
widget = wibox.widget.textbox
}

View File

@ -22,7 +22,7 @@ screen[1]._resize {width = 480, height = 196}
widget = {
{
text = position,
align = "center",
halign = "center",
widget = wibox.widget.textbox
},
direction = (position == "left" or position == "right") and

View File

@ -24,7 +24,7 @@ screen[1]._resize {width = 480, height = 196}
widget = {
{
text = position,
align = "center",
halign = "center",
widget = wibox.widget.textbox
},
direction = (position == "left" or position == "right") and

View File

@ -16,7 +16,7 @@ awful.wibar {
width = 196,
widget = {
text = "stretched",
align = "center",
halign = "center",
widget = wibox.widget.textbox
},
}

View File

@ -780,7 +780,7 @@ local function wrap_with_arrows(widget)
},
{
markup = "<span color='#ff000055'>Code for this sequence</span>",
align = "center",
halign = "center",
foced_width = w,
widget = wibox.widget.textbox,
},

View File

@ -67,7 +67,7 @@ for i = 1, screen.count() do
},
{ -- Middle
{ -- Title
align = "center",
halign = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
layout = wibox.layout.flex.horizontal

View File

@ -21,7 +21,7 @@ local function gen_class(name)
{
{
valign = "center",
align = "center",
halign = "center",
markup = "<b>"..name.."</b>",
widget = wibox.widget.textbox
},

View File

@ -12,7 +12,7 @@ for _, v in ipairs {"", "#00ff00", "#0000ff"} do
l:add(wibox.widget {
{
text = v~="" and v or "nil",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -16,7 +16,7 @@ for _, v in ipairs {0,1,3,6.5} do
{
{
text = v,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -13,7 +13,7 @@ for _, v in ipairs {0, 2, 4} do
{
{
text = v,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -45,7 +45,7 @@ l:add(wibox.widget {
{
{
text = 6,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -12,7 +12,7 @@ for _, v in ipairs {0, math.pi/2, math.pi} do
l:add(wibox.widget {
{
text = v,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -12,7 +12,7 @@ for _, v in ipairs {1,3,7,10} do
l:add(wibox.widget {
{
text = v,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -5,7 +5,7 @@ local beautiful = require("beautiful")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -13,7 +13,7 @@ return {
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -6,14 +6,14 @@ local beautiful = require("beautiful")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,7 +4,7 @@ local wibox = require("wibox")
return {
text = "Some long text",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -13,7 +13,7 @@ return {
{
{
text = "Some long text",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -10,7 +10,7 @@ return {
{
{
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -33,7 +33,7 @@ return {
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,14 +4,14 @@ local wibox = require("wibox")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -5,14 +5,14 @@ local awful = { widget = { only_on_screen = require("awful.widget.only_on_screen
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,7 +4,7 @@ local wibox = require("wibox")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -12,7 +12,7 @@ return {
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,7 +4,7 @@ local wibox = require("wibox")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -13,7 +13,7 @@ return {
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,14 +4,14 @@ local wibox = require("wibox")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,14 +4,14 @@ local wibox = require("wibox")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -4,7 +4,7 @@ local wibox = require("wibox")
return {
text = "Before",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},
@ -12,7 +12,7 @@ return {
{
{
text = "After",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -7,7 +7,7 @@ local function gen(val)
return wibox.widget {
{
text = "Value: "..val,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -7,7 +7,7 @@ local function gen(val)
return wibox.widget {
{
text = "Value: "..val,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -7,7 +7,7 @@ local function gen(val)
return wibox.widget {
{
text = "Value: "..val,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -9,7 +9,7 @@ local function gen(val)
{
{
text = "Value: "..val,
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -7,7 +7,7 @@ local function gen(val)
return wibox.widget {
{
text = "Value: "..(val*100).."%",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox,
},

View File

@ -9,7 +9,7 @@ local function create_arrow(text) --DOC_HIDE
{ --DOC_HIDE
{ --DOC_HIDE
text = text, --DOC_HIDE
align = "center", --DOC_HIDE
halign = "center", --DOC_HIDE
valign = "center", --DOC_HIDE
widget = wibox.widget.textbox, --DOC_HIDE
}, --DOC_HIDE

View File

@ -23,7 +23,7 @@ local function generic_widget(text, col, margins)
},
{
id = "text",
align = "center",
halign = "center",
valign = "center",
text = text or "foobar",
widget = wibox.widget.textbox

View File

@ -50,7 +50,7 @@ local function create_info(text, x, y, width, height)
{
{
text = text,
align = "center",
halign = "center",
ellipsize = "none",
wrap = "word",
widget = wibox.widget.textbox

View File

@ -25,11 +25,11 @@ beautiful.notification_bg = beautiful.bg_normal --DOC_HIDE
widget = wibox.container.place
},
{
align = "center",
halign = "center",
widget = naughty.widget.title,
},
{
align = "center",
halign = "center",
widget = naughty.widget.message,
},
{

View File

@ -20,7 +20,7 @@ local date = os.date("*t") --DOC_HIDE
{
{
text = '{day='..date.day..', month='..date.month..',\n year='..date.year..'}',
align = 'center',
halign = 'center',
widget = wibox.widget.textbox
},
border_width = 2,
@ -35,7 +35,7 @@ local date = os.date("*t") --DOC_HIDE
{
{
text = '{month='..date.month..',\n year='..date.year..'}',
align = 'center',
halign = 'center',
widget = wibox.widget.textbox
},
border_width = 2,

View File

@ -6,7 +6,7 @@ parent:add( --DOC_HIDE
wibox.widget{
markup = "This <i>is</i> a <b>textbox</b>!!!",
align = "center",
halign = "center",
valign = "center",
widget = wibox.widget.textbox
}

View File

@ -20,7 +20,7 @@ for _, color in ipairs { {nil}, {"#ff0000"}, {"#00ff00"}, {"#0000ff44"} } do
pb,
{
text = color[1] and '"'..color[1]..'"' or "nil",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -21,7 +21,7 @@ for _, color in ipairs { {nil}, {"#ff0000"}, {"#00ff00"}, {"#0000ff44"} } do
pb,
{
text = color[1] and '"'..color[1]..'"' or "nil",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -21,7 +21,7 @@ for _, width in ipairs { 0, 2, 4, 6 } do
pb,
{
text = width,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -21,7 +21,7 @@ for _, color in ipairs { {nil}, {"#ff0000"}, {"#00ff00"}, {"#0000ff44"} } do
pb,
{
text = color[1] and '"'..color[1]..'"' or "nil",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -21,7 +21,7 @@ for _, width in ipairs { 0, 2, 4, 6 } do
pb,
{
text = width,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -20,7 +20,7 @@ for _, color in ipairs { {nil}, {"#ff0000"}, {"#00ff00"}, {"#0000ff44"} } do
pb,
{
text = color[1] and '"'..color[1]..'"' or "nil",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -20,7 +20,7 @@ for _, margin in ipairs { 0, 2, 4, 6 } do
pb,
{
text = margin,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -20,7 +20,7 @@ for _, value in ipairs { 0, 10, 42, 999 } do
pb,
{
text = value.."/42",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -20,7 +20,7 @@ for _, padding in ipairs { 0, 2, 4, 6 } do
pb,
{
text = padding,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -19,7 +19,7 @@ parent:add( --DOC_HIDE
{
text = "50%",
valign = "center",
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
layout = wibox.layout.stack

View File

@ -21,7 +21,7 @@ for _, has_ticks in ipairs { true, false } do
pb,
{
text = tostring(has_ticks),
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -22,7 +22,7 @@ for _, gap in ipairs { 0, 2, 4, 6 } do
pb,
{
text = gap,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -22,7 +22,7 @@ l.spacing = 5
pb,
{
text = size,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -74,7 +74,7 @@ l3.spacing = 5
pb,
{
text = size,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,
@ -85,7 +85,7 @@ l3.spacing = 5
pb3,
{
text = size,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,
@ -100,7 +100,7 @@ l3.spacing = 5
{
{
text = size,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
margins = 4,
@ -110,7 +110,7 @@ l3.spacing = 5
shape = gears.shape.circle,
widget = wibox.container.background,
},
align = "center",
halign = "center",
valign = "center",
widget = wibox.container.place,
},

View File

@ -19,7 +19,7 @@ for _, value in ipairs { 0, 0.2, 0.5, 1 } do
pb,
{
text = value,
align = "center",
halign = "center",
widget = wibox.widget.textbox,
},
forced_height = 30,

View File

@ -8,7 +8,7 @@ local ret = wibox.layout.fixed.vertical()
--DOC_HIDE_END
for _, align in ipairs {"left", "center", "right"} do
local w = wibox.widget {
align = align,
halign = align,
text = "some text",
widget = wibox.widget.textbox,
}

View File

@ -39,7 +39,7 @@ local function create_titlebar(c)
-- The title goes in the middle
parts.title = awful.titlebar.widget.titlewidget(c)
parts.title:set_align("center")
parts.title:set_halign("center")
local middle_layout = wibox.layout.flex.horizontal(parts.title)
middle_layout.buttons = buttons