fix(menubar): reset search query when menubar closes (#1553)
* fix(menubar): reset search query when menubar closes * refactor(menubar): remove redundant argument for menulist_update()
This commit is contained in:
parent
148723f053
commit
439d0c804c
|
@ -231,8 +231,8 @@ end
|
||||||
--- Update the menubar according to the command entered by user.
|
--- Update the menubar according to the command entered by user.
|
||||||
-- @tparam str query Search query.
|
-- @tparam str query Search query.
|
||||||
-- @tparam number|screen scr Screen
|
-- @tparam number|screen scr Screen
|
||||||
local function menulist_update(query, scr)
|
local function menulist_update(scr)
|
||||||
query = query or ""
|
local query = instance.query or ""
|
||||||
shownitems = {}
|
shownitems = {}
|
||||||
local pattern = awful.util.query_to_pattern(query)
|
local pattern = awful.util.query_to_pattern(query)
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ function menubar.refresh(scr)
|
||||||
menubar.menu_gen.generate(function(entries)
|
menubar.menu_gen.generate(function(entries)
|
||||||
menubar.menu_entries = entries
|
menubar.menu_entries = entries
|
||||||
if instance then
|
if instance then
|
||||||
menulist_update(instance.query, scr)
|
menulist_update(scr)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -435,7 +435,7 @@ function menubar.show(scr)
|
||||||
|
|
||||||
current_item = 1
|
current_item = 1
|
||||||
current_category = nil
|
current_category = nil
|
||||||
menulist_update(instance.query, scr)
|
menulist_update(scr)
|
||||||
|
|
||||||
local prompt_args = menubar.prompt_args or {}
|
local prompt_args = menubar.prompt_args or {}
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ function menubar.show(scr)
|
||||||
done_callback = menubar.hide,
|
done_callback = menubar.hide,
|
||||||
changed_callback = function(query)
|
changed_callback = function(query)
|
||||||
instance.query = query
|
instance.query = query
|
||||||
menulist_update(query, scr)
|
menulist_update(scr)
|
||||||
end,
|
end,
|
||||||
keypressed_callback = prompt_keypressed_callback
|
keypressed_callback = prompt_keypressed_callback
|
||||||
}, {__index=prompt_args}))
|
}, {__index=prompt_args}))
|
||||||
|
@ -459,6 +459,7 @@ end
|
||||||
function menubar.hide()
|
function menubar.hide()
|
||||||
if instance then
|
if instance then
|
||||||
instance.wibox.visible = false
|
instance.wibox.visible = false
|
||||||
|
instance.query = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue