From 9c013c0730192ee5ab3bae2370a55732a6a268ed Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 22 Sep 2014 01:22:18 -0400 Subject: [PATCH] Add 'visible_row_count' property get the number of visible items (total-filter-max) --- margins.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 margins.lua diff --git a/margins.lua b/margins.lua new file mode 100644 index 0000000..9149e90 --- /dev/null +++ b/margins.lua @@ -0,0 +1,32 @@ +-- This helper module create a virtual margin object. This then used as a proxy +-- between the real wibox.widget.margins and the Radical menu. + +local setmetatable = setmetatable +local module = {} + +function module.create(widget,default) + local mt = setmetatable({merge = function(values) + if values.left then + widget:set_left(values.left) + end + if values.right then + widget:set_right(values.right) + end + if values.top then + widget:set_top(values.top) + end + if values.bottom then + widget:set_bottom(values.bottom) + end + end + },{__newindex = function(tab, key,value) + widget["set_"..key](widget,value) + end + ,__index=function(table,key) + return widget[key] + end}} + return mt +end + +return module +-- kate: space-indent on; indent-width 2; replace-tabs on; \ No newline at end of file