-
-
Notifications
You must be signed in to change notification settings - Fork 782
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
Add CascadeActiveAppWindows refinements #1431
Conversation
- the cascade goes to the quadrant in which the center of the active window is found - width and height of the cascaded windows are limited so that they remain within the screen
Thanks for continuing to improve your work here! I understand the changes you're making, and this corner of the code is mainly only touched by you, but if you don't mind let's make the names of everything more readable. I'll comment inline. |
bottom = windowFrame.midY > screenFrame.midY | ||
self.n = n | ||
let m = CGSize(width: screenFrame.width - CGFloat(n - 1) * delta, height: screenFrame.height - CGFloat(n - 1) * delta) | ||
self.size = CGSize(width: min(size.width, m.width), height: min(size.height, m.height)) |
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.
n and m here take some reasoning to figure out what they mean. Can you think of better names for them?
filtered.removeFirst() | ||
filtered.append(first) | ||
firstSize = first.size | ||
caaw = CascadeActiveAppWindows(windowFrame: first.frame, screenFrame: screenFrame, n: filtered.count, size: first.size!, delta: delta) |
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.
If CascadeActiveAppWindows
becomes CascadeActiveAppParameters
, then we could change caaw
to something like cascadeParameters
@rxhanson Thank you for the suggestions to make the code more readable, which I now applied. |
Looks good! |
Thank you! |
This PR proposes refinements to the command
cascadeActiveApp
(published inrectangle v0.69
from PR #1146 and #1163)before: the cascade goes to the top left quadrant
now: the cascade goes to the quadrant in which the center of the active window is found, so that the user can have up to 4 different apps cascaded
before: the size of the active (first) window is enforced onto the other windows in the cascade
now: same, but the size width and height are constrained so that all cascaded windows remain within the screen