tag: Support property fallback
This commit is contained in:
parent
a77e650c5f
commit
e0897cf170
|
@ -11,6 +11,7 @@
|
|||
local util = require("awful.util")
|
||||
local ascreen = require("awful.screen")
|
||||
local beautiful = require("beautiful")
|
||||
local object = require("gears.object")
|
||||
local pairs = pairs
|
||||
local ipairs = ipairs
|
||||
local table = table
|
||||
|
@ -873,6 +874,16 @@ function tag.mt:__call(...)
|
|||
return tag.new(...)
|
||||
end
|
||||
|
||||
-- Extend the luaobject
|
||||
-- `awful.tag.setproperty` currently handle calling the setter method itself
|
||||
-- while `awful.tag.getproperty`.
|
||||
object.properties(capi.tag, {
|
||||
getter_class = tag,
|
||||
setter_class = tag,
|
||||
getter_fallback = tag.getproperty,
|
||||
setter = tag.setproperty,
|
||||
})
|
||||
|
||||
return setmetatable(tag, tag.mt)
|
||||
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue