summaryrefslogtreecommitdiff
path: root/editor/localization_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/localization_editor.cpp')
-rw-r--r--editor/localization_editor.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index c31c3f4519..0325f4bd5c 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -42,8 +42,8 @@
void LocalizationEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
- translation_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_delete));
- translation_pot_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_pot_delete));
+ translation_list->connect("button_clicked", callable_mp(this, &LocalizationEditor::_translation_delete));
+ translation_pot_list->connect("button_clicked", callable_mp(this, &LocalizationEditor::_pot_delete));
List<String> tfn;
ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn);
@@ -93,7 +93,11 @@ void LocalizationEditor::_translation_file_open() {
translation_file_open->popup_file_dialog();
}
-void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p_button) {
+void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button) {
+ if (p_mouse_button != MouseButton::LEFT) {
+ return;
+ }
+
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
ERR_FAIL_COND(!ti);
@@ -239,11 +243,15 @@ void LocalizationEditor::_translation_res_option_changed() {
updating_translations = false;
}
-void LocalizationEditor::_translation_res_delete(Object *p_item, int p_column, int p_button) {
+void LocalizationEditor::_translation_res_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button) {
if (updating_translations) {
return;
}
+ if (p_mouse_button != MouseButton::LEFT) {
+ return;
+ }
+
if (!ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) {
return;
}
@@ -267,11 +275,15 @@ void LocalizationEditor::_translation_res_delete(Object *p_item, int p_column, i
undo_redo->commit_action();
}
-void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_column, int p_button) {
+void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button) {
if (updating_translations) {
return;
}
+ if (p_mouse_button != MouseButton::LEFT) {
+ return;
+ }
+
if (!ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) {
return;
}
@@ -320,7 +332,11 @@ void LocalizationEditor::_pot_add(const PackedStringArray &p_paths) {
undo_redo->commit_action();
}
-void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button) {
+void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button) {
+ if (p_mouse_button != MouseButton::LEFT) {
+ return;
+ }
+
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
ERR_FAIL_COND(!ti);
@@ -536,7 +552,7 @@ LocalizationEditor::LocalizationEditor() {
translation_remap = memnew(Tree);
translation_remap->set_v_size_flags(Control::SIZE_EXPAND_FILL);
translation_remap->connect("cell_selected", callable_mp(this, &LocalizationEditor::_translation_res_select));
- translation_remap->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_res_delete));
+ translation_remap->connect("button_clicked", callable_mp(this, &LocalizationEditor::_translation_res_delete));
tmc->add_child(translation_remap);
translation_res_file_open_dialog = memnew(EditorFileDialog);
@@ -572,7 +588,7 @@ LocalizationEditor::LocalizationEditor() {
translation_remap_options->set_column_clip_content(1, false);
translation_remap_options->set_column_custom_minimum_width(1, 250);
translation_remap_options->connect("item_edited", callable_mp(this, &LocalizationEditor::_translation_res_option_changed));
- translation_remap_options->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_res_option_delete));
+ translation_remap_options->connect("button_clicked", callable_mp(this, &LocalizationEditor::_translation_res_option_delete));
translation_remap_options->connect("custom_popup_edited", callable_mp(this, &LocalizationEditor::_translation_res_option_popup));
tmc->add_child(translation_remap_options);