Added the function for creating subcontexts

This commit is contained in:
Yessiest 2022-04-08 14:08:50 +04:00
parent 732d07715e
commit bba4badb27
1 changed files with 17 additions and 2 deletions

View File

@ -7,7 +7,19 @@ local awmtk = {}
-- {{{ Utils -- {{{ Utils
awmtk.subclass = function(parent_class,instance_overrides,name)
return setmetatable(instance_overrides,{
__index = function(self,k)
if rawget(self,k) then
return rawget(self,k)
elseif type(beautiful[name]) == "table" and beautiful[name][k] then
return beautiful[name][k]
elseif parent_class[k] then
return parent_class[k]
end
end
})
end
-- }}} -- }}}
@ -17,7 +29,10 @@ local awmtk = {}
-- Default namespace -- Default namespace
awmtk.default = setmetatable({}, { awmtk.default = setmetatable({}, {
-- { Backgrounds -- { Backgrounds
-- custom background color for highlighting elements
bg_highlight = beautiful.bg_highlight or beautiful.bg_focus
-- }
-- {
}, { __index = beautiful }) }, { __index = beautiful })