-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Reimplement ColorPicker presets #51700
Conversation
This design is on the right track. Something came up, maybe @groud can review. |
d7b4181
to
10b6858
Compare
5e589e3
to
334afe3
Compare
I get this crash when I try to remove preset:
|
Looks like the destroctor runs which calls unref on a static property, so the next time draw is called on any button it crashes. |
Is there even a need for cached stylebox? They aren't very expensive. You could create them on demand to prevent having lots of unused styleboxes in every picker. Or maybe put it in theme and add checks that ensure it's StyleboxFlat (or a StyleboxTexture, which you could colorize; that would be interesting option for customization). |
You could actually avoid adding a new class if you made a flat button and used |
334afe3
to
0425bc7
Compare
Fixed the crash. (the cached stylebox was a bad last-minute decision without testing :/) |
0425bc7
to
a56c0ce
Compare
Ah, you are right. Having a custom button is more light-weight in this case, so it's ok. |
a56c0ce
to
44cd184
Compare
44cd184
to
bae246e
Compare
With styling support like this I kind of think it could be made into a separate |
I think that could be done in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok overall, but change the conditions in NOTIFICATION_DRAW
like I commented.
bae246e
to
d13c09f
Compare
d13c09f
to
ff9901f
Compare
Thanks. |
This would need a dedicated backport PR for |
Reimplements the color preset functionality of the ColorPicker:
Changes:
Presets were disabled due to the way they were implemented as stated by reduz's comment:
//presets should be shown using buttons or something else, this method is not a good idea
(the former method was using a TextureRect for the whole palette)