@@ -43,7 +43,7 @@ return function(Config)
4343 local Dragging , DragInput , MousePos , StartPos = false
4444 local Resizing , ResizePos = false
4545 local MinimizeNotif = false
46- local IsDraggingHideButton , DragInput , DragStart , DragStartPos = false
46+ local IsDraggingHideButton , DragInputHideButton , DragStart , DragStartPos = false
4747
4848 Window .AcrylicPaint = Acrylic .AcrylicPaint ()
4949 Window .TabWidth = Config .TabWidth
@@ -298,10 +298,6 @@ return function(Config)
298298 end
299299 end
300300
301- if Input .UserInputType == Enum.UserInputType.MouseMovement and IsDraggingHideButton then
302- DragInput = Input
303- end
304-
305301 if
306302 (Input .UserInputType == Enum.UserInputType.MouseMovement or Input .UserInputType == Enum.UserInputType.Touch )
307303 and Resizing
@@ -350,15 +346,12 @@ return function(Config)
350346 Duration = 6
351347 })
352348 end
353-
354349 if Library .Utilities :GetOS () == "Mobile" then
355350 local Icon = Config .Mobile .GetIcon (Window .Minimized )
356-
357351 Window .HideButton .Image = Icon .Image
358352 Window .HideButton .ImageRectOffset = Icon .ImageRectOffset
359- Window .HideButton .ImageRectSize = Icon .ImageRectSize
353+ Window .HideButton .ImageRectSize = Icon .ImageRectSiz
360354 end
361-
362355 Window .PostMinimized :Fire (tick (), Window .Root .Visible )
363356 end
364357
@@ -377,35 +370,51 @@ return function(Config)
377370 end )
378371
379372 Creator .AddSignal (Window .HideButton .InputBegan , function (Input )
380- if Input .UserInputType == Enum.UserInputType.MouseButton1 then
373+ if
374+ Input .UserInputType == Enum.UserInputType.MouseButton1
375+ or Input .UserInputType == Enum.UserInputType.Touch
376+ then
381377 IsDraggingHideButton = true
382378 DragStart = Input .Position
383- StartPos = Window .HideButton .Position
384-
385- local DragThread = task.spawn (function ()
386- while Library .Loaded and IsDraggingHideButton and DragInput and task.wait () do
387- local delta = DragInput .Position - DragStart
388- Window .HideButton .Position = UDim2 .new (StartPos .X .Scale , StartPos .X .Offset + delta .X , StartPos .Y .Scale , StartPos .Y .Offset + delta .Y )
389- end
390- end )
379+ DragStartPos = Window .HideButton .Position
391380
392- local InputEnded ; InputEnded = Input .Changed :Connect (function ()
381+ Input .Changed :Connect (function ()
393382 if Input .UserInputState == Enum.UserInputState.End then
394383 IsDraggingHideButton = false
395- task .cancel (DragThread )
396- InputEnded :Disconnect ()
397384 end
398385 end )
399386 end
400387 end )
401388
389+ Creator .AddSignal (Window .HideButton .InputChanged , function (Input )
390+ if
391+ Input .UserInputType == Enum.UserInputType.MouseMovement
392+ or Input .UserInputType == Enum.UserInputType.Touch
393+ then
394+ DragInputHideButton = Input
395+ end
396+ end )
397+
398+ Creator .AddSignal (UserInputService .InputChanged , function (Input )
399+ if Input == DragInputHideButton and IsDraggingHideButton then
400+ local delta = Input .Position - DragStart
401+ Window .HideButton .Position = UDim2 .new (DragStartPos .X .Scale , DragStartPos .X .Offset + delta .X , DragStartPos .Y .Scale , DragStartPos .Y .Offset + delta .Y )
402+ end
403+ end )
404+
402405 if Library .Utilities :GetOS () == "Mobile" then
403406 Creator .AddSignal (Window .HideButton .TouchTap , function ()
404- Window :Minimize ()
407+ Window .Minimized = not Window .Minimized
408+ Window .Root .Visible = not Window .Minimized
409+ local Icon = Config .Mobile .GetIcon (Window .Minimized )
410+ Window .HideButton .Image = Icon .Image
411+ Window .HideButton .ImageRectOffset = Icon .ImageRectOffset
412+ Window .HideButton .ImageRectSize = Icon .ImageRectSize
405413 end )
406414 else
407415 Creator .AddSignal (Window .HideButton .MouseButton1Click , function ()
408- Window :Minimize ()
416+ Window .Minimized = not Window .Minimized
417+ Window .Root .Visible = not Window .Minimized
409418 end )
410419 end
411420
0 commit comments