working on experimental editbox double click
This commit is contained in:
@@ -264,6 +264,19 @@ function public.on_load()
|
||||
editbox:SetScript('OnEditFocusGained', function()
|
||||
this:HighlightText()
|
||||
end)
|
||||
do
|
||||
local last_time, last_x, last_y
|
||||
editbox:SetScript('OnMouseUp', function()
|
||||
local x, y = GetCursorPosition()
|
||||
if last_time and last_time > GetTime() - .5 and abs(x - last_x) < 10 and abs(y - last_y) < 10 then
|
||||
this:HighlightText()
|
||||
last_time = nil
|
||||
else
|
||||
last_time = GetTime()
|
||||
last_x, last_y = GetCursorPosition()
|
||||
end
|
||||
end)
|
||||
end
|
||||
editbox:SetScript('OnReceiveDrag', function()
|
||||
local item_info = Aux.cursor_item() and Aux.info.item(Aux.cursor_item().item_id)
|
||||
if item_info then
|
||||
|
||||
Reference in New Issue
Block a user