Merge pull request #618 from actionless/titlebar-optional-tooltips
feat(awful: titlebar): make tooltips optional
This commit is contained in:
commit
0d1c98a314
|
@ -26,6 +26,9 @@ local titlebar = {
|
||||||
widget = {}
|
widget = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--- Show tooltips when hover on titlebar buttons (defaults to 'true')
|
||||||
|
titlebar.enable_tooltip = true
|
||||||
|
|
||||||
local all_titlebars = setmetatable({}, { __mode = 'k' })
|
local all_titlebars = setmetatable({}, { __mode = 'k' })
|
||||||
|
|
||||||
-- Get a color for a titlebar, this tests many values from the array and the theme
|
-- Get a color for a titlebar, this tests many values from the array and the theme
|
||||||
|
@ -191,8 +194,10 @@ end
|
||||||
function titlebar.widget.button(c, name, selector, action)
|
function titlebar.widget.button(c, name, selector, action)
|
||||||
local ret = imagebox()
|
local ret = imagebox()
|
||||||
|
|
||||||
|
if titlebar.enable_tooltip then
|
||||||
ret.tooltip = atooltip({ objects = {ret}, delay_show = 1 })
|
ret.tooltip = atooltip({ objects = {ret}, delay_show = 1 })
|
||||||
ret.tooltip:set_text(name)
|
ret.tooltip:set_text(name)
|
||||||
|
end
|
||||||
|
|
||||||
local function update()
|
local function update()
|
||||||
local img = selector(c)
|
local img = selector(c)
|
||||||
|
|
Loading…
Reference in New Issue