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

Display the old color in ColorPicker for easier comparison #34840

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jan 5, 2020

master version of #48611.

This only affects ColorPickerButton nodes that spawn a ColorPicker, not standalone ColorPickers. The old color is on the left, the new color is on the right.

This partially addresses #7366.

Preview

ColorPicker preview

@Calinou Calinou added this to the 4.0 milestone Mar 12, 2020
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Mar 12, 2020
@YuriSizov
Copy link
Contributor

In hopes for this to get merged before 3.2.3 release maybe worth resolving the conflicting file? 🙂

@Calinou Calinou force-pushed the colorpicker-display-old-color branch 2 times, most recently from 9ab9064 to 5b377d6 Compare July 6, 2020 18:13
@Calinou
Copy link
Member Author

Calinou commented Jul 6, 2020

Rebased and tested again. It still works as expected:

image

@YuriSizov
Copy link
Contributor

I've rebased and tested it locally, works as intended. Though for a very specific case of the editor theme it may be worth to have some border around the colors, or something:

image

@Calinou
Copy link
Member Author

Calinou commented Jan 16, 2021

@pycbouh Good catch, but I'd prefer adding the border in a separate PR. This issue is present without the change provided by this PR anyway.

@gongpha
Copy link
Contributor

gongpha commented Feb 17, 2021

I think it will be better when clicking on the old color box. And the color will reset to an old one. This should help those who pick the wrong color and don't want to close a modal.

@Calinou Calinou force-pushed the colorpicker-display-old-color branch from 5b377d6 to 93a61f5 Compare February 17, 2021 15:33
@Calinou Calinou requested a review from a team as a code owner February 17, 2021 15:33
@Calinou
Copy link
Member Author

Calinou commented Feb 17, 2021

Rebased and tested again:

image

I think it will be better when clicking on the old color box. And the color will reset to an old one. This should help those who pick the wrong color and don't want to close a modal.

This is a good idea, but I'll leave it for a future pull request.

Edit: Pull request opened: #48618

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, still works both in editor and in projects. Though, I've missed this initially:

This only affects ColorPickerButton nodes that spawn a ColorPicker, not standalone ColorPickers.

Why don't we expose that for any ColorPicker? Not even as an option. The API is sound, it can be exposed to the user, I think.
We can do it in another PR, I'm just not sure why the limitation is here in the first place.

@Calinou
Copy link
Member Author

Calinou commented Feb 17, 2021

Why don't we expose that for any ColorPicker? Not even as an option. The API is sound, it can be exposed to the user, I think.
We can do it in another PR, I'm just not sure why the limitation is here in the first place.

Unlike ColorPickerButtons which let you toggle the ColorPicker's visibility, standalone ColorPickers are always visible by default. Therefore, we'd need to define some API to reset the old color (or manually set it to an arbitrary value).

@YuriSizov
Copy link
Contributor

Yes, and you've defined it already 🙂

void ColorPicker::set_old_color(const Color &p_color) {
	old_color = p_color;
}

@Calinou
Copy link
Member Author

Calinou commented Feb 17, 2021

@pycbouh It should be easy to expose those methods, but I'd still leave it to a future PR to ensure we can get everything right (including hiding the Old Color property in the inspector when the Display Old Color property is unchecked).

scene/gui/color_picker.cpp Outdated Show resolved Hide resolved
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from that one comment I left it looks ok.

@Calinou Calinou force-pushed the colorpicker-display-old-color branch from 93a61f5 to 13e5637 Compare February 20, 2021 01:51
This only affects ColorPickerButton nodes that spawn a ColorPicker,
not standalone ColorPickers.

This partially addresses godotengine#7366.
@Calinou Calinou force-pushed the colorpicker-display-old-color branch from 13e5637 to 9e1bfe2 Compare May 6, 2021 01:13
@akien-mga akien-mga merged commit 94f6fb6 into godotengine:master May 6, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

This would need a dedicated PR to backport to 3.x and handle the theme and callback changes.

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

Successfully merging this pull request may close these issues.

5 participants