@@ -217,13 +217,14 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
217
217
end
218
218
local WindowButton = Window .WindowButton :: TextButton
219
219
local ResizeBorder : TextButton = WindowButton .ResizeBorder
220
- if ResizeBorder and widgets .isPosInsideRect (position , ResizeBorder .AbsolutePosition , ResizeBorder .AbsolutePosition + ResizeBorder .AbsoluteSize ) then
220
+ if ResizeBorder and widgets .isPosInsideRect (position , ResizeBorder .AbsolutePosition - widgets . GuiOffset , ResizeBorder .AbsolutePosition - widgets . GuiOffset + ResizeBorder .AbsoluteSize ) then
221
221
inWindow = true
222
222
break
223
223
end
224
224
end
225
225
226
226
if not inWindow then
227
+ print (" Outside" )
227
228
Iris .SetFocusedWindow (nil )
228
229
end
229
230
end
@@ -630,32 +631,67 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
630
631
631
632
local ResizeButtonSize : number = Iris ._config .TextSize + Iris ._config .FramePadding .X
632
633
633
- local ResizeGrip = Instance .new (" ImageButton" )
634
- ResizeGrip .Name = " ResizeGrip"
635
- ResizeGrip .AnchorPoint = Vector2 .one
636
- ResizeGrip .Size = UDim2 .fromOffset (ResizeButtonSize , ResizeButtonSize )
637
- ResizeGrip .Position = UDim2 .fromScale (1 , 1 )
638
- ResizeGrip .Rotation = 90
639
- ResizeGrip .AutoButtonColor = false
640
- ResizeGrip .BorderSizePixel = 0
641
- ResizeGrip .BackgroundTransparency = 1
642
- ResizeGrip .Image = widgets .ICONS .BOTTOM_RIGHT_CORNER
643
- ResizeGrip .ImageColor3 = Iris ._config .ButtonColor
644
- ResizeGrip .ImageTransparency = Iris ._config .ButtonTransparency
645
- ResizeGrip .Selectable = false
646
- ResizeGrip .ZIndex = 3
647
- ResizeGrip .Parent = WindowButton
648
-
649
- widgets .applyInteractionHighlights (" Image" , ResizeGrip , ResizeGrip , {
650
- Color = Iris ._config .ButtonColor ,
651
- Transparency = Iris ._config .ButtonTransparency ,
652
- HoveredColor = Iris ._config .ButtonHoveredColor ,
653
- HoveredTransparency = Iris ._config .ButtonHoveredTransparency ,
654
- ActiveColor = Iris ._config .ButtonActiveColor ,
655
- ActiveTransparency = Iris ._config .ButtonActiveTransparency ,
634
+ local LeftResizeGrip = Instance .new (" ImageButton" )
635
+ LeftResizeGrip .Name = " LeftResizeGrip"
636
+ LeftResizeGrip .AnchorPoint = Vector2 .yAxis
637
+ LeftResizeGrip .Rotation = 180
638
+ LeftResizeGrip .Size = UDim2 .fromOffset (ResizeButtonSize , ResizeButtonSize )
639
+ LeftResizeGrip .Position = UDim2 .fromScale (0 , 1 )
640
+ LeftResizeGrip .BackgroundTransparency = 1
641
+ LeftResizeGrip .BorderSizePixel = 0
642
+ LeftResizeGrip .Image = widgets .ICONS .BOTTOM_RIGHT_CORNER
643
+ LeftResizeGrip .ImageColor3 = Iris ._config .ResizeGripColor
644
+ LeftResizeGrip .ImageTransparency = 1
645
+ LeftResizeGrip .AutoButtonColor = false
646
+ LeftResizeGrip .ZIndex = 3
647
+ LeftResizeGrip .Parent = WindowButton
648
+
649
+ widgets .applyInteractionHighlights (" Image" , LeftResizeGrip , LeftResizeGrip , {
650
+ Color = Iris ._config .ResizeGripColor ,
651
+ Transparency = 1 ,
652
+ HoveredColor = Iris ._config .ResizeGripHoveredColor ,
653
+ HoveredTransparency = Iris ._config .ResizeGripHoveredTransparency ,
654
+ ActiveColor = Iris ._config .ResizeGripActiveColor ,
655
+ ActiveTransparency = Iris ._config .ResizeGripActiveTransparency ,
656
+ })
657
+
658
+ widgets .applyButtonDown (LeftResizeGrip , function ()
659
+ if not anyFocusedWindow or not (focusedWindow == thisWidget ) then
660
+ Iris .SetFocusedWindow (thisWidget )
661
+ -- mitigating wrong focus when clicking on buttons inside of a window without clicking the window itself
662
+ end
663
+ isResizing = true
664
+ resizeFromTopBottom = Enum .TopBottom .Bottom
665
+ resizeFromLeftRight = Enum .LeftRight .Left
666
+ resizeWindow = thisWidget
667
+ end )
668
+
669
+ -- each border uses an image, allowing it to have a visible borde which is larger than the UI
670
+ local RightResizeGrip = Instance .new (" ImageButton" )
671
+ RightResizeGrip .Name = " RightResizeGrip"
672
+ RightResizeGrip .AnchorPoint = Vector2 .one
673
+ RightResizeGrip .Rotation = 90
674
+ RightResizeGrip .Size = UDim2 .fromOffset (ResizeButtonSize , ResizeButtonSize )
675
+ RightResizeGrip .Position = UDim2 .fromScale (1 , 1 )
676
+ RightResizeGrip .BackgroundTransparency = 1
677
+ RightResizeGrip .BorderSizePixel = 0
678
+ RightResizeGrip .Image = widgets .ICONS .BOTTOM_RIGHT_CORNER
679
+ RightResizeGrip .ImageColor3 = Iris ._config .ResizeGripColor
680
+ RightResizeGrip .ImageTransparency = Iris ._config .ResizeGripTransparency
681
+ RightResizeGrip .AutoButtonColor = false
682
+ RightResizeGrip .ZIndex = 3
683
+ RightResizeGrip .Parent = WindowButton
684
+
685
+ widgets .applyInteractionHighlights (" Image" , RightResizeGrip , RightResizeGrip , {
686
+ Color = Iris ._config .ResizeGripColor ,
687
+ Transparency = Iris ._config .ResizeGripTransparency ,
688
+ HoveredColor = Iris ._config .ResizeGripHoveredColor ,
689
+ HoveredTransparency = Iris ._config .ResizeGripHoveredTransparency ,
690
+ ActiveColor = Iris ._config .ResizeGripActiveColor ,
691
+ ActiveTransparency = Iris ._config .ResizeGripActiveTransparency ,
656
692
})
657
693
658
- widgets .applyButtonDown (ResizeGrip , function ()
694
+ widgets .applyButtonDown (RightResizeGrip , function ()
659
695
if not anyFocusedWindow or not (focusedWindow == thisWidget ) then
660
696
Iris .SetFocusedWindow (thisWidget )
661
697
-- mitigating wrong focus when clicking on buttons inside of a window without clicking the window itself
@@ -666,6 +702,114 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
666
702
resizeWindow = thisWidget
667
703
end )
668
704
705
+ local LeftResizeBorder : ImageButton = Instance .new (" ImageButton" )
706
+ LeftResizeBorder .Name = " LeftResizeBorder"
707
+ LeftResizeBorder .AnchorPoint = Vector2 .new (1 , .5 )
708
+ LeftResizeBorder .Position = UDim2 .fromScale (0 , .5 )
709
+ LeftResizeBorder .Size = UDim2 .new (0 , Iris ._config .WindowResizePadding .X , 1 , 2 * Iris ._config .WindowBorderSize )
710
+ LeftResizeBorder .Transparency = 1
711
+ LeftResizeBorder .Image = widgets .ICONS .BORDER
712
+ LeftResizeBorder .ResampleMode = Enum .ResamplerMode .Pixelated
713
+ LeftResizeBorder .ScaleType = Enum .ScaleType .Slice
714
+ LeftResizeBorder .SliceCenter = Rect .new (0 , 0 , 1 , 1 )
715
+ LeftResizeBorder .ImageRectOffset = Vector2 .new (2 , 2 )
716
+ LeftResizeBorder .ImageRectSize = Vector2 .new (2 , 1 )
717
+ LeftResizeBorder .ImageTransparency = 1
718
+ LeftResizeBorder .ZIndex = 4
719
+ LeftResizeBorder .AutoButtonColor = false
720
+
721
+ LeftResizeBorder .Parent = WindowButton
722
+
723
+ local RightResizeBorder : ImageButton = Instance .new (" ImageButton" )
724
+ RightResizeBorder .Name = " RightResizeBorder"
725
+ RightResizeBorder .AnchorPoint = Vector2 .new (0 , .5 )
726
+ RightResizeBorder .Position = UDim2 .fromScale (1 , .5 )
727
+ RightResizeBorder .Size = UDim2 .new (0 , Iris ._config .WindowResizePadding .X , 1 , 2 * Iris ._config .WindowBorderSize )
728
+ RightResizeBorder .Transparency = 1
729
+ RightResizeBorder .Image = widgets .ICONS .BORDER
730
+ RightResizeBorder .ResampleMode = Enum .ResamplerMode .Pixelated
731
+ RightResizeBorder .ScaleType = Enum .ScaleType .Slice
732
+ RightResizeBorder .SliceCenter = Rect .new (1 , 0 , 2 , 1 )
733
+ RightResizeBorder .ImageRectOffset = Vector2 .new (1 , 2 )
734
+ RightResizeBorder .ImageRectSize = Vector2 .new (2 , 1 )
735
+ RightResizeBorder .ImageTransparency = 1
736
+ RightResizeBorder .ZIndex = 4
737
+ RightResizeBorder .AutoButtonColor = false
738
+
739
+ RightResizeBorder .Parent = WindowButton
740
+
741
+ local TopResizeBorder : ImageButton = Instance .new (" ImageButton" )
742
+ TopResizeBorder .Name = " TopResizeBorder"
743
+ TopResizeBorder .AnchorPoint = Vector2 .new (.5 , 1 )
744
+ TopResizeBorder .Position = UDim2 .fromScale (.5 , 0 )
745
+ TopResizeBorder .Size = UDim2 .new (1 , 2 * Iris ._config .WindowBorderSize , 0 , Iris ._config .WindowResizePadding .Y )
746
+ TopResizeBorder .Transparency = 1
747
+ TopResizeBorder .Image = widgets .ICONS .BORDER
748
+ TopResizeBorder .ResampleMode = Enum .ResamplerMode .Pixelated
749
+ TopResizeBorder .ScaleType = Enum .ScaleType .Slice
750
+ TopResizeBorder .SliceCenter = Rect .new (0 , 0 , 1 , 1 )
751
+ TopResizeBorder .ImageRectOffset = Vector2 .new (2 , 2 )
752
+ TopResizeBorder .ImageRectSize = Vector2 .new (1 , 2 )
753
+ TopResizeBorder .ImageTransparency = 1
754
+ TopResizeBorder .ZIndex = 4
755
+ TopResizeBorder .AutoButtonColor = false
756
+
757
+ TopResizeBorder .Parent = WindowButton
758
+
759
+ local BottomResizeBorder : ImageButton = Instance .new (" ImageButton" )
760
+ BottomResizeBorder .Name = " BottomResizeBorder"
761
+ BottomResizeBorder .AnchorPoint = Vector2 .new (.5 , 0 )
762
+ BottomResizeBorder .Position = UDim2 .fromScale (.5 , 1 )
763
+ BottomResizeBorder .Size = UDim2 .new (1 , 2 * Iris ._config .WindowBorderSize , 0 , Iris ._config .WindowResizePadding .Y )
764
+ BottomResizeBorder .Transparency = 1
765
+ BottomResizeBorder .Image = widgets .ICONS .BORDER
766
+ BottomResizeBorder .ResampleMode = Enum .ResamplerMode .Pixelated
767
+ BottomResizeBorder .ScaleType = Enum .ScaleType .Slice
768
+ BottomResizeBorder .SliceCenter = Rect .new (0 , 1 , 1 , 2 )
769
+ BottomResizeBorder .ImageRectOffset = Vector2 .new (2 , 1 )
770
+ BottomResizeBorder .ImageRectSize = Vector2 .new (1 , 2 )
771
+ BottomResizeBorder .ImageTransparency = 1
772
+ BottomResizeBorder .ZIndex = 4
773
+ BottomResizeBorder .AutoButtonColor = false
774
+
775
+ BottomResizeBorder .Parent = WindowButton
776
+
777
+ widgets .applyInteractionHighlights (" Image" , LeftResizeBorder , LeftResizeBorder , {
778
+ Color = Iris ._config .ResizeGripColor ,
779
+ Transparency = 1 ,
780
+ HoveredColor = Iris ._config .ResizeGripHoveredColor ,
781
+ HoveredTransparency = Iris ._config .ResizeGripHoveredTransparency ,
782
+ ActiveColor = Iris ._config .ResizeGripActiveColor ,
783
+ ActiveTransparency = Iris ._config .ResizeGripActiveTransparency ,
784
+ })
785
+
786
+ widgets .applyInteractionHighlights (" Image" , RightResizeBorder , RightResizeBorder , {
787
+ Color = Iris ._config .ResizeGripColor ,
788
+ Transparency = 1 ,
789
+ HoveredColor = Iris ._config .ResizeGripHoveredColor ,
790
+ HoveredTransparency = Iris ._config .ResizeGripHoveredTransparency ,
791
+ ActiveColor = Iris ._config .ResizeGripActiveColor ,
792
+ ActiveTransparency = Iris ._config .ResizeGripActiveTransparency ,
793
+ })
794
+
795
+ widgets .applyInteractionHighlights (" Image" , TopResizeBorder , TopResizeBorder , {
796
+ Color = Iris ._config .ResizeGripColor ,
797
+ Transparency = 1 ,
798
+ HoveredColor = Iris ._config .ResizeGripHoveredColor ,
799
+ HoveredTransparency = Iris ._config .ResizeGripHoveredTransparency ,
800
+ ActiveColor = Iris ._config .ResizeGripActiveColor ,
801
+ ActiveTransparency = Iris ._config .ResizeGripActiveTransparency ,
802
+ })
803
+
804
+ widgets .applyInteractionHighlights (" Image" , BottomResizeBorder , BottomResizeBorder , {
805
+ Color = Iris ._config .ResizeGripColor ,
806
+ Transparency = 1 ,
807
+ HoveredColor = Iris ._config .ResizeGripHoveredColor ,
808
+ HoveredTransparency = Iris ._config .ResizeGripHoveredTransparency ,
809
+ ActiveColor = Iris ._config .ResizeGripActiveColor ,
810
+ ActiveTransparency = Iris ._config .ResizeGripActiveTransparency ,
811
+ })
812
+
669
813
local ResizeBorder : Frame = Instance .new (" Frame" )
670
814
ResizeBorder .Name = " ResizeBorder"
671
815
ResizeBorder .Size = UDim2 .new (1 , Iris ._config .WindowResizePadding .X * 2 , 1 , Iris ._config .WindowResizePadding .Y * 2 )
@@ -687,6 +831,14 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
687
831
isInsideResize = false
688
832
end
689
833
end )
834
+ widgets .applyInputBegan (ResizeBorder , function (input : InputObject )
835
+ if input .UserInputType == Enum .UserInputType .MouseMovement or input .UserInputType == Enum .UserInputType .Keyboard then
836
+ return
837
+ end
838
+ if thisWidget .state .isUncollapsed .value then
839
+ Iris .SetFocusedWindow (thisWidget )
840
+ end
841
+ end )
690
842
691
843
widgets .applyMouseEnter (WindowButton , function ()
692
844
if focusedWindow == thisWidget then
@@ -710,12 +862,27 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
710
862
local TitleBar = Content .TitleBar :: Frame
711
863
local Title : TextLabel = TitleBar .Title
712
864
local MenuBar : Frame ? = Content :FindFirstChild (" MenuBar" )
713
- local ResizeGrip : TextButton = WindowButton .ResizeGrip
865
+ local LeftResizeGrip : TextButton = WindowButton .LeftResizeGrip
866
+ local RightResizeGrip : TextButton = WindowButton .RightResizeGrip
867
+ local LeftResizeBorder : Frame = WindowButton .LeftResizeBorder
868
+ local RightResizeBorder : Frame = WindowButton .RightResizeBorder
869
+ local TopResizeBorder : Frame = WindowButton .TopResizeBorder
870
+ local BottomResizeBorder : Frame = WindowButton .BottomResizeBorder
714
871
715
872
if thisWidget .arguments .NoResize ~= true then
716
- ResizeGrip .Visible = true
873
+ LeftResizeGrip .Visible = true
874
+ RightResizeGrip .Visible = true
875
+ LeftResizeBorder .Visible = true
876
+ RightResizeBorder .Visible = true
877
+ TopResizeBorder .Visible = true
878
+ BottomResizeBorder .Visible = true
717
879
else
718
- ResizeGrip .Visible = false
880
+ LeftResizeGrip .Visible = false
881
+ RightResizeGrip .Visible = false
882
+ LeftResizeBorder .Visible = false
883
+ RightResizeBorder .Visible = false
884
+ TopResizeBorder .Visible = false
885
+ BottomResizeBorder .Visible = false
719
886
end
720
887
if thisWidget .arguments .NoScrollbar then
721
888
ChildContainer .ScrollBarThickness = 0
@@ -796,7 +963,12 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
796
963
local Content = WindowButton .Content :: Frame
797
964
local TitleBar = Content .TitleBar :: Frame
798
965
local MenuBar : Frame ? = Content :FindFirstChild (" MenuBar" )
799
- local ResizeGrip : TextButton = WindowButton .ResizeGrip
966
+ local LeftResizeGrip : TextButton = WindowButton .LeftResizeGrip
967
+ local RightResizeGrip : TextButton = WindowButton .RightResizeGrip
968
+ local LeftResizeBorder : Frame = WindowButton .LeftResizeBorder
969
+ local RightResizeBorder : Frame = WindowButton .RightResizeBorder
970
+ local TopResizeBorder : Frame = WindowButton .TopResizeBorder
971
+ local BottomResizeBorder : Frame = WindowButton .BottomResizeBorder
800
972
801
973
WindowButton .Size = UDim2 .fromOffset (stateSize .X , stateSize .Y )
802
974
WindowButton .Position = UDim2 .fromOffset (statePosition .X , statePosition .Y )
@@ -828,7 +1000,12 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
828
1000
end
829
1001
ChildContainer .Visible = true
830
1002
if thisWidget .arguments .NoResize ~= true then
831
- ResizeGrip .Visible = true
1003
+ LeftResizeGrip .Visible = true
1004
+ RightResizeGrip .Visible = true
1005
+ LeftResizeBorder .Visible = true
1006
+ RightResizeBorder .Visible = true
1007
+ TopResizeBorder .Visible = true
1008
+ BottomResizeBorder .Visible = true
832
1009
end
833
1010
WindowButton .AutomaticSize = Enum .AutomaticSize .None
834
1011
thisWidget .lastUncollapsedTick = Iris ._cycleTick + 1
@@ -840,7 +1017,12 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
840
1017
MenuBar .Visible = false
841
1018
end
842
1019
ChildContainer .Visible = false
843
- ResizeGrip .Visible = false
1020
+ LeftResizeGrip .Visible = false
1021
+ RightResizeGrip .Visible = false
1022
+ LeftResizeBorder .Visible = false
1023
+ RightResizeBorder .Visible = false
1024
+ TopResizeBorder .Visible = false
1025
+ BottomResizeBorder .Visible = false
844
1026
WindowButton .Size = UDim2 .fromOffset (stateSize .X , collapsedHeight )
845
1027
thisWidget .lastCollapsedTick = Iris ._cycleTick + 1
846
1028
end
0 commit comments