wibox: Support the declarative container syntax

Also support it for titlebars
This commit is contained in:
Emmanuel Lepage Vallee 2015-09-27 17:00:01 +02:00
parent 6a68173ccb
commit 7842f92f08
2 changed files with 17 additions and 0 deletions

View File

@ -26,6 +26,12 @@ local titlebar = {
widget = {} widget = {}
} }
--- Set a declarative widget hierarchy description.
-- See [The declarative layout system](../documentation/03-declarative-layout.md.html)
-- @param args An array containing the widgets disposition
-- @name setup
-- @class function
--- Show tooltips when hover on titlebar buttons (defaults to 'true') --- Show tooltips when hover on titlebar buttons (defaults to 'true')
titlebar.enable_tooltip = true titlebar.enable_tooltip = true
@ -108,6 +114,9 @@ local function new(c, args)
-- Make sure the titlebar has the right colors applied -- Make sure the titlebar has the right colors applied
bars[position].update_colors() bars[position].update_colors()
-- Handle declarative/recursive widget container
ret.setup = base.widget.setup
return ret return ret
end end

View File

@ -21,6 +21,7 @@ local sort = require("gears.sort")
local beautiful = require("beautiful") local beautiful = require("beautiful")
local surface = require("gears.surface") local surface = require("gears.surface")
local cairo = require("lgi").cairo local cairo = require("lgi").cairo
local base = require("wibox.widget.base")
--- This provides widget box windows. Every wibox can also be used as if it were --- This provides widget box windows. Every wibox can also be used as if it were
-- a drawin. All drawin functions and properties are also available on wiboxes! -- a drawin. All drawin functions and properties are also available on wiboxes!
@ -36,6 +37,13 @@ function wibox:set_widget(widget)
self._drawable:set_widget(widget) self._drawable:set_widget(widget)
end end
--- Set a declarative widget hierarchy description.
-- See [The declarative layout system](../documentation/03-declarative-layout.md.html)
-- @param args An array containing the widgets disposition
-- @name setup
-- @class function
wibox.setup = base.widget.setup
--- Set the background of the wibox --- Set the background of the wibox
-- @param c The background to use. This must either be a cairo pattern object, -- @param c The background to use. This must either be a cairo pattern object,
-- nil or a string that gears.color() understands. -- nil or a string that gears.color() understands.