Skip to content

Commit 0d6ff8e

Browse files
authored
Improve notification layout (#997)
1 parent 55a207a commit 0d6ff8e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

plugin/src/App/Notifications.lua

+4-7
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,9 @@ function Notification:render()
113113
end
114114

115115
local paddingY, logoSize = 20, 32
116-
local actionsY = if self.props.actions then 35 else 0
116+
local actionsY = if self.props.actions then 37 else 0
117117
local textXSpace = math.max(250, buttonsX) + 35
118-
local textBounds = Vector2.new(
119-
textXSpace,
120-
getTextBoundsAsync(self.props.text, theme.Font.Main, theme.TextSize.Body, textXSpace).Y
121-
)
118+
local textBounds = getTextBoundsAsync(self.props.text, theme.Font.Main, theme.TextSize.Body, textXSpace)
122119
local contentX = math.max(textBounds.X, buttonsX)
123120

124121
local size = self.binding:map(function(value)
@@ -162,10 +159,10 @@ function Notification:render()
162159
TextColor3 = theme.Notification.InfoColor,
163160
TextTransparency = transparency,
164161
TextXAlignment = Enum.TextXAlignment.Left,
165-
TextYAlignment = Enum.TextYAlignment.Top,
162+
TextYAlignment = Enum.TextYAlignment.Center,
166163
TextWrapped = true,
167164

168-
Size = UDim2.new(1, -35, 1, -actionsY),
165+
Size = UDim2.new(0, textBounds.X, 1, -actionsY),
169166
Position = UDim2.fromOffset(35, 0),
170167

171168
LayoutOrder = 1,

0 commit comments

Comments
 (0)