wibox: Add widget and layout metatable for widget creation
Calling wibox.widget.base.make_widget_declarative{} is too long, so this commit add wibox.widget{} and wibox.layout{} alias.
This commit is contained in:
parent
951e0309f5
commit
f1816474df
|
@ -6,9 +6,9 @@
|
||||||
-- @release @AWESOME_VERSION@
|
-- @release @AWESOME_VERSION@
|
||||||
-- @classmod wibox.layout
|
-- @classmod wibox.layout
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
local base = require("wibox.widget.base")
|
||||||
|
|
||||||
return
|
return setmetatable({
|
||||||
{
|
|
||||||
fixed = require("wibox.layout.fixed");
|
fixed = require("wibox.layout.fixed");
|
||||||
align = require("wibox.layout.align");
|
align = require("wibox.layout.align");
|
||||||
flex = require("wibox.layout.flex");
|
flex = require("wibox.layout.flex");
|
||||||
|
@ -19,6 +19,6 @@ return
|
||||||
scroll = require("wibox.layout.scroll");
|
scroll = require("wibox.layout.scroll");
|
||||||
ratio = require("wibox.layout.ratio");
|
ratio = require("wibox.layout.ratio");
|
||||||
stack = require("wibox.layout.stack");
|
stack = require("wibox.layout.stack");
|
||||||
}
|
}, {__call = function(_, args) return base.make_widget_declarative(args) end})
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
-- @release @AWESOME_VERSION@
|
-- @release @AWESOME_VERSION@
|
||||||
-- @classmod wibox.widget
|
-- @classmod wibox.widget
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
local base = require("wibox.widget.base")
|
||||||
|
|
||||||
return
|
return setmetatable({
|
||||||
{
|
base = base;
|
||||||
base = require("wibox.widget.base");
|
|
||||||
textbox = require("wibox.widget.textbox");
|
textbox = require("wibox.widget.textbox");
|
||||||
imagebox = require("wibox.widget.imagebox");
|
imagebox = require("wibox.widget.imagebox");
|
||||||
background = require("wibox.widget.background");
|
background = require("wibox.widget.background");
|
||||||
systray = require("wibox.widget.systray");
|
systray = require("wibox.widget.systray");
|
||||||
}
|
}, {__call = function(_, args) return base.make_widget_declarative(args) end})
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue