Add option to use floating windows for model previews on macOS#19
Conversation
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
|
Great idea! Although I wonder if it would work better as a persistent "preview" window that always shows the most recently edited file rather than a per-window setting? (Similar to how Deckset's preview works) |
I'm so glad to hear that |
Hmm that is a good point. I did notice one issue which is that if you enable tabs within the same window, the floating setting doesn’t stick if you change tabs so at the very least I think that should be fixed although not sure the best way to handle that (maybe an argument to move it under the Also, I think it could get a little messy with imports. For example if you change a file that is imported into multiple files or imported into files that are imported into other files, how do you know which one to display in the preview? I suppose it would have to be the last file saved that imports that file, but then the logic starts to get pretty complex since you have to track the full import tree to do it properly. The per window setting is at least simple to implement, easy to understand as a user, and doesn’t require tracking any really complicated state 😅.
Just simple things for now. I’m new to 3D design and had been using tinkercad, but I am trying out different things as a next step. I’m currently attempting to port a design I made there over. I can share more later. Also will definitely let you know if I have other feature requests. |
e2e4aef to
14419f2
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
This adds a `Float Window` option to the `View` menu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.
|
@ccampbell I've landed a version of this in the latest release. Hopefully you're happy with the implementation I went with, but let me know if not, or if you have any suggestions for improvements: https://github.com/nicklockwood/ShapeScript/releases/tag/1.9.0 |
|
Hi @nicklockwood thanks so much. I think the way you implemented it functionally is great. That said, I noticed one strange thing. For some reason with the new implementation when clicking outside of the window it somehow becomes transparent so you can see through it for a quick flash. I took a screen capture to show. First in my build: shapescript-focus-older-build.movNow in the latest build: shapescript-focus-new-build.movIt doesn’t happen every time, and I haven’t tried to debug it or anything, but just something I noticed. |
|
Unsure if it is related, but I also noticed some artifacts when resizing the preview window in the latest build shapescript-artifacts.mov |
To fix the issue with tabs, I switch the window back to non-floating when the application moves to the foreground. I suspect that the flash is due to this transition. |
|
Ah okay, I actually just noticed another issue related to this. If you have another floating window open at the same time, such as PiP video playing and you focus the shapescript floating window, it remains behind the PiP window until you switch to another app so that is probably the same issue 😕 . |
|
@ccampbell I've switched to a different approach and pushed a new update. Hopefully that will solve the glitches you were seeing. Instead of disabling floating when the app moves to the foreground, I now only switch it when changing window focus. This reintroduced the problem with switching tabs, but I found a workaround for that, and they now actually work much better than before! |
|
@ccampbell btw, would you like me to add you to the Testflight/beta program for ShapeScript? And if so should I use this email for you, or a different one? |
I tried it out by building in Xcode, and so far it seems to work great!
Sure, feel free to add me. The email I used when I emailed you in September should be the one to use. |
Hi there. I have been exploring different options for using code to generate 3D models, and so far I am really enjoying ShapeScript. As a macOS and iPad user it seems to fit naturally into my workflow. So far this is the only feature I felt was missing since I don’t like to use spaces or split screen or anything else.
This adds a
Float Windowoption to theViewmenu to allow a model window to float over other applications on macOS. This allows you to keep the preview open to the side of the document in your text editor to see changes in real time.I couldn’t decide if this should go in the
Viewmenu or theWindowmenu, but I choseViewsince that is where all the other view specific options are. Happy to change it if you feel strongly. Let me know if there is anything I am missing here.I am also working on a grammar for Sublime Text that is coming along pretty nicely and supports jumping to symbols as well. Here is a video of the floating window behavior in action:
shapescript-floating.mp4