-
-
Notifications
You must be signed in to change notification settings - Fork 792
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 commands for constrained resize #1504
Conversation
Thanks for contributing. I haven't looked at your change yet, but wanted to answer this:
There's a bug (at least I think it's a bug?) with accessibility privileges that makes developing without a paid developer ID a pain here. You will need to
You'll have to do this every time you make a change :( I think a long time ago I had heard perhaps you can give Xcode accessibility privileges to get around this, but that didn't work for me then and I don't think it would make a difference. |
Hey @rxhanson Thanks so much for the tip. I was able to build and run Rectangle using XCode and I can confirm that the new commands work as expected. Please feel free to take a look. At the moment I have hardcoded the keyboard shortcuts for the new commands as posted before. I don't know if there is a way for someone (the user) to change the shortcuts later. |
Glad that you've got things working! You shouldn't have to do anything extra to allow these actions to be configured via Terminal, see an example: https://github.com/rxhanson/Rectangle/blob/main/TerminalCommands.md#add-an-extra-centering-with-prominence-command I'll give things a thorough test soon. In the meantime, things look good; the only things that jumped out at me the code are:
|
@rxhanson I fixed indentation, removed default shortcuts and added some documentation. |
Thanks! |
I love the resize commands in rectangle but often I wish there was a way to only resize in one dimension. This PR is an attempt to add those commands. There is a related discussion in #387 which is the inspiration for this PR.
This PR adds two new window actions,
largerWidth
andsmallerWidth
, which are intended to make the window width larger / smaller without changing its height. (Technically,largerHeight
can be achieved bylarger
followed bysmallerWidth
andsmallerHeight
can be achieved bysmaller
followed bylargerWidth
, so those are omitted.)I have defined the two new actions in
WindowAction.swift
. I have also made changes inChangeSizeCalculation.swift
for the new actions. The default shortcuts for the two new commands are defined as follows:That being said, I do not have prior experience building macOS apps or using XCode, so I have not been able to test the changes. When building the project on XCode, the build succeeds and I get a prompt to "Authorize Rectange" which asks me to open system settings and enable "Rectangle.app", but it's already enabled. Any help would be appreciated.