From f601b91b05427afbc5e49ee9386ff061349ece5e Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 18 Mar 2016 23:19:29 +0100 Subject: [PATCH] added reordering of favorite searches --- search_frame.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/search_frame.lua b/search_frame.lua index b74f46d..65fb473 100644 --- a/search_frame.lua +++ b/search_frame.lua @@ -701,8 +701,20 @@ function public.on_load() StaticPopup_Show('AUX_SEARCH_SAVED_RENAME') elseif button == 'RightButton' and IsAltKeyDown() then -- unused - elseif button == 'LeftButton' and IsControlKeyDown() and st == private.favorite_searches_listing then - elseif button == 'RightButton' and IsControlKeyDown() and st == private.favorite_searches_listing then + elseif button == 'LeftButton' and IsControlKeyDown() then + if st == private.favorite_searches_listing and data.index > 1 then + local temp = aux_favorite_searches[data.index - 1] + aux_favorite_searches[data.index - 1] = data.search + aux_favorite_searches[data.index] = temp + private.update_search_listings() + end + elseif button == 'RightButton' and IsControlKeyDown() then + if st == private.favorite_searches_listing and data.index < getn(aux_favorite_searches) then + local temp = aux_favorite_searches[data.index + 1] + aux_favorite_searches[data.index + 1] = data.search + aux_favorite_searches[data.index] = temp + private.update_search_listings() + end elseif button == 'LeftButton' then private.search_box:SetText(data.search.filter_string) public.start_search()