Skip to content

Fix inconsistent vertical offset in Prefs Window panels: remove unnec… #3731

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

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

svobs
Copy link
Contributor

@svobs svobs commented May 9, 2022


Description:
Fix inconsistent vertical offset in Prefs Window panels: removed an unnecessary and unreliable scroll(.zero) request. This resulted in a consistent vertical offset which was too large and easily reduced. The pref panes should always be fixed size and not scrollable, because their superview is an NSScrollView which will provide the scroll. Also, they do not need an explicit scroll() because their superview will always have an implicit scroll of zero when they are redrawn in it.

Copy link
Contributor

@low-batt low-batt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced the bad behavior with a build of the develop branch. I fetched the PR locally and confirmed the changes correct the issue with the vertical offset. Changes look good to me.

@lhc70000
Copy link
Member

This is an old problem that we do want to fix.

However, I think the preferenceContentIsScrollable property was designed for the key bindings pane - we want the table always fill the whole super view and resize with the window. This PR breaks the key bindings pane's layout. Is it possible to keep the current behavior but only remove the extra space at the top?

@svobs
Copy link
Contributor Author

svobs commented May 27, 2022

However, I think the preferenceContentIsScrollable property was designed for the key bindings pane - we want the table always fill the whole super view and resize with the window. This PR breaks the key bindings pane's layout. Is it possible to keep the current behavior but only remove the extra space at the top?

Gotcha. I see that now...

I'll try to find time this weekend to see what can be done.

@svobs svobs force-pushed the pref-vertical-offset-fix branch from f55267c to 77cee0f Compare May 29, 2022 11:12
@svobs
Copy link
Contributor Author

svobs commented May 29, 2022

I think I fixed it. I ended up leaving in the preferenceContentIsScrollable logic but took out the problematic calls to change scrollView, and just adjusted the vertical offsets for a couple of constraints.

I also noticed that the Advanced page could benefit from having its table expand down with the window as well, so figured better to beg forgiveness than ask for permission? 😇 It's the single reason why PrefAdvancedViewController.swift has changes.

…l all extra window space. Also do the same for the "mpv options" table in Advanced pane.
@svobs svobs force-pushed the pref-vertical-offset-fix branch from 77cee0f to 3f52d8c Compare July 25, 2022 07:12
@low-batt low-batt linked an issue Oct 17, 2022 that may be closed by this pull request
@uiryuu uiryuu requested a review from lhc70000 October 18, 2022 06:59
@lhc70000 lhc70000 merged commit 9e88ab9 into iina:develop Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preference panes keep shifting vertically
3 participants