Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve notification layout #997

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions plugin/src/App/Notifications.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,9 @@ function Notification:render()
end

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 textBounds = Vector2.new(
textXSpace,
getTextBoundsAsync(self.props.text, theme.Font.Main, theme.TextSize.Body, textXSpace).Y
)
local textBounds = getTextBoundsAsync(self.props.text, theme.Font.Main, theme.TextSize.Body, textXSpace)
local contentX = math.max(textBounds.X, buttonsX)

local size = self.binding:map(function(value)
Expand Down Expand Up @@ -162,10 +159,10 @@ function Notification:render()
TextColor3 = theme.Notification.InfoColor,
TextTransparency = transparency,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top,
TextYAlignment = Enum.TextYAlignment.Center,
TextWrapped = true,

Size = UDim2.new(1, -35, 1, -actionsY),
Size = UDim2.new(0, textBounds.X, 1, -actionsY),
Position = UDim2.fromOffset(35, 0),

LayoutOrder = 1,
Expand Down
Loading