From 1eb24dfc2fec9280899b0c11f7b6f442a6805260 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 7 Aug 2016 07:52:36 +0200 Subject: [PATCH] minor changes --- gui.lua | 31 ++++++++++++++++++++++++++++++- tabs/post/frames.lua | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/gui.lua b/gui.lua index 331a215..d8532f7 100644 --- a/gui.lua +++ b/gui.lua @@ -45,7 +45,37 @@ public.inline_color = aux.index_function(function(self, key) return format('|c%02X%02X%02X%02X', unpack(color)) end) +do + local dropdown + + function public.menu(...) + UIDropDownMenu_Initialize(dropdown, function() + for i=1,arg.n-1 do + UIDropDownMenu_AddButton{ + text = arg[i], + value = i, + func = function() + return arg[arg.n](this.value) + end, + } + end + end, 'MENU') + dropdown:SetPoint('BOTTOMLEFT', GetCursorPosition()) + ToggleDropDownMenu(nil, nil, dropdown, nil, 0, 0) + end + + function private.initialize_menu() + dropdown = CreateFrame('Frame', 'aux_frame'..aux.id(), UIParent, 'UIDropDownMenuTemplate') + dropdown:SetWidth(1) + dropdown:SetHeight(1) + dropdown:SetAlpha(0) + end + +end + function m.LOAD() + m.initialize_menu() + local backdrop = DropDownList1Backdrop:GetBackdrop() aux.hook('ToggleDropDownMenu', function(...) local ret = {aux.orig.ToggleDropDownMenu(unpack(arg))} @@ -93,7 +123,6 @@ function m.LOAD() end return unpack(ret) end) - end function public.set_frame_style(frame, backdrop_color, border_color, left, right, top, bottom) diff --git a/tabs/post/frames.lua b/tabs/post/frames.lua index ccdb4d4..d66a494 100644 --- a/tabs/post/frames.lua +++ b/tabs/post/frames.lua @@ -347,7 +347,7 @@ aux.post_tab.FRAMES(function(m, public, private) btn:SetWidth(150) btn:SetHeight(20) btn:GetFontString():SetJustifyH('RIGHT') - btn:GetFontString():SetPoint('RIGHT', 0, 0) + btn:GetFontString():SetPoint('RIGHT', -2, 0) btn:SetScript('OnClick', function() if this.amount then m.set_unit_start_price(this.amount)