5858
5959function HorizontalTabClass :_SetupTabHandling (self )
6060 print (self ._titlebar .Name )
61- -- self._titlebar.ChildAdded:Connect(function()
62- -- local tabButtonWidth = 1 / (#self._titlebar:GetChildren() - 1)
63- -- for _, child in pairs(self._titlebar:GetChildren()) do
64- -- if child:IsA("TextButton") then
65- -- child.Size = UDim2.new(tabButtonWidth, 0, 0, 27)
66- -- end
67- -- end
68- -- end)
69- -- self._titlebar.ChildRemoved:Connect(function()
70- -- local tabButtonWidth = 1 / (#self._titlebar:GetChildren() - 1)
71- -- for _, child in pairs(self._titlebar:GetChildren()) do
72- -- if child:IsA("TextButton") then
73- -- child.Size = UDim2.new(tabButtonWidth, 0, 0, 27)
74- -- end
75- -- end
76- -- end)
61+ self ._titlebar .ChildAdded :Connect (function ()
62+ local tabButtonWidth = 1 / (# self ._titlebar :GetChildren () - 1 )
63+ for _ , child in pairs (self ._titlebar :GetChildren ()) do
64+ if child :IsA (" TextButton" ) then
65+ child .Size = UDim2 .new (tabButtonWidth , 0 , 0 , 27 )
66+ end
67+ end
68+ end )
69+ self ._titlebar .ChildRemoved :Connect (function ()
70+ local tabButtonWidth = 1 / (# self ._titlebar :GetChildren () - 1 )
71+ for _ , child in pairs (self ._titlebar :GetChildren ()) do
72+ if child :IsA (" TextButton" ) then
73+ child .Size = UDim2 .new (tabButtonWidth , 0 , 0 , 27 )
74+ end
75+ end
76+ end )
7777end
7878
7979function HorizontalTabClass :_SetupMouseClickHandling ()
@@ -121,12 +121,12 @@ function HorizontalTabClass:AddTab(suffix: string, name: string)
121121 tabButton .TextSize = GuiUtilities .kDefaultFontSize
122122 tabButton .Text = name
123123 tabButton .Parent = self ._titlebar
124- -- GuiUtilities.syncGuiElementFontColor(tabButton)
125- -- GuiUtilities.syncGuiElementTitlebarColor(tabButton)
126- -- GuiUtilities.syncGuiElementBorderColor(tabButton)
124+ GuiUtilities .syncGuiElementFontColor (tabButton )
125+ GuiUtilities .syncGuiElementTitlebarColor (tabButton )
126+ GuiUtilities .syncGuiElementBorderColor (tabButton )
127127
128128 tabButton .MouseButton1Down :Connect (function ()
129- -- self._uiPageLayout:JumpTo(self:GetContentsFrame(suffix))
129+ self ._uiPageLayout :JumpTo (self :GetContentsFrame (suffix ))
130130 end )
131131end
132132
@@ -135,7 +135,11 @@ function HorizontalTabClass:GetTitlebar(): Frame
135135end
136136
137137function HorizontalTabClass :GetContentsFrame (suffix : string ): Frame
138- return self ._frame :FindFirstChild (" VerticalScrollFrame" .. suffix )
138+ for _ , child in pairs (self ._frame :GetChildren ()) do
139+ if child .Name == " VFrame" .. suffix then
140+ return child
141+ end
142+ end
139143end
140144
141145function HorizontalTabClass :GetFrame (): Frame
0 commit comments