Skip to content

Commit

Permalink
Restore cursor change when using Color Picker
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickeon committed Jul 1, 2024
1 parent 4ab8fb8 commit 070007d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scene/gui/color_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,7 @@ void ColorPicker::_pick_button_pressed() {
add_child(picker_window, false, INTERNAL_MODE_FRONT);
}
picker_window->popup();
Input::get_singleton()->set_default_cursor_shape(Input::CURSOR_CROSS);
}

void ColorPicker::_pick_finished() {
Expand All @@ -1529,6 +1530,7 @@ void ColorPicker::_pick_finished() {
is_picking_color = false;
set_process_internal(false);
picker_window->hide();
Input::get_singleton()->set_default_cursor_shape(Input::CURSOR_ARROW);
}

void ColorPicker::_pick_button_pressed_legacy() {
Expand All @@ -1545,7 +1547,6 @@ void ColorPicker::_pick_button_pressed_legacy() {
picker_texture_rect = memnew(TextureRect);
picker_texture_rect->set_anchors_preset(Control::PRESET_FULL_RECT);
picker_window->add_child(picker_texture_rect);
picker_texture_rect->set_default_cursor_shape(CURSOR_POINTING_HAND);
picker_texture_rect->connect(SceneStringName(gui_input), callable_mp(this, &ColorPicker::_picker_texture_input));

picker_preview = memnew(Panel);
Expand Down Expand Up @@ -1604,6 +1605,8 @@ void ColorPicker::_pick_button_pressed_legacy() {
picker_window->set_size(screen_rect.size);
picker_preview->set_size(screen_rect.size / 10.0); // 10% of size in each axis.
picker_window->popup();

Input::get_singleton()->set_default_cursor_shape(Input::CURSOR_CROSS);
}

void ColorPicker::_picker_texture_input(const Ref<InputEvent> &p_event) {
Expand Down

0 comments on commit 070007d

Please sign in to comment.