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

Is it possible to show where a colour for a component comes from? #127

Open
7sharp9 opened this issue Nov 27, 2024 · 4 comments
Open

Is it possible to show where a colour for a component comes from? #127

7sharp9 opened this issue Nov 27, 2024 · 4 comments

Comments

@7sharp9
Copy link

7sharp9 commented Nov 27, 2024

In the case where there might be mutiple LookAndFeels there appears to be one for each property assigned in the inspector but its not possible to know what LookAndFeel assigned it.

Screenshot 2024-11-27 at 15 04 55

Would this be an easy implemented addition?

Thanks for this great component by the way!

@7sharp9
Copy link
Author

7sharp9 commented Nov 27, 2024

Notice the mutiple outlineColourId props

@sudara
Copy link
Owner

sudara commented Dec 1, 2024

I'm not totally sure! Would be nice.

If you feel motivated to look into it, you can poke around here to see how the colors are populated, they are properties the component has: https://github.com/sudara/melatonin_inspector/blob/main/melatonin/component_model.h#L243-L247

I can't remember at the moment all the details, but I think setColour actually adds the colors to the component by int ID — we are doing a reverse lookup, you can search in the codebase and JUCE for jcclr_ (which is how color properties are prefixed).

@7sharp9
Copy link
Author

7sharp9 commented Dec 1, 2024

I mean its not super important but I might take a quick look to see if its easy enough, thanks for the pointer!

@7sharp9
Copy link
Author

7sharp9 commented Dec 1, 2024

Screenshot 2024-12-01 at 17 25 59

I added an enum style prefix to the known colour Id's for the outline colour. The reason this came up was I couldn't tell if I had forgot to add a colour overload to a Look and Feel or if there was a different component I hadn't set. Just general confusion when inspecting juce components! ;-)

Im not sure if this needs some additional UI so show where the known enum colour is from. It might be that its just me that needed something like this.

Notice the Label and TextEditor prefix in the image

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

No branches or pull requests

2 participants