Skip to content

Commit

Permalink
HorizontalAlignment for SameLine.
Browse files Browse the repository at this point in the history
Added HorizontalAlignment argument for SameLine widget which will horizontally align any children.
  • Loading branch information
SirMallard committed Sep 4, 2024
1 parent a09fd07 commit fd0473b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export type Arguments = {

Width: number,
VerticalAlignment: Enum.VerticalAlignment,
HorizontalAlignment: Enum.HorizontalAlignment,
Index: any,
Image: string,
Size: UDim2,
Expand Down
1 change: 1 addition & 0 deletions lib/WidgetTypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export type SameLine = ParentWidget & {
arguments: {
Width: number?,
VerticalAlignment: Enum.VerticalAlignment?,
HorizontalAlignment: Enum.HorizontalAlignment?,
},
}

Expand Down
8 changes: 7 additions & 1 deletion lib/widgets/Format.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
Args = {
["Width"] = 1,
["VerticalAlignment"] = 2,
["HorizontalAlignment"] = 3,
},
Events = {},
Generate = function(thisWidget: Types.SameLine)
Expand Down Expand Up @@ -107,7 +108,12 @@ return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
if thisWidget.arguments.VerticalAlignment then
uiListLayout.VerticalAlignment = thisWidget.arguments.VerticalAlignment
else
uiListLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiListLayout.VerticalAlignment = Enum.VerticalAlignment.Top
end
if thisWidget.arguments.HorizontalAlignment then
uiListLayout.HorizontalAlignment = thisWidget.arguments.HorizontalAlignment
else
uiListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Left
end
end,
Discard = function(thisWidget: Types.SameLine)
Expand Down

0 comments on commit fd0473b

Please sign in to comment.