Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 5cfb776

Browse files
committed
Added alignment support.
1 parent 5bcbc90 commit 5cfb776

File tree

3 files changed

+58
-20
lines changed

3 files changed

+58
-20
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
local choices = {
2+
3+
{Id = "1",
4+
Mode = Enum.VerticalAlignment.Top,
5+
Text = "Top",
6+
},
7+
{Id = "2",
8+
Mode = Enum.VerticalAlignment.Center,
9+
Text = "Center",
10+
},
11+
{Id = "3",
12+
Mode = Enum.VerticalAlignment.Bottom,
13+
Text = "Bottom",
14+
},
15+
16+
}
17+
18+
return choices

src/Workspace/SignsInternal/PluginGui/init.lua

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ local Color = require(script.Color)
1919
local FontFace = require(script.FontFace)
2020
local GuiObjectPart = require(script.GuiObjectPart)
2121
local LineJoinMode = require(script.LineJoinMode)
22+
local HorizontalAlignment = require(script.HorizontalAlignment)
23+
local VerticalAlignment = require(script.VerticalAlignment)
2224

2325
local PluginGui = {}
2426

@@ -146,6 +148,15 @@ function PluginGui:newPluginGui(widgetGui)
146148
)
147149
fontTextChoice:GetFrame().Parent = textCollapse:GetContentsFrame()
148150

151+
local alignmentCollapse = CollapsibleTitledSection.new( -- Fonts collapse
152+
"alignmentCollapse", -- name suffix of the gui object
153+
"Alignment", -- the text displayed beside the collapsible arrow
154+
true, -- have the content frame auto-update its size?
155+
true, -- minimizable?
156+
true -- minimized by default?
157+
)
158+
listFrame:AddChild(alignmentCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
159+
149160
local strokeCollapse = CollapsibleTitledSection.new( -- Fonts collapse
150161
"strokeCollapse", -- name suffix of the gui object
151162
"Stroke", -- the text displayed beside the collapsible arrow
@@ -163,25 +174,6 @@ function PluginGui:newPluginGui(widgetGui)
163174
)
164175
strokeCheckbox:GetFrame().Parent = strokeCollapse:GetContentsFrame()
165176

166-
local colorStrokeChoice = LabeledMultiChoice.new(
167-
"colorStrokeChoice", -- name suffix of gui object
168-
"Color", -- title text of the multi choice
169-
Color, -- choices array
170-
11 -- the starting index of the selection
171-
)
172-
if GuiUtilities:ShouldUseIconsForDarkerBackgrounds() == true then
173-
colorStrokeChoice:SetSelectedIndex(11)
174-
end
175-
colorStrokeChoice:GetFrame().Parent = strokeCollapse:GetContentsFrame()
176-
177-
local joinStrokeChoice = LabeledMultiChoice.new(
178-
"joinStrokeChoice", -- name suffix of gui object
179-
"Line Join Mode", -- title text of the multi choice
180-
LineJoinMode, -- choices array
181-
1 -- the starting index of the selection
182-
)
183-
joinStrokeChoice:GetFrame().Parent = strokeCollapse:GetContentsFrame()
184-
185177
local thicknessStrokeSlider = LabeledSlider.new( -- Size Slider
186178
"thicknessStrokeSlider", -- name suffix of gui object
187179
"Thickness", -- title text of the multi choice
@@ -198,6 +190,26 @@ function PluginGui:newPluginGui(widgetGui)
198190
)
199191
transparencyStrokeSlider:GetFrame().Parent = strokeCollapse:GetContentsFrame()
200192

193+
local joinStrokeChoice = LabeledMultiChoice.new(
194+
"joinStrokeChoice", -- name suffix of gui object
195+
"Line Join Mode", -- title text of the multi choice
196+
LineJoinMode, -- choices array
197+
1 -- the starting index of the selection
198+
)
199+
joinStrokeChoice:GetFrame().Parent = strokeCollapse:GetContentsFrame()
200+
201+
local colorStrokeChoice = LabeledMultiChoice.new(
202+
"colorStrokeChoice", -- name suffix of gui object
203+
"Color", -- title text of the multi choice
204+
Color, -- choices array
205+
11 -- the starting index of the selection
206+
)
207+
if GuiUtilities:ShouldUseIconsForDarkerBackgrounds() == true then
208+
colorStrokeChoice:SetSelectedIndex(11)
209+
end
210+
colorStrokeChoice:GetFrame().Parent = strokeCollapse:GetContentsFrame()
211+
212+
201213
local backgroundCollapse = CollapsibleTitledSection.new( -- Fonts collapse
202214
"backgroundCollapse", -- name suffix of the gui object
203215
"Background", -- the text displayed beside the collapsible arrow

src/Workspace/SignsInternal/StudioWidgets/GuiUtilities.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ end
6464

6565
function module.syncGuiElementTitleColor(guiElement)
6666
local function setColors()
67-
guiElement.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Titlebar)
67+
guiElement.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.CategoryItem)
6868
end
6969
settings().Studio.ThemeChanged:Connect(setColors)
7070
setColors()
@@ -115,6 +115,14 @@ function module.syncGuiElementBorderColor(guiElement)
115115
setColors()
116116
end
117117

118+
function module.syncGuiElementShadowColor(guiElement)
119+
local function setColors()
120+
guiElement.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Mid)
121+
end
122+
settings().Studio.ThemeChanged:Connect(setColors)
123+
setColors()
124+
end
125+
118126
function module.syncGuiElementFontColor(guiElement)
119127
local function setColors()
120128
guiElement.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText)

0 commit comments

Comments
 (0)