Skip to content

Commit

Permalink
Make widgets more compact (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackTabsCode authored Jan 31, 2024
1 parent 9d438f6 commit b335c4c
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/creating-widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return Plasma.widget(function(text, color)
Font = Enum.Font.GothamBold,
TextColor3 = Color3.fromRGB(147, 147, 147),
BackgroundColor3 = Color3.fromRGB(54, 54, 54),
TextSize = 20,
TextSize = 16,
Size = UDim2.new(0, 0, 0, 30),
AutomaticSize = Enum.AutomaticSize.XY,

Expand Down
13 changes: 7 additions & 6 deletions src/widgets/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ return Runtime.widget(function(text)
[ref] = "button",
BackgroundColor3 = style.bg3,
BorderSizePixel = 0,
Font = Enum.Font.SourceSans,
Size = UDim2.new(0, 100, 0, 40),
Font = Enum.Font.Gotham,
TextColor3 = style.textColor,
AutomaticSize = Enum.AutomaticSize.X,
TextSize = 21,
AutomaticSize = Enum.AutomaticSize.XY,
TextSize = 14,

create("UIPadding", {
PaddingLeft = UDim.new(0, 10),
PaddingRight = UDim.new(0, 10),
PaddingLeft = UDim.new(0, 5),
PaddingRight = UDim.new(0, 5),
PaddingTop = UDim.new(0, 5),
PaddingBottom = UDim.new(0, 5),
}),

create("UICorner"),
Expand Down
10 changes: 5 additions & 5 deletions src/widgets/checkbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ return Runtime.widget(function(text, options)
[ref] = "checkbox",
BackgroundTransparency = 1,
Name = "Checkbox",
Size = UDim2.new(0, 30, 0, 30),
Size = UDim2.new(0, 20, 0, 20),
AutomaticSize = Enum.AutomaticSize.X,

create("TextButton", {
BackgroundColor3 = Color3.fromRGB(54, 54, 54),
BorderSizePixel = 0,
Font = Enum.Font.SourceSansBold,
Size = UDim2.new(0, 30, 0, 30),
Font = Enum.Font.GothamBold,
Size = UDim2.new(0, 20, 0, 20),
TextColor3 = Color3.fromRGB(153, 153, 153),
TextSize = 24,
TextSize = 16,

create("UICorner", {
CornerRadius = UDim.new(0, 8),
Expand All @@ -77,7 +77,7 @@ return Runtime.widget(function(text, options)
BackgroundColor3 = Color3.fromRGB(255, 255, 255),
Font = Enum.Font.GothamMedium,
TextColor3 = Color3.fromRGB(203, 203, 203),
TextSize = 18,
TextSize = 14,
AutomaticSize = Enum.AutomaticSize.X,
RichText = true,
}),
Expand Down
22 changes: 11 additions & 11 deletions src/widgets/error.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@ return Runtime.widget(function(text)
BackgroundTransparency = 0,
BackgroundColor3 = Color3.fromRGB(231, 76, 60),
Name = "Error",
Size = UDim2.new(0, 100, 0, 75),
AutomaticSize = Enum.AutomaticSize.XY,

create("UICorner"),

create("UIPadding", {
PaddingBottom = UDim.new(0, 20),
PaddingLeft = UDim.new(0, 20),
PaddingRight = UDim.new(0, 20),
PaddingTop = UDim.new(0, 20),
PaddingLeft = UDim.new(0, 10),
PaddingRight = UDim.new(0, 10),
PaddingTop = UDim.new(0, 10),
}),

create("UIListLayout", {}),
create("UIListLayout", {
Padding = UDim.new(0, 10),
}),

create("TextLabel", {
Font = Enum.Font.GothamBold,
BackgroundTransparency = 1,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextSize = 25,
AutomaticSize = Enum.AutomaticSize.X,
TextSize = 20,
AutomaticSize = Enum.AutomaticSize.XY,
Text = "⚠️ An Error Occurred",
Size = UDim2.fromOffset(0, 75),
}),

create("TextLabel", {
Name = "error",
Font = Enum.Font.GothamMedium,
BackgroundTransparency = 1,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextSize = 20,
TextSize = 16,
LineHeight = 1.2,
AutomaticSize = Enum.AutomaticSize.XY,
Size = UDim2.fromOffset(100, 75),
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/heading.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ return Runtime.widget(function(text, options)
Font = Enum.Font.GothamBold,
AutomaticSize = Enum.AutomaticSize.XY,
TextColor3 = style.mutedTextColor,
TextSize = 20,
TextSize = 14,
RichText = true,
})
end)
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/label.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ return Runtime.widget(function(text)
create("TextLabel", {
[ref] = "label",
BackgroundTransparency = 1,
Font = Enum.Font.SourceSans,
Font = Enum.Font.Gotham,
TextColor3 = style.textColor,
TextSize = 20,
TextSize = 16,
RichText = true,
})

Expand Down
1 change: 1 addition & 0 deletions src/widgets/row.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ return Runtime.widget(function(options, fn)
local frame = refs.frame

frame.UIListLayout.HorizontalAlignment = options.alignment or Enum.HorizontalAlignment.Left
frame.UIListLayout.VerticalAlignment = options.verticalAlignment or Enum.VerticalAlignment.Top

Runtime.scope(fn)
end)
14 changes: 7 additions & 7 deletions src/widgets/table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ local cell = Runtime.widget(function(text, font)
return create("TextLabel", {
[ref] = "label",
BackgroundTransparency = 1,
Font = Enum.Font.SourceSans,
Font = Enum.Font.Gotham,
AutomaticSize = Enum.AutomaticSize.XY,
TextColor3 = style.textColor,
TextSize = 20,
TextSize = 16,
TextXAlignment = Enum.TextXAlignment.Left,
RichText = true,

create("UIPadding", {
PaddingBottom = UDim.new(0, 8),
PaddingLeft = UDim.new(0, 8),
PaddingRight = UDim.new(0, 8),
PaddingTop = UDim.new(0, 8),
PaddingBottom = UDim.new(0, 6),
PaddingLeft = UDim.new(0, 6),
PaddingRight = UDim.new(0, 6),
PaddingTop = UDim.new(0, 6),
}),
})
end)

refs.label.Font = font or Enum.Font.SourceSans
refs.label.Font = font or Enum.Font.Gotham
refs.label.Text = text
end)

Expand Down
21 changes: 11 additions & 10 deletions src/widgets/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ return Runtime.widget(function(options, fn)

c("TextButton", {
[ref] = "titleBar",
Size = UDim2.new(1, 0, 0, 40),
Size = UDim2.new(1, 0, 0, 0),
AutomaticSize = Enum.AutomaticSize.Y,
BackgroundTransparency = 1,
Text = "",

Expand Down Expand Up @@ -128,23 +129,23 @@ return Runtime.widget(function(options, fn)
Text = "..",
Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1,
TextSize = 20,
TextSize = 16,
TextColor3 = style.mutedTextColor,
}),

c("TextLabel", {
Text = "..",
Position = UDim2.new(0, 0, 0, 7),
BackgroundTransparency = 1,
TextSize = 20,
TextSize = 16,
TextColor3 = style.mutedTextColor,
}),

c("TextLabel", {
Text = "..",
Position = UDim2.new(0, 0, 0, -7),
BackgroundTransparency = 1,
TextSize = 20,
TextSize = 16,
TextColor3 = style.mutedTextColor,
}),
}),
Expand All @@ -155,7 +156,7 @@ return Runtime.widget(function(options, fn)
Font = Enum.Font.GothamBold,
Size = UDim2.new(1, 0, 1, 0),
TextColor3 = style.mutedTextColor,
TextSize = 20,
TextSize = 14,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top,
TextTruncate = Enum.TextTruncate.AtEnd,
Expand All @@ -164,12 +165,12 @@ return Runtime.widget(function(options, fn)
c("TextButton", {
[ref] = "close",
BackgroundColor3 = Color3.fromHex("e74c3c"),
Size = UDim2.new(0, 20, 0, 20),
Size = UDim2.new(0, 14, 0, 14),
Text = "",
AnchorPoint = Vector2.new(0.5, 0),
Position = UDim2.new(1, -10, 0, 0),
TextColor3 = Color3.fromHex("#71190f"),
TextSize = 20,
TextSize = 16,
Font = Enum.Font.Gotham,

MouseEnter = function()
Expand Down Expand Up @@ -197,7 +198,7 @@ return Runtime.widget(function(options, fn)
HorizontalScrollBarInset = Enum.ScrollBarInset.ScrollBar,
BorderSizePixel = 0,
ScrollBarThickness = 6,
Position = UDim2.new(0, 0, 0, 40),
Position = UDim2.new(0, 0, 0, 25),

c("UIListLayout", {
SortOrder = Enum.SortOrder.LayoutOrder,
Expand All @@ -209,8 +210,8 @@ return Runtime.widget(function(options, fn)
[ref] = "resizeHandle",
Size = UDim2.new(0, 20, 0, 20),
Text = "",
Font = Enum.Font.SourceSans,
TextSize = 20,
Font = Enum.Font.Gotham,
TextSize = 16,
Rotation = -45,
BackgroundTransparency = 1,
TextColor3 = style.mutedTextColor,
Expand Down

0 comments on commit b335c4c

Please sign in to comment.