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 { -- Middle
{ -- Title { -- Title
align = "center", halign = "center",
widget = awful.titlebar.widget.titlewidget(c) widget = awful.titlebar.widget.titlewidget(c)
}, },
buttons = buttons, buttons = buttons,

View File

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

View File

@ -79,7 +79,7 @@ local function wb_label(item, _, textbox)
end end
if textbox and item.style.align or beautiful.layoutlist_align then 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 end
local text = "" 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>' local minimized = args.minimized or theme.tasklist_minimized or '<b>_</b>'
if tb then if tb then
tb:set_align(align) tb:set_halign(align)
end end
if not theme.tasklist_plain_task_name then 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 function make_cell(text, font, center)
local w = textbox() local w = textbox()
w:set_markup(text) 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_valign("center")
w:set_font(font) w:set_font(font)
return w return w

View File

@ -324,14 +324,22 @@ end
-- --
--@DOC_wibox_widget_textbox_align1_EXAMPLE@ --@DOC_wibox_widget_textbox_align1_EXAMPLE@
-- --
-- @property align -- @property halign
-- @tparam[opt="left"] string align -- @tparam[opt="left"] string halign
-- @propertyvalue "left" -- @propertyvalue "left"
-- @propertyvalue "center" -- @propertyvalue "center"
-- @propertyvalue "right" -- @propertyvalue "right"
-- @propemits true false -- @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" } local allowed = { left = "LEFT", center = "CENTER", right = "RIGHT" }
if allowed[mode] then if allowed[mode] then
if self._private.layout:get_alignment() == 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::redraw_needed")
self:emit_signal("widget::layout_changed") self:emit_signal("widget::layout_changed")
self:emit_signal("property::align", mode) self:emit_signal("property::align", mode)
self:emit_signal("property::halign", mode)
end end
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. --- Set a textbox font.
-- --
-- There is multiple valid font string representation. The most precise is -- 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_ellipsize("end")
ret:set_wrap("word_char") ret:set_wrap("word_char")
ret:set_valign("center") ret:set_valign("center")
ret:set_align("left") ret:set_halign("left")
if text then if text then
if ignore_markup then if ignore_markup then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -64,7 +64,7 @@ for i=0, 1 do
{ {
text = "Center", text = "Center",
valign = "center", valign = "center",
align = "center", halign = "center",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
widget = wibox.layout.stack widget = wibox.layout.stack

View File

@ -49,7 +49,7 @@ for i=0, 1 do
{ {
text = "Center", text = "Center",
valign = "center", valign = "center",
align = "center", halign = "center",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
widget = wibox.layout.stack widget = wibox.layout.stack

View File

@ -49,7 +49,7 @@ for i=0, 1 do
{ {
text = "Center", text = "Center",
valign = "center", valign = "center",
align = "center", halign = "center",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
widget = wibox.layout.stack widget = wibox.layout.stack

View File

@ -49,7 +49,7 @@ for i=0, 1 do
{ {
text = "Center", text = "Center",
valign = "center", valign = "center",
align = "center", halign = "center",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
widget = wibox.layout.stack widget = wibox.layout.stack

View File

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

View File

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

View File

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

View File

@ -43,7 +43,7 @@ require("_default_look")
{ {
text = "Center", text = "Center",
valign = "center", valign = "center",
align = "center", halign = "center",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
widget = wibox.layout.stack 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>", markup = "<tt><b>[SYSTEM FAILURE]</b></tt>",
valign = "center", valign = "center",
align = "center", halign = "center",
widget = wibox.widget.textbox widget = wibox.widget.textbox
}, },
fg = "#00ff00", fg = "#00ff00",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@ awful.wibar {
width = 196, width = 196,
widget = { widget = {
text = "stretched", text = "stretched",
align = "center", halign = "center",
widget = wibox.widget.textbox 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>", markup = "<span color='#ff000055'>Code for this sequence</span>",
align = "center", halign = "center",
foced_width = w, foced_width = w,
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,11 +25,11 @@ beautiful.notification_bg = beautiful.bg_normal --DOC_HIDE
widget = wibox.container.place widget = wibox.container.place
}, },
{ {
align = "center", halign = "center",
widget = naughty.widget.title, widget = naughty.widget.title,
}, },
{ {
align = "center", halign = "center",
widget = naughty.widget.message, 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..'}', text = '{day='..date.day..', month='..date.month..',\n year='..date.year..'}',
align = 'center', halign = 'center',
widget = wibox.widget.textbox widget = wibox.widget.textbox
}, },
border_width = 2, border_width = 2,
@ -35,7 +35,7 @@ local date = os.date("*t") --DOC_HIDE
{ {
{ {
text = '{month='..date.month..',\n year='..date.year..'}', text = '{month='..date.month..',\n year='..date.year..'}',
align = 'center', halign = 'center',
widget = wibox.widget.textbox widget = wibox.widget.textbox
}, },
border_width = 2, border_width = 2,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,7 +39,7 @@ local function create_titlebar(c)
-- The title goes in the middle -- The title goes in the middle
parts.title = awful.titlebar.widget.titlewidget(c) 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) local middle_layout = wibox.layout.flex.horizontal(parts.title)
middle_layout.buttons = buttons middle_layout.buttons = buttons