-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fixes the multiline text heights #1427
Conversation
@@ -67,14 +67,11 @@ public final class NetworkProtectionPopover: NSPopover { | |||
statusReporter: statusReporter, | |||
menuItems: menuItems) | |||
|
|||
let controller: NSViewController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no need to separate the declaration of controller
in this line and then assign it in line 76, so I unified both.
let view = NetworkProtectionStatusView(model: model).environment(\.dismiss, { [weak self] in | ||
self?.close() | ||
}).fixedSize() | ||
.padding(.vertical, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was removed thanks to the multiline-text height fixes, which were causing the popover height to be off.
.multilineTextAlignment(.center) | ||
.applyDescriptionAttributes(colorScheme: colorScheme) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it was necessary to move this below, but I wanted the first thing to happen to be the fixing of the height.
/// Fixes the height for multiline text fields, which seem to suffer from a layout issue where | ||
/// their height isn't properly honored. | ||
/// | ||
private struct MultilineTextHeightFixer: ViewModifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We implemented this with @brindy 's help. We discussed it's probably reusable but that it may be best to leave it here for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use AppKit? 😉 |
Heh, if only that was a quick solution I would... want to see first if I can resolve this with something immediate - I believe I know what the issue is. |
I wasn't able to reproduce the issue you're seeing, but I'm sure it's because Would you give this another go with my latest changes? |
@mallexxx - Just pushed the changes you suggested and they work fine for me too. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Task/Issue URL: https://app.asana.com/0/1203137811378537/1205203672933054/f
Description:
Fixes the dynamic height calculation for multiline textfields in the Network Protection popover.
Steps to test this PR:
Test 1: Test the yellow alert box
macos-browser/LocalPackages/NetworkProtectionUI/Sources/NetworkProtectionUI/NetworkProtectionStatusView.swift
Line 194 in 7a14c10
message
with a really long text (to force it to be multiline).Test 2: Test the feature status description
macos-browser/LocalPackages/NetworkProtectionUI/Sources/NetworkProtectionUI/NetworkProtectionStatusView.swift
Line 223 in 7a14c10
model.featureStatusDescription
with long textInternal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation