Repository navigation
Style: Basic styling options for DragDrop target rect - #9056
aaronkirkham wants to merge 1 commit into
Conversation
|
I appreciate the addition of the style variables. I had made a bit of a hack to get similar results in 1.90, and I can finally get rid of it! |
|
@Marcets423 May I ask if you actually have the need for them to change mid-frame and how/why? The general idea to not spam the enum is to only include stuff which is likely to change mid-frame (vs stuff you would change in your initial style). |
|
@ocornut I see your point. We have a wrapper library with a theme serialisation module, and we're building themes using a theme editor that lists the available variables (similar to the Style window). I use GetStyleVarInfo heavily there. It allows us to edit the style in an XML format, so there's no need to recompile. My immediate need is for a DragDropTargetRectRounding enum, (I've just upgraded from 1.90, so I haven't put the other variables to use yet). Before this, I was using frameRounding as the radius arg in the rect drawing that was moved to "RenderDragDropTargetRectEx" post v1.90. (Which is probably still the best way to do it in our use case, to be fair, as I don't have to worry about matching DragDropTargetRounding to FrameRounding.) So if you think that it's not ideal to add enums to these variables, then it's not that big of an issue for us. It's mainly me who is trying to reduce our modifications to the library where I can. |
|
I could add the rounding parameter to |
|
I have pushed ab36fba with:
I ended up not doing that, as it felt too arbitrary. |
Hey,
After using the very limited styling options for the old drag-drop target rect for as long as I can remember - I decided it was time to finally add some semi-useful options so I can achieve the look I wanted.
This PR adds three new style variables and a color. These new variables/color are defaulted to their old, previously hard-coded values so nothing will change visually unless you explicitly change these new options.
Here's a quick look at what is possible, and the code I'm using to achieve it
Before

After

Happy to take feedback and make changes on the naming of these variables.