You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use NOTIFICATION_MOUSE_EXIT instead of a signal for a few editor plugins
This commit is contained in:
@@ -51,12 +51,6 @@ CurveEdit::CurveEdit() {
|
||||
set_clip_contents(true);
|
||||
}
|
||||
|
||||
void CurveEdit::_on_mouse_exited() {
|
||||
hovered_index = -1;
|
||||
hovered_tangent_index = TANGENT_NONE;
|
||||
queue_redraw();
|
||||
}
|
||||
|
||||
void CurveEdit::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_selected_index", "index"), &CurveEdit::set_selected_index);
|
||||
}
|
||||
@@ -116,8 +110,12 @@ Size2 CurveEdit::get_minimum_size() const {
|
||||
|
||||
void CurveEdit::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("mouse_exited", callable_mp(this, &CurveEdit::_on_mouse_exited));
|
||||
case NOTIFICATION_MOUSE_EXIT: {
|
||||
if (hovered_index != -1 || hovered_tangent_index != TANGENT_NONE) {
|
||||
hovered_index = -1;
|
||||
hovered_tangent_index = TANGENT_NONE;
|
||||
queue_redraw();
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
|
||||
Reference in New Issue
Block a user