Merge pull request #3014 from Elv13/fix_keyboard_wdg
Fix the keyboard widget
This commit is contained in:
commit
607badcaa7
|
@ -252,6 +252,9 @@ local function update_layout(self)
|
|||
update_status(self)
|
||||
end
|
||||
|
||||
--- Select the next layout.
|
||||
-- @method next_layout
|
||||
|
||||
--- Create a keyboard layout widget.
|
||||
--
|
||||
-- It shows current keyboard layout name in a textbox.
|
||||
|
@ -260,7 +263,7 @@ end
|
|||
-- @return A keyboard layout widget.
|
||||
function keyboardlayout.new()
|
||||
local widget = textbox()
|
||||
local self = widget_base.make_widget(widget)
|
||||
local self = widget_base.make_widget(widget, nil, {enable_properties=true})
|
||||
|
||||
self.widget = widget
|
||||
|
||||
|
|
|
@ -684,8 +684,15 @@ end
|
|||
-- @constructorfct wibox.widget.base.make_widget
|
||||
function base.make_widget(proxy, widget_name, args)
|
||||
args = args or {}
|
||||
|
||||
local prop_default = args.enable_properties ~= false
|
||||
|
||||
if awesome.api_level < 5 then
|
||||
prop_default = args.enable_properties
|
||||
end
|
||||
|
||||
local ret = object {
|
||||
enable_properties = args.enable_properties,
|
||||
enable_properties = prop_default,
|
||||
class = args.class,
|
||||
}
|
||||
|
||||
|
@ -765,6 +772,13 @@ function base.make_widget(proxy, widget_name, args)
|
|||
|
||||
return rawget(ret, key)
|
||||
end
|
||||
mt.__newindex = function(_, key, value)
|
||||
if key == "buttons" then
|
||||
base.widget.set_buttons(ret, value)
|
||||
else
|
||||
rawset(ret, key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return setmetatable(ret, mt)
|
||||
|
|
|
@ -10,6 +10,8 @@ local say = require("say")
|
|||
local assert = require("luassert")
|
||||
local no_parent = base.no_parent_I_know_what_I_am_doing
|
||||
|
||||
_G.awesome.api_level = 9999
|
||||
|
||||
-- {{{ Own widget-based assertions
|
||||
local function widget_fit(state, arguments)
|
||||
if #arguments ~= 3 then
|
||||
|
|
Loading…
Reference in New Issue