-
Notifications
You must be signed in to change notification settings - Fork 149
Fix issue #2706: Add proper constraints for macOS dev loading view #2707
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
base: main
Are you sure you want to change the base?
Fix issue #2706: Add proper constraints for macOS dev loading view #2707
Conversation
…g view - Add contentView initialization and container constraints for macOS - Fix layout issues with the dev loading view on macOS platform - Ensure proper positioning and sizing of the loading message window Fixes microsoft#2706
@microsoft-github-policy-service agree [company="{didi}"] |
@microsoft-github-policy-service agree company="Microsoft" |
@microsoft-github-policy-service agree |
self->_window.contentView = [[NSView alloc] init]; | ||
[self->_window.contentView addSubview:self->_container]; |
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.
Doesn't this invalidate line 152? Should we doing it there instead?
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.
I have completed the modifications according to your suggestions.
[NSLayoutConstraint activateConstraints:@[ | ||
[self->_container.topAnchor constraintEqualToAnchor:self->_window.contentView.topAnchor], | ||
[self->_container.leadingAnchor constraintEqualToAnchor:self->_window.contentView.leadingAnchor], | ||
[self->_container.trailingAnchor constraintEqualToAnchor:self->_window.contentView.trailingAnchor], | ||
[self->_container.bottomAnchor constraintEqualToAnchor:self->_window.contentView.bottomAnchor], | ||
|
||
// Label constraints | ||
[self->_label.centerXAnchor constraintEqualToAnchor:self->_container.centerXAnchor], | ||
[self->_label.centerYAnchor constraintEqualToAnchor:self->_container.centerYAnchor], | ||
[self->_label.leadingAnchor constraintGreaterThanOrEqualToAnchor:self->_container.leadingAnchor constant:10], | ||
[self->_label.trailingAnchor constraintLessThanOrEqualToAnchor:self->_container.trailingAnchor constant:-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.
Any chance we can share a bunch of these constraints with the iOS block?
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.
I have completed the modifications according to your suggestions.
- Replace contentViewController.view with contentView for proper view hierarchy - Unify constraint logic across iOS and macOS platforms - Use shared constraint array for better code organization - Fix container constraints to properly fill parent view on macOS - Maintain platform-specific label positioning (bottom on iOS, center on macOS) Fixes issue microsoft#2706
Fixes #2706
Summary:
Test Plan: