Skip to content

Commit

Permalink
Fewer hardcoded sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
boatbomber committed Nov 6, 2024
1 parent 61bc278 commit 880f20f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plugin/src/App/Components/Header.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local function Header(props)
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = props.transparency,

Size = UDim2.new(1, 0, 0, 14),
Size = UDim2.new(1, 0, 0, theme.TextSize.Body),

LayoutOrder = 2,
BackgroundTransparency = 1,
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/App/Components/PatchVisualizer/DomLabel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function DomLabel:render()
TextSize = theme.TextSize.Body,
TextColor3 = theme.SubTextColor,
TextTransparency = props.transparency,
Size = UDim2.new(0, 0, 0, 16),
Size = UDim2.new(0, 0, 0, theme.TextSize.Body),
AutomaticSize = Enum.AutomaticSize.X,
LayoutOrder = 2,
})
Expand All @@ -268,7 +268,7 @@ function DomLabel:render()
TextSize = theme.TextSize.Body,
TextColor3 = theme.Diff.Warning,
TextTransparency = props.transparency,
Size = UDim2.new(0, 0, 0, 16),
Size = UDim2.new(0, 0, 0, theme.TextSize.Body),
AutomaticSize = Enum.AutomaticSize.X,
LayoutOrder = 6,
})
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/App/Components/Tag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ return function(props)
layoutOrder = props.layoutOrder,
position = props.position,
anchorPoint = props.anchorPoint,
size = UDim2.new(0, 0, 0, 16),
size = UDim2.new(0, 0, 0, theme.TextSize.Medium),
automaticSize = Enum.AutomaticSize.X,
}, {
Padding = e("UIPadding", {
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/App/Components/TextButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function TextButton:render()
local bindingEnabled = bindingUtil.deriveProperty(self.binding, "enabled")

return e("ImageButton", {
Size = UDim2.new(0, 15 + textBounds.X + 15, 0, 34),
Size = UDim2.new(0, (theme.TextSize.Body * 2) + textBounds.X, 0, 34),
Position = self.props.position,
AnchorPoint = self.props.anchorPoint,

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/App/Notifications.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function Notification:render()
transparency = transparency,
})

buttonsX += getTextBounds(action.text, theme.Font.Main, theme.TextSize.Large, math.huge).X + 30
buttonsX += getTextBounds(action.text, theme.Font.Main, theme.TextSize.Large, math.huge).X + (theme.TextSize.Body * 2)

count += 1
end
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/App/StatusPages/Confirming.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function ConfirmingPage:render()
TextColor3 = theme.TextColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = self.props.transparency,
Size = UDim2.new(1, 0, 0, 20),
Size = UDim2.new(1, 0, 0, theme.TextSize.Large + 2),
BackgroundTransparency = 1,
}),

Expand Down
10 changes: 5 additions & 5 deletions plugin/src/App/StatusPages/Connected.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ChangesViewer:render()
TextXAlignment = Enum.TextXAlignment.Left,
TextColor3 = theme.TextColor,
TextTransparency = self.props.transparency,
Size = UDim2.new(1, -40, 0, 20),
Size = UDim2.new(1, -40, 0, theme.TextSize.Large + 2),
Position = UDim2.new(0, 40, 0, 0),
BackgroundTransparency = 1,
}),
Expand All @@ -79,8 +79,8 @@ function ChangesViewer:render()
TextColor3 = theme.SubTextColor,
TextTruncate = Enum.TextTruncate.AtEnd,
TextTransparency = self.props.transparency,
Size = UDim2.new(1, -40, 0, 16),
Position = UDim2.new(0, 40, 0, 20),
Size = UDim2.new(1, -40, 0, theme.TextSize.Medium),
Position = UDim2.new(0, 40, 0, theme.TextSize.Large + 2),
BackgroundTransparency = 1,
}),

Expand Down Expand Up @@ -223,7 +223,7 @@ local function ConnectionDetails(props)
TextTransparency = props.transparency,
TextXAlignment = Enum.TextXAlignment.Left,

Size = UDim2.new(1, 0, 0, 20),
Size = UDim2.new(1, 0, 0, theme.TextSize.Large),

LayoutOrder = 1,
BackgroundTransparency = 1,
Expand All @@ -237,7 +237,7 @@ local function ConnectionDetails(props)
TextTransparency = props.transparency,
TextXAlignment = Enum.TextXAlignment.Left,

Size = UDim2.new(1, 0, 0, 15),
Size = UDim2.new(1, 0, 0, theme.TextSize.Medium),

LayoutOrder = 2,
BackgroundTransparency = 1,
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/App/StatusPages/Settings/Setting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function Setting:render()
BackgroundTransparency = 1,
}, {
Heading = e("Frame", {
Size = UDim2.new(1, 0, 0, 16),
Size = UDim2.new(1, 0, 0, theme.TextSize.Medium),
BackgroundTransparency = 1,
}, {
Layout = e("UIListLayout", {
Expand Down Expand Up @@ -179,7 +179,7 @@ function Setting:render()
TextTransparency = self.props.transparency,
RichText = true,

Size = UDim2.new(1, 0, 0, 16),
Size = UDim2.new(1, 0, 0, theme.TextSize.Medium),

LayoutOrder = 2,
BackgroundTransparency = 1,
Expand Down

0 comments on commit 880f20f

Please sign in to comment.