sudara / melatonin_inspector

A JUCE module that gives you the ability to inspect and visually edit (non-destructively) components in your UI.
MIT License
145 stars 17 forks source link

Begin Focus vs Mouse mode #101

Closed baconpaul closed 7 months ago

baconpaul commented 7 months ago
  1. Add a setSelectionMode with an enum for current FOLLOWS_MOUSE or FOLLOWS_FOCUS
  2. Unregister / register appropriate focus listener, structure for other options
  3. Add the listener to update state

With this plus inspectr->setFocusMode called explicitly on launch melatonin is equivalent to the surge focus debugger. Awesome.

The primary thing not done yet is a toggle button in teh UI to swap modes. You can only swap programatically.

Addresses #97

baconpaul commented 7 months ago

The reason I didn't do a button is I couldn't figure out how to make assets etc... so I figured add a function and then perhaps if you decide to merge this, you could help with that part?

sudara commented 7 months ago

Woo!

Yeah, adding assets is described here, but it's a brittle pain in the butt and may only work on my machine.

Also I care about the icon / will need a minute to cook one up...

baconpaul commented 7 months ago

Great. We can also merge as a two step. Have this function version (and I can add a menu I surge in the interim) and a button once you have time. If the function looks correct of course

sudara commented 7 months ago

Thanks for the patience! I have a policy to check things out locally and make sure I understand them before merging (otherwise I tend to get into trouble post-merge being like "wait, how did that get here!"). I had to add a bit more rudimentary accessibility in my own app to check this one out. Also, I tried yesterday but changing the default to FOLLOW_FOCUS didn't work (as the function needs to be called somewhere).

Merging now and will follow up with toggle and icon.

This is maybe also worth storing in settings->props so that while iterating on an app the mode persists.