jean-emmanuel / open-stage-control

Libre and modular OSC / MIDI controller
https://openstagecontrol.ammd.net
GNU General Public License v3.0
702 stars 88 forks source link

[Feature] Canvas zoom-in/zoom-out #796

Closed AtmanActive closed 1 year ago

AtmanActive commented 1 year ago

Hi,

I'm using Open Stage Control daily and I'm very much enjoying it.

Here are a few feature suggestions with the aim of making it even better.

It would be great if we would have a tool to quickly zoom-in/zoom-out the canvas. I mean, being able to zoom-in/zoom-out only the design area while leaving the editor panes intact. The right pane (Inspector) could have three little buttons to the left of the word "Inspector" where one could be: zoom-in, the second one: zoom-out, and the third one: reset-zoom. This zoom-in level (if not 1) should be temporarily reset to 1 when in run mode (when editor disabled) and brought back to whatever the value was when in editor mode (when editor enabled). I don't think this zoom value should be saved in any of the files. It would be just a design aid of temporary use. There is no need to apply this zoom when in run mode since we can then zoom-in/zoom-out the whole browser, which works just fine.

Thank you for developing this awesome software!

jean-emmanuel commented 1 year ago

This seems doable by tweaking the existing local zoom feature (alt + scroll) so that it doesn't affect the rest of the UI.

AtmanActive commented 1 year ago

This trick with Alt+scroll is great. I wish I knew about it before. It is a bit hectic and not as elegant as the above described solution, but it is of some help. Thank you.

That reminds me, if you've ever seen Atom IDE, when there is no file open then it shows a faint-colored usage hint. That gave me the idea that Open Stage Control's empty screen (when no file is loaded yet) could be a static vector image showing these hints which are not that obvious and not shown in the documentation or in the keyboard shortcuts pop-in. Just an idea.

jean-emmanuel commented 1 year ago

Alt+scroll now only affects the widgets and adds scrollbars to navigate instead of following the mouse (can be tested in v1.19.0-beta).

I've been using atom since day one :), and actually I thought of that too but never took the time, good idea.

AtmanActive commented 1 year ago

OK, I gave it a quick spin (v1.19.0-beta) and zoom-in (alt+scroll) is working correctly, but zoom-out seems to be limited to 1.0? I think it would be useful to allow any zoom-out level (even 0.1) to allow the designer to see the smaller version as well.

Switching from editor to runtime doesn't reset it back to 1.0? I believe this to be important, as it can easily confuse designer as to what the real size is. Besides, for runtime-only use cases alt+scroll is not needed as there is browser's zoom-in/out available, as well as OSC's URL parameter option for adjusting zoom.

Also, working in FireFox, alt keypress is already mapped to FireFox's show-hide-top-menu so it happens that while I'm pressing alt, to effect zoom-in/out, FireFox steals my focus and I can't continue until I click on the canvas to bring the focus back. This is why I would vote to have three separate buttons somewhere in the UI (to the left of the word "Inspector" seems appropriate).

Thanks!

jean-emmanuel commented 1 year ago

included in 1.19.0

jean-emmanuel commented 1 year ago

1.19.1 fixes zoom-out so that the root widget's viewport gets adjusted as expected.

AtmanActive commented 1 year ago

Beautiful. Thank you for developing this awesome software!