mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Kill search focus when clicking outside of editor
This commit is contained in:
parent
0b05459aff
commit
88bf607370
@ -271,12 +271,21 @@ do -- list
|
||||
search:Dock(TOP)
|
||||
search:SetPlaceholderText("Search...")
|
||||
|
||||
search.OnTextChanged = function()
|
||||
search:SetUpdateOnType(true)
|
||||
|
||||
--[[
|
||||
function search:OnKeyCode(code)
|
||||
if code == KEY_ESCAPE then
|
||||
self:KillFocus()
|
||||
end
|
||||
end
|
||||
]]
|
||||
|
||||
search.OnValueChange = function(_, pattern)
|
||||
self.scr:SetScroll(0)
|
||||
|
||||
local pattern = search:GetValue()
|
||||
|
||||
local group
|
||||
|
||||
for i,v in ipairs(self.List) do
|
||||
local found = false
|
||||
|
||||
@ -331,6 +340,7 @@ do -- list
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.search = search
|
||||
|
||||
self.List = {}
|
||||
|
@ -100,6 +100,14 @@ function pace.GUIMousePressed(mc)
|
||||
|
||||
if IsValid(hoveredPanelCursor) then
|
||||
hoveredPanelCursor:SetCursor('sizeall')
|
||||
|
||||
if IsValid(pace.properties) and IsValid(pace.properties.search) and pace.properties.search:HasFocus() then
|
||||
-- pace.properties.search:KillFocus()
|
||||
-- it won't let it's focus taken easily
|
||||
-- thanks gmod
|
||||
pace.properties:RequestFocus()
|
||||
pace.properties:KillFocus()
|
||||
end
|
||||
end
|
||||
|
||||
mcode = mc
|
||||
|
Loading…
Reference in New Issue
Block a user