From ea4e64197dcceba99da76642e40b201f9c513e58 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 31 Jan 2025 13:56:39 +0100 Subject: [PATCH 1/3] Fix ColorPicker sliders in overbright RGB --- scene/gui/color_mode.cpp | 6 ------ scene/gui/color_mode.h | 5 ++++- scene/gui/color_picker.cpp | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scene/gui/color_mode.cpp b/scene/gui/color_mode.cpp index 0ebb529d82b5..119cb72693b9 100644 --- a/scene/gui/color_mode.cpp +++ b/scene/gui/color_mode.cpp @@ -43,12 +43,6 @@ String ColorModeRGB::get_slider_label(int idx) const { return labels[idx]; } -float ColorModeRGB::get_slider_max(int idx) const { - ERR_FAIL_INDEX_V_MSG(idx, 4, 0, "Couldn't get slider max value."); - Color color = color_picker->get_pick_color(); - return next_power_of_2(MAX(255, color.components[idx] * 255.0)) - 1; -} - float ColorModeRGB::get_slider_value(int idx) const { ERR_FAIL_INDEX_V_MSG(idx, 4, 0, "Couldn't get slider value."); return color_picker->get_pick_color().components[idx] * 255; diff --git a/scene/gui/color_mode.h b/scene/gui/color_mode.h index c035fe6f65a3..4c73967e15fb 100644 --- a/scene/gui/color_mode.h +++ b/scene/gui/color_mode.h @@ -46,6 +46,7 @@ class ColorMode { virtual float get_spinbox_arrow_step() const { return get_slider_step(); } virtual String get_slider_label(int idx) const = 0; virtual float get_slider_max(int idx) const = 0; + virtual bool get_allow_greater() const { return false; } virtual float get_slider_value(int idx) const = 0; virtual Color get_color() const = 0; @@ -92,7 +93,8 @@ class ColorModeRGB : public ColorMode { virtual float get_slider_step() const override { return 1; } virtual String get_slider_label(int idx) const override; - virtual float get_slider_max(int idx) const override; + virtual float get_slider_max(int idx) const override { return 255; } + virtual bool get_allow_greater() const override { return true; } virtual float get_slider_value(int idx) const override; virtual Color get_color() const override; @@ -114,6 +116,7 @@ class ColorModeRAW : public ColorMode { virtual float get_spinbox_arrow_step() const override { return 0.01; } virtual String get_slider_label(int idx) const override; virtual float get_slider_max(int idx) const override; + virtual bool get_allow_greater() const override { return true; } virtual float get_slider_value(int idx) const override; virtual Color get_color() const override; diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index aab7c37bbb5e..5eb6a65342e5 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -675,8 +675,9 @@ void ColorPicker::_update_color(bool p_update_sliders) { for (int i = 0; i < current_slider_count; i++) { sliders[i]->set_max(modes[current_mode]->get_slider_max(i)); sliders[i]->set_step(step); - values[i]->set_custom_arrow_step(spinbox_arrow_step); sliders[i]->set_value(modes[current_mode]->get_slider_value(i)); + values[i]->set_custom_arrow_step(spinbox_arrow_step); + values[i]->set_allow_greater(modes[current_mode]->get_allow_greater()); } alpha_slider->set_max(modes[current_mode]->get_slider_max(current_slider_count)); alpha_slider->set_step(step); From 2bb612067a3b3adb3a07fe98f49632dbc9c686f8 Mon Sep 17 00:00:00 2001 From: LuoZhihao Date: Wed, 5 Mar 2025 23:17:39 +0800 Subject: [PATCH 2/3] ColorPicker: Add an intensity slider in raw mode for HDR When color is overbright, automatically switch the hex text to script text. Meanwhile, add the "script" icon to theme to ensure the icon is also visible at runtime. --- doc/classes/ColorPicker.xml | 3 ++ editor/themes/editor_theme_manager.cpp | 1 + scene/gui/color_mode.cpp | 27 ++++++++--- scene/gui/color_mode.h | 8 ++- scene/gui/color_picker.cpp | 67 ++++++++++++++++++-------- scene/gui/color_picker.h | 4 +- scene/theme/default_theme.cpp | 1 + scene/theme/icons/script.svg | 1 + 8 files changed, 82 insertions(+), 30 deletions(-) create mode 100644 scene/theme/icons/script.svg diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 81624b1d740f..9f0e78475496 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -168,6 +168,9 @@ Custom texture for the hue selection slider on the right. + + The icon for the button that switches color text to hexadecimal. + The icon for color preset drop down menu when expanded. diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 1793418c2a22..ab81c52785f0 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -1769,6 +1769,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the p_theme->set_icon("bar_arrow", "ColorPicker", p_theme->get_icon(SNAME("ColorPickerBarArrow"), EditorStringName(EditorIcons))); p_theme->set_icon("picker_cursor", "ColorPicker", p_theme->get_icon(SNAME("PickerCursor"), EditorStringName(EditorIcons))); p_theme->set_icon("picker_cursor_bg", "ColorPicker", p_theme->get_icon(SNAME("PickerCursorBg"), EditorStringName(EditorIcons))); + p_theme->set_icon("color_script", "ColorPicker", p_theme->get_icon(SNAME("Script"), EditorStringName(EditorIcons))); // ColorPickerButton. p_theme->set_icon("bg", "ColorPickerButton", p_theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); diff --git a/scene/gui/color_mode.cpp b/scene/gui/color_mode.cpp index 119cb72693b9..5fae32c17d41 100644 --- a/scene/gui/color_mode.cpp +++ b/scene/gui/color_mode.cpp @@ -204,26 +204,41 @@ void ColorModeHSV::slider_draw(int p_which) { } String ColorModeRAW::get_slider_label(int idx) const { - ERR_FAIL_INDEX_V_MSG(idx, 3, String(), "Couldn't get slider label."); + ERR_FAIL_INDEX_V_MSG(idx, 4, String(), "Couldn't get slider label."); return labels[idx]; } float ColorModeRAW::get_slider_max(int idx) const { - ERR_FAIL_INDEX_V_MSG(idx, 4, 0, "Couldn't get slider max value."); + ERR_FAIL_INDEX_V_MSG(idx, 5, 0, "Couldn't get slider max value."); return slider_max[idx]; } +float ColorModeRAW::get_slider_min(int idx) const { + ERR_FAIL_INDEX_V_MSG(idx, 5, 0, "Couldn't get slider min value."); + return idx == 3 ? intensity_min : 0; +} + float ColorModeRAW::get_slider_value(int idx) const { - ERR_FAIL_INDEX_V_MSG(idx, 4, 0, "Couldn't get slider value."); - return color_picker->get_pick_color().components[idx]; + ERR_FAIL_INDEX_V_MSG(idx, 5, 0, "Couldn't get slider value."); + Color color = color_picker->get_pick_color(); + float multiplier = MAX(1, MAX(MAX(color.r, color.g), color.b)); + if (idx == 3) { + return Math::log2(multiplier); + } else if (idx == 4) { + return color.a; + } else { + return color.components[idx] / multiplier; + } } Color ColorModeRAW::get_color() const { Vector values = color_picker->get_active_slider_values(); Color color; - for (int i = 0; i < 4; i++) { - color.components[i] = values[i]; + float multiplier = Math::pow(2, values[3]); + for (int i = 0; i < 3; i++) { + color.components[i] = values[i] * multiplier; } + color.a = values[4]; return color; } diff --git a/scene/gui/color_mode.h b/scene/gui/color_mode.h index 4c73967e15fb..06b432d67437 100644 --- a/scene/gui/color_mode.h +++ b/scene/gui/color_mode.h @@ -46,6 +46,7 @@ class ColorMode { virtual float get_spinbox_arrow_step() const { return get_slider_step(); } virtual String get_slider_label(int idx) const = 0; virtual float get_slider_max(int idx) const = 0; + virtual float get_slider_min(int idx) const { return 0; } virtual bool get_allow_greater() const { return false; } virtual float get_slider_value(int idx) const = 0; @@ -107,15 +108,18 @@ class ColorModeRGB : public ColorMode { class ColorModeRAW : public ColorMode { public: - String labels[3] = { "R", "G", "B" }; - float slider_max[4] = { 100, 100, 100, 1 }; + String labels[4] = { "R", "G", "B", "I" }; + float slider_max[5] = { 1, 1, 1, 4, 1 }; + float intensity_min = -4; virtual String get_name() const override { return "RAW"; } + virtual int get_slider_count() const override { return 4; } virtual float get_slider_step() const override { return 0.001; } virtual float get_spinbox_arrow_step() const override { return 0.01; } virtual String get_slider_label(int idx) const override; virtual float get_slider_max(int idx) const override; + virtual float get_slider_min(int idx) const override; virtual bool get_allow_greater() const override { return true; } virtual float get_slider_value(int idx) const override; diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 5eb6a65342e5..a27a4dee41e9 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -137,10 +137,8 @@ void ColorPicker::_notification(int p_what) { _reset_sliders_theme(); - if (Engine::get_singleton()->is_editor_hint()) { - // Adjust for the width of the "Script" icon. - text_type->set_custom_minimum_size(Size2(28 * theme_cache.base_scale, 0)); - } + // Adjust for the width of the "script" icon. + text_type->set_custom_minimum_size(Size2(28 * theme_cache.base_scale, 0)); _update_presets(); _update_recent_presets(); @@ -432,6 +430,25 @@ void ColorPicker::_slider_value_changed() { s = color.get_s(); v = color.get_v(); last_color = color; + } else if (current_mode == MODE_RAW) { + // If any of rgb sliders exceeds 1, set the color component as is. + bool is_rgb_exceeds = false; + for (int i = 0; i < 3; i++) { + if (sliders[i]->get_value() >= 1 + CMP_EPSILON) { + color.components[i] = sliders[i]->get_value(); + is_rgb_exceeds = true; + } + } + // Then recalculate intensity and keep rgb sliders within 1. + if (is_rgb_exceeds) { + float multiplier = MAX(1, MAX(MAX(color.r, color.g), color.b)); + sliders[0]->set_value_no_signal(color.r / multiplier); + sliders[1]->set_value_no_signal(color.g / multiplier); + sliders[2]->set_value_no_signal(color.b / multiplier); + sliders[3]->set_value_no_signal(Math::log2(multiplier)); + } + // Set intensity spinbox prefix. + values[3]->set_prefix(sliders[3]->get_value() < 0 ? "" : "+"); } _set_pick_color(color, false); @@ -483,6 +500,10 @@ void ColorPicker::create_slider(GridContainer *gc, int idx) { slider->connect(SceneStringName(gui_input), callable_mp(this, &ColorPicker::_slider_or_spin_input)); if (idx < SLIDER_COUNT) { + // Intensity slider + if (idx == 3) { + val->set_prefix("+"); + } sliders[idx] = slider; values[idx] = val; labels[idx] = lbl; @@ -625,7 +646,7 @@ void ColorPicker::_reset_sliders_theme() { } void ColorPicker::_html_submitted(const String &p_html) { - if (updating || text_is_constructor || !c_text->is_visible()) { + if (updating || text_is_constructor || !c_text->is_editable()) { return; } @@ -674,6 +695,7 @@ void ColorPicker::_update_color(bool p_update_sliders) { float spinbox_arrow_step = modes[current_mode]->get_spinbox_arrow_step(); for (int i = 0; i < current_slider_count; i++) { sliders[i]->set_max(modes[current_mode]->get_slider_max(i)); + sliders[i]->set_min(modes[current_mode]->get_slider_min(i)); sliders[i]->set_step(step); sliders[i]->set_value(modes[current_mode]->get_slider_value(i)); values[i]->set_custom_arrow_step(spinbox_arrow_step); @@ -769,9 +791,7 @@ void ColorPicker::_text_type_toggled() { text_is_constructor = !text_is_constructor; if (text_is_constructor) { text_type->set_text(""); -#ifdef TOOLS_ENABLED - text_type->set_button_icon(get_editor_theme_icon(SNAME("Script"))); -#endif + text_type->set_button_icon(theme_cache.color_script); c_text->set_editable(false); c_text->set_tooltip_text(RTR("Copy this constructor in a script.")); @@ -1237,25 +1257,29 @@ bool ColorPicker::is_deferred_mode() const { } void ColorPicker::_update_text_value() { - bool text_visible = true; - if (text_is_constructor) { + bool is_hex_valid = (color.r < 1.0 + CMP_EPSILON) && (color.g < 1.0 + CMP_EPSILON) && (color.b < 1.0 + CMP_EPSILON) && color.r >= 0 && color.g >= 0 && color.b >= 0; + if (text_is_constructor || !is_hex_valid) { String t = "Color(" + String::num(color.r, 3) + ", " + String::num(color.g, 3) + ", " + String::num(color.b, 3); if (edit_alpha && color.a < 1) { t += ", " + String::num(color.a, 3) + ")"; } else { t += ")"; } + text_type->set_text(""); + text_type->set_button_icon(theme_cache.color_script); + + text_type->set_disabled(!is_hex_valid); + c_text->set_text(t); - } + c_text->set_editable(false); + } else { + text_type->set_text("#"); + text_type->set_button_icon(nullptr); + text_type->set_disabled(false); - if (color.r > 1 || color.g > 1 || color.b > 1 || color.r < 0 || color.g < 0 || color.b < 0) { - text_visible = false; - } else if (!text_is_constructor) { c_text->set_text(color.to_html(edit_alpha && color.a < 1)); + c_text->set_editable(true); } - - text_type->set_visible(text_visible); - c_text->set_visible(text_visible); } void ColorPicker::_sample_input(const Ref &p_event) { @@ -2191,6 +2215,8 @@ void ColorPicker::_bind_methods() { BIND_THEME_ITEM(Theme::DATA_TYPE_ICON, ColorPicker, picker_cursor_bg); BIND_THEME_ITEM(Theme::DATA_TYPE_ICON, ColorPicker, color_hue); + BIND_THEME_ITEM(Theme::DATA_TYPE_ICON, ColorPicker, color_script); + BIND_THEME_ITEM_EXT(Theme::DATA_TYPE_STYLEBOX, ColorPicker, mode_button_normal, "tab_unselected", "TabContainer"); BIND_THEME_ITEM_EXT(Theme::DATA_TYPE_STYLEBOX, ColorPicker, mode_button_pressed, "tab_selected", "TabContainer"); BIND_THEME_ITEM_EXT(Theme::DATA_TYPE_STYLEBOX, ColorPicker, mode_button_hover, "tab_selected", "TabContainer"); @@ -2306,13 +2332,12 @@ ColorPicker::ColorPicker() { text_type = memnew(Button); hex_hbc->add_child(text_type); + text_type->set_icon_alignment(HORIZONTAL_ALIGNMENT_CENTER); text_type->set_text("#"); text_type->set_tooltip_text(RTR("Switch between hexadecimal and code values.")); - if (Engine::get_singleton()->is_editor_hint()) { - text_type->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_text_type_toggled)); - } else { + text_type->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_text_type_toggled)); + if (!Engine::get_singleton()->is_editor_hint()) { text_type->set_flat(true); - text_type->set_mouse_filter(MOUSE_FILTER_IGNORE); } c_text = memnew(LineEdit); diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index cc2793b413e8..62ee4e5607c0 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -104,7 +104,7 @@ class ColorPicker : public VBoxContainer { SHAPE_MAX }; - static const int SLIDER_COUNT = 3; + static const int SLIDER_COUNT = 4; private: enum class MenuOption { @@ -269,6 +269,8 @@ class ColorPicker : public VBoxContainer { Ref picker_cursor_bg; Ref color_hue; + Ref color_script; + /* Mode buttons */ Ref mode_button_normal; Ref mode_button_pressed; diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index 06fe298668f3..5ec22bf30fb2 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -1056,6 +1056,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_icon("bar_arrow", "ColorPicker", icons["color_picker_bar_arrow"]); theme->set_icon("picker_cursor", "ColorPicker", icons["color_picker_cursor"]); theme->set_icon("picker_cursor_bg", "ColorPicker", icons["color_picker_cursor_bg"]); + theme->set_icon("color_script", "ColorPicker", icons["script"]); { const int precision = 7; diff --git a/scene/theme/icons/script.svg b/scene/theme/icons/script.svg new file mode 100644 index 000000000000..6e1d32731724 --- /dev/null +++ b/scene/theme/icons/script.svg @@ -0,0 +1 @@ + \ No newline at end of file From c7ba2153106b3fdec1bc959c04051eef429d2b80 Mon Sep 17 00:00:00 2001 From: LuoZhihao Date: Thu, 6 Mar 2025 20:22:41 +0800 Subject: [PATCH 3/3] Colorize raw mode rgb sliders --- scene/gui/color_mode.cpp | 22 +++++++++------------- scene/gui/color_mode.h | 3 +-- scene/gui/color_picker.cpp | 37 +++++++++++++++++-------------------- scene/gui/color_picker.h | 2 -- 4 files changed, 27 insertions(+), 37 deletions(-) diff --git a/scene/gui/color_mode.cpp b/scene/gui/color_mode.cpp index 5fae32c17d41..121a588aaeb7 100644 --- a/scene/gui/color_mode.cpp +++ b/scene/gui/color_mode.cpp @@ -261,7 +261,15 @@ void ColorModeRAW::slider_draw(int p_which) { left_color.a = 0; right_color = color; right_color.a = 1; - + } else if (p_which != 3) { + left_color = Color( + p_which == 0 ? 0 : color.r, + p_which == 1 ? 0 : color.g, + p_which == 2 ? 0 : color.b); + right_color = Color( + p_which == 0 ? 1 : color.r, + p_which == 1 ? 1 : color.g, + p_which == 2 ? 1 : color.b); col.set(0, left_color); col.set(1, right_color); col.set(2, right_color); @@ -275,18 +283,6 @@ void ColorModeRAW::slider_draw(int p_which) { } } -bool ColorModeRAW::apply_theme() const { - for (int i = 0; i < ColorPicker::SLIDER_COUNT; i++) { - HSlider *slider = color_picker->get_slider(i); - slider->remove_theme_icon_override("grabber"); - slider->remove_theme_icon_override("grabber_highlight"); - slider->remove_theme_style_override("slider"); - slider->remove_theme_constant_override("grabber_offset"); - } - - return true; -} - void ColorModeOKHSL::_value_changed() { Vector values = color_picker->get_active_slider_values(); diff --git a/scene/gui/color_mode.h b/scene/gui/color_mode.h index 06b432d67437..d2103c150627 100644 --- a/scene/gui/color_mode.h +++ b/scene/gui/color_mode.h @@ -55,7 +55,7 @@ class ColorMode { virtual void _value_changed() {} virtual void slider_draw(int p_which) = 0; - virtual bool apply_theme() const { return false; } + virtual ColorPicker::PickerShapeType get_shape_override() const { return ColorPicker::SHAPE_MAX; } ColorMode(ColorPicker *p_color_picker); @@ -126,7 +126,6 @@ class ColorModeRAW : public ColorMode { virtual Color get_color() const override; virtual void slider_draw(int p_which) override; - virtual bool apply_theme() const override; ColorModeRAW(ColorPicker *p_color_picker) : ColorMode(p_color_picker) {} diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index a27a4dee41e9..5d5d6cf84a97 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -295,8 +295,6 @@ void ColorPicker::_update_controls() { } alpha_label->set_text("A"); - slider_theme_modified = modes[current_mode]->apply_theme(); - if (edit_alpha) { alpha_value->show(); alpha_slider->show(); @@ -446,6 +444,8 @@ void ColorPicker::_slider_value_changed() { sliders[1]->set_value_no_signal(color.g / multiplier); sliders[2]->set_value_no_signal(color.b / multiplier); sliders[3]->set_value_no_signal(Math::log2(multiplier)); + // The color slightly changes because of slider step. + color = modes[current_mode]->get_color(); } // Set intensity spinbox prefix. values[3]->set_prefix(sliders[3]->get_value() < 0 ? "" : "+"); @@ -624,7 +624,8 @@ void ColorPicker::_reset_sliders_theme() { style_box_flat->set_content_margin(SIDE_TOP, 16 * theme_cache.base_scale); style_box_flat->set_bg_color(Color(0.2, 0.23, 0.31).lerp(Color(0, 0, 0, 1), 0.3).clamp()); - for (int i = 0; i < SLIDER_COUNT; i++) { + // Skip intensity slider. + for (int i = 0; i < SLIDER_COUNT - 1; i++) { sliders[i]->begin_bulk_theme_override(); sliders[i]->add_theme_icon_override("grabber", theme_cache.bar_arrow); sliders[i]->add_theme_icon_override("grabber_highlight", theme_cache.bar_arrow); @@ -1180,10 +1181,6 @@ void ColorPicker::set_color_mode(ColorModeType p_mode) { return; } - if (slider_theme_modified) { - _reset_sliders_theme(); - } - mode_popup->set_item_checked(current_mode, false); mode_popup->set_item_checked(p_mode, true); @@ -1224,22 +1221,22 @@ void ColorPicker::set_colorize_sliders(bool p_colorize_sliders) { if (colorize_sliders) { Ref style_box_empty(memnew(StyleBoxEmpty)); - if (!slider_theme_modified) { - for (int i = 0; i < SLIDER_COUNT; i++) { - sliders[i]->add_theme_style_override("slider", style_box_empty); - } + // Skip intensity slider. + for (int i = 0; i < SLIDER_COUNT - 1; i++) { + sliders[i]->add_theme_style_override("slider", style_box_empty); } + alpha_slider->add_theme_style_override("slider", style_box_empty); } else { Ref style_box_flat(memnew(StyleBoxFlat)); style_box_flat->set_content_margin(SIDE_TOP, 16 * theme_cache.base_scale); style_box_flat->set_bg_color(Color(0.2, 0.23, 0.31).lerp(Color(0, 0, 0, 1), 0.3).clamp()); - if (!slider_theme_modified) { - for (int i = 0; i < SLIDER_COUNT; i++) { - sliders[i]->add_theme_style_override("slider", style_box_flat); - } + // Skip intensity slider. + for (int i = 0; i < SLIDER_COUNT - 1; i++) { + sliders[i]->add_theme_style_override("slider", style_box_flat); } + alpha_slider->add_theme_style_override("slider", style_box_flat); } } @@ -2271,10 +2268,10 @@ ColorPicker::ColorPicker() { shape_popup->set_item_checked(current_shape, true); shape_popup->connect(SceneStringName(id_pressed), callable_mp(this, &ColorPicker::set_picker_shape)); - add_mode(new ColorModeRGB(this)); - add_mode(new ColorModeHSV(this)); - add_mode(new ColorModeRAW(this)); - add_mode(new ColorModeOKHSL(this)); + add_mode(memnew(ColorModeRGB(this))); + add_mode(memnew(ColorModeHSV(this))); + add_mode(memnew(ColorModeRAW(this))); + add_mode(memnew(ColorModeOKHSL(this))); mode_hbc = memnew(HBoxContainer); real_vbox->add_child(mode_hbc); @@ -2452,7 +2449,7 @@ ColorPicker::ColorPicker() { ColorPicker::~ColorPicker() { for (int i = 0; i < modes.size(); i++) { - delete modes[i]; + memdelete(modes[i]); } } diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 62ee4e5607c0..1166ad358ed4 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -129,8 +129,6 @@ class ColorPicker : public VBoxContainer { static const int MODE_BUTTON_COUNT = 3; const float WHEEL_RADIUS = 0.42; - bool slider_theme_modified = true; - Vector modes; Popup *picker_window = nullptr;