mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 07:06:12 +00:00
Improve notification layout (#997)
This commit is contained in:
@@ -113,12 +113,9 @@ function Notification:render()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local paddingY, logoSize = 20, 32
|
local paddingY, logoSize = 20, 32
|
||||||
local actionsY = if self.props.actions then 35 else 0
|
local actionsY = if self.props.actions then 37 else 0
|
||||||
local textXSpace = math.max(250, buttonsX) + 35
|
local textXSpace = math.max(250, buttonsX) + 35
|
||||||
local textBounds = Vector2.new(
|
local textBounds = getTextBoundsAsync(self.props.text, theme.Font.Main, theme.TextSize.Body, textXSpace)
|
||||||
textXSpace,
|
|
||||||
getTextBoundsAsync(self.props.text, theme.Font.Main, theme.TextSize.Body, textXSpace).Y
|
|
||||||
)
|
|
||||||
local contentX = math.max(textBounds.X, buttonsX)
|
local contentX = math.max(textBounds.X, buttonsX)
|
||||||
|
|
||||||
local size = self.binding:map(function(value)
|
local size = self.binding:map(function(value)
|
||||||
@@ -162,10 +159,10 @@ function Notification:render()
|
|||||||
TextColor3 = theme.Notification.InfoColor,
|
TextColor3 = theme.Notification.InfoColor,
|
||||||
TextTransparency = transparency,
|
TextTransparency = transparency,
|
||||||
TextXAlignment = Enum.TextXAlignment.Left,
|
TextXAlignment = Enum.TextXAlignment.Left,
|
||||||
TextYAlignment = Enum.TextYAlignment.Top,
|
TextYAlignment = Enum.TextYAlignment.Center,
|
||||||
TextWrapped = true,
|
TextWrapped = true,
|
||||||
|
|
||||||
Size = UDim2.new(1, -35, 1, -actionsY),
|
Size = UDim2.new(0, textBounds.X, 1, -actionsY),
|
||||||
Position = UDim2.fromOffset(35, 0),
|
Position = UDim2.fromOffset(35, 0),
|
||||||
|
|
||||||
LayoutOrder = 1,
|
LayoutOrder = 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user