awful.wibox: Error out on invalid positions
Signed-off-by: Uli Schlachter <psychon@znc.in> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
444edf1d03
commit
7fc0c24f4f
|
@ -17,6 +17,7 @@ local ipairs = ipairs
|
|||
local table = table
|
||||
local type = type
|
||||
local image = image
|
||||
local error = error
|
||||
|
||||
--- Wibox module for awful.
|
||||
-- This module allows you to easily create wibox and attach them to the edge of
|
||||
|
@ -213,6 +214,12 @@ function new(arg)
|
|||
-- Empty position and align in arg so we are passing deprecation warning
|
||||
arg.position = nil
|
||||
|
||||
if position ~= "top" and position ~="bottom"
|
||||
and position ~= "left" and position ~= "right" then
|
||||
error("Invalid position in awful.wibox(), you may only use"
|
||||
.. " 'top', 'bottom', 'left' and 'right'")
|
||||
end
|
||||
|
||||
-- Set default size
|
||||
if position == "left" or position == "right" then
|
||||
arg.width = arg.width or capi.awesome.font_height * 1.5
|
||||
|
|
Loading…
Reference in New Issue