Add unfocus on client focus prop
This commit is contained in:
parent
a99eb3ffe0
commit
e1c556e1cb
|
@ -28,7 +28,7 @@ local text_input = {
|
||||||
}
|
}
|
||||||
|
|
||||||
local properties = {
|
local properties = {
|
||||||
"unfocus_keys", "unfocus_on_clicked_outside", "unfocus_on_mouse_leave", "unfocus_on_tag_change",
|
"unfocus_keys", "unfocus_on_clicked_outside", "unfocus_on_mouse_leave", "unfocus_on_tag_change", "unfocus_on_client_focus",
|
||||||
"focus_on_subject_mouse_enter", "unfocus_on_subject_mouse_leave",
|
"focus_on_subject_mouse_enter", "unfocus_on_subject_mouse_leave",
|
||||||
"reset_on_unfocus",
|
"reset_on_unfocus",
|
||||||
"placeholder", "initial", "pattern", "obscure",
|
"placeholder", "initial", "pattern", "obscure",
|
||||||
|
@ -749,6 +749,7 @@ local function new()
|
||||||
wp.unfocus_on_mouse_leave = false
|
wp.unfocus_on_mouse_leave = false
|
||||||
wp.unfocus_on_tag_change = true
|
wp.unfocus_on_tag_change = true
|
||||||
wp.unfocus_on_other_text_input_focus = true
|
wp.unfocus_on_other_text_input_focus = true
|
||||||
|
wp.unfocus_on_client_focus = true
|
||||||
|
|
||||||
wp.focus_on_subject_mouse_enter = nil
|
wp.focus_on_subject_mouse_enter = nil
|
||||||
wp.unfocus_on_subject_mouse_leave = nil
|
wp.unfocus_on_subject_mouse_leave = nil
|
||||||
|
@ -795,6 +796,12 @@ local function new()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
capi.client.connect_signal("focus", function()
|
||||||
|
if wp.unfocus_on_client_focus then
|
||||||
|
widget:unfocus()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
return widget
|
return widget
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue