diff --git a/README.md b/README.md index 465586b..4d9d858 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ Multiple items can have multiple sets of options. | bg_header | Header (see widgets section) color | String/gradient/pattern | | bg_prefix | Prefix background for item_styles that support it | String/gradient/pattern | | border_color | Border color | String/gradient/pattern | +| item_border_color | Alternative border color for item separation | String/gradient/pattern | | border_width | Border width | number | | item_height | Default height of items | number | | item_width | Default width of items | number | @@ -200,6 +201,7 @@ Multiple items can have multiple sets of options. | overlay | A layer on top of the item | function(data,item,cr,w,h) | | opacity | Make this menu translucent (require a compositor) | number (0 to 1) | | icon_transformation | Hijack the icon drawing function | function(icon,data,item) | +| icon_per_state | Call icon_transformation when state change | boolean | | disable_submenu_icon| Do not show the submenu icon (arrow) | boolean | | margins | Read/Write table (left,right,top and bottom) | dynamic table | | visible_row_count | Number of visible items -(#max-(#total-#filtered)) | number | diff --git a/base.lua b/base.lua index b4568a0..ad895a6 100644 --- a/base.lua +++ b/base.lua @@ -358,6 +358,7 @@ local function new(args) filter_underlay_color = args.filter_underlay_color, filter_placeholder = args.filter_placeholder or "", disable_submenu_icon = args.disable_submenu_icon or false, + item_border_color = args.item_border_color or nil, }, force_private = { parent = true, diff --git a/item/init.lua b/item/init.lua index 5510543..7731e92 100644 --- a/item/init.lua +++ b/item/init.lua @@ -118,6 +118,7 @@ local function new_item(data,args) style = args.style or data.item_style , layout = args.layout or args.item_layout or nil , overlay = args.overlay or data.overlay or nil , + item_border_color = args.item_border_color or data.item_border_color or nil , }, force_private = { visible = true, diff --git a/style/grouped_3d.lua b/style/grouped_3d.lua index 6dbe625..d38856a 100644 --- a/style/grouped_3d.lua +++ b/style/grouped_3d.lua @@ -25,12 +25,15 @@ end local function draw2(self,w, cr, width, height) cr:save() - cr:set_source_rgba(1,0,0,1) local mx,my = self.left or 0, self.top or 0 local mw,mh = width - mx - (self.right or 0), height - my - (self.bottom or 0) rounded_rect(cr,mx,my,mw,mh,6) + local path = cr:copy_path() cr:clip() self.___draw(self,w, cr, width, height) + cr:append_path(path) + cr:set_source(color(self.data.border_color)) + cr:stroke() cr:restore() end @@ -41,6 +44,7 @@ local function draw(data) if m then m.___draw = m.draw m.draw = draw2 + m.data = data end end diff --git a/theme/init.lua b/theme/init.lua index ffa6a95..dd24a50 100644 --- a/theme/init.lua +++ b/theme/init.lua @@ -100,6 +100,8 @@ function module.add_colors_from_namespace(data,namespace) end priv["fg"] = beautiful[namespace.."_fg"] or priv["fg"] priv["bg"] = beautiful[namespace.."_bg"] or priv["bg"] + priv["border_color"] = beautiful[namespace.."_border_color"] or priv["border_color"] + priv["item_border_color"] = beautiful[namespace.."_item_border_color"] or priv["item_border_color"] priv.namespace = priv.namespace or {} priv.namespace[#priv.namespace+1] = namespace end