-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat: add smart-opposite resize option #742
Conversation
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.
Please ping me back when you fix the CI
You also need to update this line https://github.com/nikitabobko/AeroSpace/pull/742/files#diff-7a3999a307e560d8f439d95603d6b511bfaefe93607e2e0494505be04af95c0cR12 |
Co-authored-by: Nikita Bobko <[email protected]>
Co-authored-by: Nikita Bobko <[email protected]>
Co-authored-by: Nikita Bobko <[email protected]>
@nikitabobko Thanks for your help on this - have the CI passing now |
Thanks, merged with the following patch: diff --git a/Sources/AppBundle/command/impl/ResizeCommand.swift b/Sources/AppBundle/command/impl/ResizeCommand.swift
index 0bd64498..cd7e5905 100644
--- a/Sources/AppBundle/command/impl/ResizeCommand.swift
+++ b/Sources/AppBundle/command/impl/ResizeCommand.swift
@@ -32,10 +32,11 @@ struct ResizeCommand: Command { // todo cover with tests
parent = first.parent as! TilingContainer
orientation = parent.orientation
case .smartOpposite:
- guard let first = candidates.first else { return false }
+ guard let _orientation = (candidates.first?.parent as? TilingContainer)?.orientation.opposite else { return false }
+ orientation = _orientation
+ guard let first = candidates.first(where: { ($0.parent as! TilingContainer).orientation == orientation }) else { return false }
node = first
parent = first.parent as! TilingContainer
- orientation = parent.orientation.opposite
}
let diff: CGFloat = switch args.units.val {
case .set(let unit): CGFloat(unit) - node.getWeight(orientation) otherwise the code crashes. Please next time always run your code before submitting it, even if it looks trivial |
Fixes #741
I've never worked on a swift app, but it seems like a small add so hopefully this is OK.