From dccd5c0a5fa90a83884e6327ad5574f3c61d78ab Mon Sep 17 00:00:00 2001 From: Yessiest Date: Fri, 8 Apr 2022 17:33:44 +0400 Subject: [PATCH] Adding the default class and a generic namespace --- libs/awmtk2.lua | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/libs/awmtk2.lua b/libs/awmtk2.lua index 7576541..6a9a902 100644 --- a/libs/awmtk2.lua +++ b/libs/awmtk2.lua @@ -24,15 +24,45 @@ end -- }}} --- {{{ Classes +-- {{{ Classes and namespaces -- Default namespace -awmtk.default = setmetatable({}, { +awmtk.default = setmetatable({ -- { Backgrounds -- custom background color for highlighting elements - bg_highlight = beautiful.bg_highlight or beautiful.bg_focus + bg_highlight = beautiful.bg_highlight or beautiful.bg_focus, + -- } + -- { Borders + -- Borders for popups + shape_border_width = beautiful.shape_border_width or 0, + shape_border_color = beautiful.shape_border_color or beautiful.bg_normal, + -- } + -- { Shapes + inner_margin = beautiful.inner_margin or 5 + rounding = beautiful.rounding or 0 -- } - -- { }, { __index = beautiful }) +-- Container subnamespace +-- We copy the table instead of referncing default namespace to avoid recursion +awmtk.default.container = setmetatable({ + -- { Backgrounds + -- custom background color for highlighting elements + bg_highlight = beautiful.bg_highlight or beautiful.bg_focus, + -- } + -- { Borders + -- Borders for popups + shape_border_width = beautiful.shape_border_width or 0, + shape_border_color = beautiful.shape_border_color or beautiful.bg_normal, + -- } + -- { Shapes + inner_margin = beautiful.inner_margin or 5 + rounding = beautiful.rounding or 0 + -- } + -- { Layout spacing + spacing = (beautiful.container and beautiful.container.spacing) or 2 +},{ + __index = beautiful +}) +