|
@@ -1258,6 +1258,10 @@ void ColorPicker::_update_text_value() {
|
|
|
}
|
|
|
|
|
|
void ColorPicker::_sample_input(const Ref<InputEvent> &p_event) {
|
|
|
+ if (!display_old_color) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const Ref<InputEventMouseButton> mb = p_event;
|
|
|
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT) {
|
|
|
const Rect2 rect_old = Rect2(Point2(), Size2(sample->get_size().width * 0.5, sample->get_size().height * 0.95));
|
|
@@ -1310,7 +1314,7 @@ void ColorPicker::_sample_draw() {
|
|
|
|
|
|
if (color.r > 1 || color.g > 1 || color.b > 1) {
|
|
|
// Draw an indicator to denote that the new color is "overbright" and can't be displayed accurately in the preview.
|
|
|
- sample->draw_texture(theme_cache.overbright_indicator, Point2(uv_edit->get_size().width * 0.5, 0));
|
|
|
+ sample->draw_texture(theme_cache.overbright_indicator, Point2(display_old_color ? sample->get_size().width * 0.5 : 0, 0));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2269,17 +2273,10 @@ ColorPicker::ColorPicker() {
|
|
|
mode_popup->set_item_checked(current_mode, true);
|
|
|
mode_popup->set_item_checked(MODE_MAX + 1, true);
|
|
|
mode_popup->connect(SceneStringName(id_pressed), callable_mp(this, &ColorPicker::_set_mode_popup_value));
|
|
|
- VBoxContainer *vbl = memnew(VBoxContainer);
|
|
|
- real_vbox->add_child(vbl);
|
|
|
-
|
|
|
- VBoxContainer *vbr = memnew(VBoxContainer);
|
|
|
-
|
|
|
- real_vbox->add_child(vbr);
|
|
|
- vbr->set_h_size_flags(SIZE_EXPAND_FILL);
|
|
|
|
|
|
slider_gc = memnew(GridContainer);
|
|
|
|
|
|
- vbr->add_child(slider_gc);
|
|
|
+ real_vbox->add_child(slider_gc);
|
|
|
slider_gc->set_h_size_flags(SIZE_EXPAND_FILL);
|
|
|
slider_gc->set_columns(3);
|
|
|
|
|
@@ -2291,7 +2288,7 @@ ColorPicker::ColorPicker() {
|
|
|
|
|
|
hex_hbc = memnew(HBoxContainer);
|
|
|
hex_hbc->set_alignment(ALIGNMENT_BEGIN);
|
|
|
- vbr->add_child(hex_hbc);
|
|
|
+ real_vbox->add_child(hex_hbc);
|
|
|
|
|
|
hex_hbc->add_child(memnew(Label(ETR("Hex"))));
|
|
|
|