added back highlight on focus gain in edit boxes (but double click also remains

This commit is contained in:
Manuel Simon Hirsig
2016-05-06 09:35:43 +02:00
parent 2edf39c4ef
commit a49bdd8317
3 changed files with 20 additions and 11 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
Aux = { Aux = {
version = '2.12.0', version = '2.12.1',
blizzard_ui_shown = false, blizzard_ui_shown = false,
orig = {}, orig = {},
} }
+7
View File
@@ -292,7 +292,13 @@ function m.editbox(parent, name)
this:ClearFocus() this:ClearFocus()
end) end)
do
local last_time, last_x, last_y local last_time, last_x, last_y
editbox:SetScript('OnEditFocusGained', function()
this:HighlightText()
end)
editbox:SetScript('OnMouseUp', function() editbox:SetScript('OnMouseUp', function()
local x, y = GetCursorPosition() 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 if last_time and last_time > GetTime() - .5 and abs(x - last_x) < 10 and abs(y - last_y) < 10 then
@@ -303,6 +309,7 @@ function m.editbox(parent, name)
last_x, last_y = GetCursorPosition() last_x, last_y = GetCursorPosition()
end end
end) end)
end
-- local label = frame:CreateFontString(nil, 'OVERLAY') -- local label = frame:CreateFontString(nil, 'OVERLAY')
-- label:SetPoint('TOPLEFT', 0, -2) -- label:SetPoint('TOPLEFT', 0, -2)
+2
View File
@@ -368,6 +368,7 @@ function public.on_load()
this:ClearFocus() this:ClearFocus()
end) end)
editbox:SetScript('OnEditFocusGained', function() editbox:SetScript('OnEditFocusGained', function()
this:HighlightText()
this.pretty:Hide() this.pretty:Hide()
end) end)
editbox:SetScript('OnEditFocusLost', function() editbox:SetScript('OnEditFocusLost', function()
@@ -411,6 +412,7 @@ function public.on_load()
this:ClearFocus() this:ClearFocus()
end) end)
editbox:SetScript('OnEditFocusGained', function() editbox:SetScript('OnEditFocusGained', function()
this:HighlightText()
this.pretty:Hide() this.pretty:Hide()
end) end)
editbox:SetScript('OnEditFocusLost', function() editbox:SetScript('OnEditFocusLost', function()