Skip to content
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

Release v1.3: Color, Properties and Component Timings #48

Merged
merged 26 commits into from Aug 16, 2023
Merged

Conversation

sudara
Copy link
Owner

@sudara sudara commented Aug 12, 2023

This builds upon @FigBug's property and color work in #46 and:

  • Puts the treeview on the left (let's see if it feels more right!)
  • Closes FR: Add Magnifying Glass to Color Picker to make it easier to inspect colors  #34
  • Closes Remember panel open/close state across usages #33
  • Closes Show which component has keyboard focus in tree view #22
  • Uses custom mouse cursor for eyedropper
  • Puts color properties in the color panel
  • Add switch for rgba <-> hex color display
  • Wrote a ruby script that scrapes for enum ColourIDs to let us display JUCE's ColourIDs by enum name
  • Uses the existing color picker UI for property UI
  • Turning the color picker disables the overlay
  • Clicking to pick a color turns the color picker off and reenables the overlay
  • Shows last picked color
  • When color panel is closed, the color picker should be disabled
  • Basic theming of the JUCE color swatches popup
  • Puts custom properties on top of prop panel and uses the highlight color to call them out (would prefer a "tag" here, but would require breaking out of the property component)
  • Removes the ability to pass in a properties file, instead stores settings in a SharedResourcePointer so it can be accessed from any component
  • Formats an int64 property ending in At (such as lastPaintAt as a time (open to suggestions/improvement)
  • Adds propertiesToIgnore for special properties used elsewhere in the UI (padding, timing) with the intention that this can be user configurable in the future
  • Unify melatonin::colors formats and names
  • Clean up scrollbar to match Figma colors and work around JUCE's brittletree view implementation
  • Add "max" to paint timings
  • Double clicking the preview panel repaints the selected component, clears the MAX timing
  • Add RAII helper to collect paint timings

TODO:

  • Final UI cleanup up of color panel
  • Fix keyboard focus icon on root
  • Fix timings still shown on components without timing
  • Fix preview sometimes not repainted/updated (for example waveform on sine machine)
  • Fix fiddley disclosure triangle issue

FOLLOWUPS:

  • Keyboard focus improvements (track lastFocused, deal with wantsKeyboardFocus)
  • The preview<->color picker relationship is a bit sketchy
  • Passing in a callback to the picker that calls a callback is a dubious amount of indirection
  • Clean up property adding in the model, it's become spaghetti...
  • Clean up / align fonts

AudioPluginHost - 2023-08-14 38

AudioPluginHost - 2023-08-14 25

AudioPluginHost - 2023-08-14 01

AudioPluginHost - 2023-08-16 57

@sudara sudara marked this pull request as ready for review August 15, 2023 00:07
@sudara
Copy link
Owner Author

sudara commented Aug 15, 2023

@dikadk This is just about ready to go, you could include melatonin_inspector/melatonin/helpers/timing.h
stick melatonin::ComponentTimer timer { this }; at the top of a paint method to try it out.

Still a few bugs to knock out, then I'll update README and announce the features on the forum.

@sudara
Copy link
Owner Author

sudara commented Aug 15, 2023

Ok, I fixed all the bugs I kept running into. If anyone wants to test before release, I'd be happy for any feedback!

@FigBug
Copy link
Collaborator

FigBug commented Aug 15, 2023

Here is a patch that cleans up some warnings. Also, when disabling the colour picker, I think the zoomed in image should go back to the zoomed out version.

warnings.patch

@sudara
Copy link
Owner Author

sudara commented Aug 15, 2023

Thanks!

when disabling the colour picker, I think the zoomed in image should go back to the zoomed out version.

Ah yeah, I feel like i fixed this 5 times, I'll do another round, thx!

@FigBug
Copy link
Collaborator

FigBug commented Aug 15, 2023

Another issue I'm seeing is clicking on an item in the tree either expands it or collapses it, but does not always select it. Seems like you can only reliably select items without children.

@sudara
Copy link
Owner Author

sudara commented Aug 16, 2023

does not always select it.

@FigBug Is this only in the case of clicking on the disclosure triangle (or to the left of it)? If so that was intentional, to allow open/closing without changing selection. But if you think it makes most sense to always select on open, I can add that behavior back. Also let me know if you are seeing it be glitchy, as I spent (too much time) trying to sort that, it's possible there's still some edge cases.

It looks like on deselect the preview needs to be cleared too. I'll take a look tomorrow.

@sudara sudara changed the title Color & Properties reloaded (WIP) Release v1.3: Color, Properties and Component Timings Aug 16, 2023
@sudara
Copy link
Owner Author

sudara commented Aug 16, 2023

Ahh, found the issue. It was really next to impossible to skin the TreeViewItem as we had it designed (full width background selection), as the the widget's styling/position is coupled with behavior (as often the case with JUCE widgets). The issue here was twofold, toggling disclosure was forcing selection and I accidentally left in some additional mouse listening.

I double checked the existing behavior on main:

  • Clicking to the left of a disclosure icon (in the empty space) does nothing
  • Clicking a disclosure icon expands/collapses, but never selects or deselects
  • Clicking the text (or to the right of the text) always selects AND opens or deselects (leaving it open) without closing.

AudioPluginHost - 2023-08-16 38

Behavior should now be same as on main.

However, there are a few minor additional changes:

  • Clicking slightly to the left of a disclosure will expand/collapse the disclosure (on main it does nothing)
  • Now that the tree is on the left and the "selected" background now goes all the way to the left (as designed) there might be the impression clicking the left gutter should select an item (it could? we could restrict the disclosure behavior to the icon itself)

@sudara
Copy link
Owner Author

sudara commented Aug 16, 2023

Releasing for now, we can followup with any minor changes.

@sudara sudara merged commit c82b3f5 into main Aug 16, 2023
@sudara
Copy link
Owner Author

sudara commented Aug 16, 2023

FYI also working on the bug with the color picker and "even number of zoomed in pixels" in case anyone runs into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants