From e623a50be623e3e714e28c2346d8130eb2f0e471 Mon Sep 17 00:00:00 2001 From: George Marques Date: Sun, 29 May 2016 18:37:49 -0300 Subject: Remove translatable strings in comments --- .../editor/io_plugins/editor_scene_import_plugin.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tools/editor') diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 3effb1d0aa..a4bbada931 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -1235,18 +1235,18 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce /* this_import = memnew( OptionButton ); - this_import->add_item(TTR("Overwrite Existing Scene")); - this_import->add_item(TTR("Overwrite Existing, Keep Materials")); - this_import->add_item(TTR("Keep Existing, Merge with New")); - this_import->add_item(TTR("Keep Existing, Ignore New")); - vbc->add_margin_child(TTR("This Time:"),this_import); + this_import->add_item("Overwrite Existing Scene"); + this_import->add_item("Overwrite Existing, Keep Materials"); + this_import->add_item("Keep Existing, Merge with New"); + this_import->add_item("Keep Existing, Ignore New"); + vbc->add_margin_child("This Time:",this_import); next_import = memnew( OptionButton ); - next_import->add_item(TTR("Overwrite Existing Scene")); - next_import->add_item(TTR("Overwrite Existing, Keep Materials")); - next_import->add_item(TTR("Keep Existing, Merge with New")); - next_import->add_item(TTR("Keep Existing, Ignore New")); - vbc->add_margin_child(TTR("Next Time:"),next_import); + next_import->add_item("Overwrite Existing Scene"); + next_import->add_item("Overwrite Existing, Keep Materials"); + next_import->add_item("Keep Existing, Merge with New"); + next_import->add_item("Keep Existing, Ignore New"); + vbc->add_margin_child("Next Time:",next_import); */ set_hide_on_ok(false); -- cgit v1.2.3 From e6e878e139eb48f587bf4f6e111b08ebf0121749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 30 May 2016 00:41:42 +0200 Subject: Icon: Remove more grey capsules behind official logo --- tools/editor/icons/icon_godot.png | Bin 671 -> 754 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'tools/editor') diff --git a/tools/editor/icons/icon_godot.png b/tools/editor/icons/icon_godot.png index e80820fc10..ff1370ee0f 100644 Binary files a/tools/editor/icons/icon_godot.png and b/tools/editor/icons/icon_godot.png differ -- cgit v1.2.3 From 7dd0b5857a92629c0e0c9fb06f6e054052cc57a7 Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Sun, 29 May 2016 21:30:11 -0500 Subject: Added first batch of svg icons --- tools/editor/icons/source/icon_animated_sprite.svg | 93 ++++++++++++ .../icons/source/icon_animated_sprite_3d.svg | 93 ++++++++++++ .../editor/icons/source/icon_animation_player.svg | 77 ++++++++++ .../icons/source/icon_animation_tree_player.svg | 77 ++++++++++ tools/editor/icons/source/icon_control.svg | 93 ++++++++++++ tools/editor/icons/source/icon_dependency_ok.svg | 83 +++++++++++ .../editor/icons/source/icon_dependency_ok_hl.svg | 83 +++++++++++ tools/editor/icons/source/icon_edit_pivot.svg | 98 +++++++++++++ tools/editor/icons/source/icon_file_list.svg | 114 +++++++++++++++ tools/editor/icons/source/icon_folder.svg | 85 +++++++++++ tools/editor/icons/source/icon_history.svg | 109 ++++++++++++++ tools/editor/icons/source/icon_list_select.svg | 93 ++++++++++++ tools/editor/icons/source/icon_lock.svg | 102 +++++++++++++ tools/editor/icons/source/icon_new.svg | 77 ++++++++++ tools/editor/icons/source/icon_node_2d.svg | 93 ++++++++++++ tools/editor/icons/source/icon_packed_scene.svg | 114 +++++++++++++++ tools/editor/icons/source/icon_progress.svg | 112 +++++++++++++++ tools/editor/icons/source/icon_save.svg | 78 ++++++++++ tools/editor/icons/source/icon_spatial.svg | 93 ++++++++++++ tools/editor/icons/source/icon_sprite.svg | 94 ++++++++++++ tools/editor/icons/source/icon_sprite_3d.svg | 94 ++++++++++++ tools/editor/icons/source/icon_tool_move.svg | 157 +++++++++++++++++++++ tools/editor/icons/source/icon_tool_pan.svg | 108 ++++++++++++++ tools/editor/icons/source/icon_tool_rotate.svg | 94 ++++++++++++ tools/editor/icons/source/icon_tool_scale.svg | 77 ++++++++++ tools/editor/icons/source/icon_tool_select.svg | 78 ++++++++++ tools/editor/icons/source/icon_unlock.svg | 95 +++++++++++++ tools/editor/icons/source/icon_wait_preview_1.svg | 112 +++++++++++++++ tools/editor/icons/source/icon_zoom.svg | 77 ++++++++++ tools/editor/icons/source/node.svg | 93 ++++++++++++ 30 files changed, 2846 insertions(+) create mode 100644 tools/editor/icons/source/icon_animated_sprite.svg create mode 100644 tools/editor/icons/source/icon_animated_sprite_3d.svg create mode 100644 tools/editor/icons/source/icon_animation_player.svg create mode 100644 tools/editor/icons/source/icon_animation_tree_player.svg create mode 100644 tools/editor/icons/source/icon_control.svg create mode 100644 tools/editor/icons/source/icon_dependency_ok.svg create mode 100644 tools/editor/icons/source/icon_dependency_ok_hl.svg create mode 100644 tools/editor/icons/source/icon_edit_pivot.svg create mode 100644 tools/editor/icons/source/icon_file_list.svg create mode 100644 tools/editor/icons/source/icon_folder.svg create mode 100644 tools/editor/icons/source/icon_history.svg create mode 100644 tools/editor/icons/source/icon_list_select.svg create mode 100644 tools/editor/icons/source/icon_lock.svg create mode 100644 tools/editor/icons/source/icon_new.svg create mode 100644 tools/editor/icons/source/icon_node_2d.svg create mode 100644 tools/editor/icons/source/icon_packed_scene.svg create mode 100644 tools/editor/icons/source/icon_progress.svg create mode 100644 tools/editor/icons/source/icon_save.svg create mode 100644 tools/editor/icons/source/icon_spatial.svg create mode 100644 tools/editor/icons/source/icon_sprite.svg create mode 100644 tools/editor/icons/source/icon_sprite_3d.svg create mode 100644 tools/editor/icons/source/icon_tool_move.svg create mode 100644 tools/editor/icons/source/icon_tool_pan.svg create mode 100644 tools/editor/icons/source/icon_tool_rotate.svg create mode 100644 tools/editor/icons/source/icon_tool_scale.svg create mode 100644 tools/editor/icons/source/icon_tool_select.svg create mode 100644 tools/editor/icons/source/icon_unlock.svg create mode 100644 tools/editor/icons/source/icon_wait_preview_1.svg create mode 100644 tools/editor/icons/source/icon_zoom.svg create mode 100644 tools/editor/icons/source/node.svg (limited to 'tools/editor') diff --git a/tools/editor/icons/source/icon_animated_sprite.svg b/tools/editor/icons/source/icon_animated_sprite.svg new file mode 100644 index 0000000000..e123d09332 --- /dev/null +++ b/tools/editor/icons/source/icon_animated_sprite.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_animated_sprite_3d.svg b/tools/editor/icons/source/icon_animated_sprite_3d.svg new file mode 100644 index 0000000000..eddf6121ba --- /dev/null +++ b/tools/editor/icons/source/icon_animated_sprite_3d.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_animation_player.svg b/tools/editor/icons/source/icon_animation_player.svg new file mode 100644 index 0000000000..eb1be35b5a --- /dev/null +++ b/tools/editor/icons/source/icon_animation_player.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_animation_tree_player.svg b/tools/editor/icons/source/icon_animation_tree_player.svg new file mode 100644 index 0000000000..aeccbb8cdf --- /dev/null +++ b/tools/editor/icons/source/icon_animation_tree_player.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_control.svg b/tools/editor/icons/source/icon_control.svg new file mode 100644 index 0000000000..0b8e043884 --- /dev/null +++ b/tools/editor/icons/source/icon_control.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_dependency_ok.svg b/tools/editor/icons/source/icon_dependency_ok.svg new file mode 100644 index 0000000000..757d085d23 --- /dev/null +++ b/tools/editor/icons/source/icon_dependency_ok.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_dependency_ok_hl.svg b/tools/editor/icons/source/icon_dependency_ok_hl.svg new file mode 100644 index 0000000000..030239146a --- /dev/null +++ b/tools/editor/icons/source/icon_dependency_ok_hl.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_edit_pivot.svg b/tools/editor/icons/source/icon_edit_pivot.svg new file mode 100644 index 0000000000..74c874d9de --- /dev/null +++ b/tools/editor/icons/source/icon_edit_pivot.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_file_list.svg b/tools/editor/icons/source/icon_file_list.svg new file mode 100644 index 0000000000..a556ddfc09 --- /dev/null +++ b/tools/editor/icons/source/icon_file_list.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_folder.svg b/tools/editor/icons/source/icon_folder.svg new file mode 100644 index 0000000000..651849b1c3 --- /dev/null +++ b/tools/editor/icons/source/icon_folder.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_history.svg b/tools/editor/icons/source/icon_history.svg new file mode 100644 index 0000000000..d32e5d4c73 --- /dev/null +++ b/tools/editor/icons/source/icon_history.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_list_select.svg b/tools/editor/icons/source/icon_list_select.svg new file mode 100644 index 0000000000..7ca55e27a6 --- /dev/null +++ b/tools/editor/icons/source/icon_list_select.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_lock.svg b/tools/editor/icons/source/icon_lock.svg new file mode 100644 index 0000000000..53daf88b39 --- /dev/null +++ b/tools/editor/icons/source/icon_lock.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_new.svg b/tools/editor/icons/source/icon_new.svg new file mode 100644 index 0000000000..690d92764e --- /dev/null +++ b/tools/editor/icons/source/icon_new.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_node_2d.svg b/tools/editor/icons/source/icon_node_2d.svg new file mode 100644 index 0000000000..49873a39fd --- /dev/null +++ b/tools/editor/icons/source/icon_node_2d.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_packed_scene.svg b/tools/editor/icons/source/icon_packed_scene.svg new file mode 100644 index 0000000000..ce8e6a981a --- /dev/null +++ b/tools/editor/icons/source/icon_packed_scene.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_progress.svg b/tools/editor/icons/source/icon_progress.svg new file mode 100644 index 0000000000..6ba00f3b7f --- /dev/null +++ b/tools/editor/icons/source/icon_progress.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_save.svg b/tools/editor/icons/source/icon_save.svg new file mode 100644 index 0000000000..9a82cba0b5 --- /dev/null +++ b/tools/editor/icons/source/icon_save.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_spatial.svg b/tools/editor/icons/source/icon_spatial.svg new file mode 100644 index 0000000000..4c997f56dd --- /dev/null +++ b/tools/editor/icons/source/icon_spatial.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_sprite.svg b/tools/editor/icons/source/icon_sprite.svg new file mode 100644 index 0000000000..40cc4c3e7b --- /dev/null +++ b/tools/editor/icons/source/icon_sprite.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_sprite_3d.svg b/tools/editor/icons/source/icon_sprite_3d.svg new file mode 100644 index 0000000000..8b24ebb107 --- /dev/null +++ b/tools/editor/icons/source/icon_sprite_3d.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_tool_move.svg b/tools/editor/icons/source/icon_tool_move.svg new file mode 100644 index 0000000000..0bb13e9c5a --- /dev/null +++ b/tools/editor/icons/source/icon_tool_move.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_tool_pan.svg b/tools/editor/icons/source/icon_tool_pan.svg new file mode 100644 index 0000000000..e50beb1fb8 --- /dev/null +++ b/tools/editor/icons/source/icon_tool_pan.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_tool_rotate.svg b/tools/editor/icons/source/icon_tool_rotate.svg new file mode 100644 index 0000000000..9c4bd862d0 --- /dev/null +++ b/tools/editor/icons/source/icon_tool_rotate.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_tool_scale.svg b/tools/editor/icons/source/icon_tool_scale.svg new file mode 100644 index 0000000000..0d4dcfbbfe --- /dev/null +++ b/tools/editor/icons/source/icon_tool_scale.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_tool_select.svg b/tools/editor/icons/source/icon_tool_select.svg new file mode 100644 index 0000000000..e92364eddd --- /dev/null +++ b/tools/editor/icons/source/icon_tool_select.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/icon_unlock.svg b/tools/editor/icons/source/icon_unlock.svg new file mode 100644 index 0000000000..5bf2359d96 --- /dev/null +++ b/tools/editor/icons/source/icon_unlock.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_wait_preview_1.svg b/tools/editor/icons/source/icon_wait_preview_1.svg new file mode 100644 index 0000000000..89f30355eb --- /dev/null +++ b/tools/editor/icons/source/icon_wait_preview_1.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/tools/editor/icons/source/icon_zoom.svg b/tools/editor/icons/source/icon_zoom.svg new file mode 100644 index 0000000000..0ab5bc69c2 --- /dev/null +++ b/tools/editor/icons/source/icon_zoom.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tools/editor/icons/source/node.svg b/tools/editor/icons/source/node.svg new file mode 100644 index 0000000000..22d9f9c2d9 --- /dev/null +++ b/tools/editor/icons/source/node.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + -- cgit v1.2.3 From 9b1f8230ec435d9289b53afa8da02367daf8b5af Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 30 May 2016 00:28:29 -0300 Subject: -Some fixes to OSX retina scaling for window functions -Implemented HiDPI detection and support for Godot Editor! --- tools/editor/editor_file_dialog.cpp | 9 +++++---- tools/editor/editor_fonts.cpp | 22 +++++++++++++++++----- tools/editor/editor_node.cpp | 19 ++++++++++--------- tools/editor/editor_node.h | 1 + tools/editor/editor_resource_preview.cpp | 4 +++- tools/editor/editor_scale.cpp | 7 +++++++ tools/editor/editor_scale.h | 8 ++++++++ tools/editor/icons/SCsub | 3 ++- .../io_plugins/editor_font_import_plugin.cpp | 10 +++++----- .../io_plugins/editor_mesh_import_plugin.cpp | 2 +- .../io_plugins/editor_sample_import_plugin.cpp | 6 +++--- .../io_plugins/editor_scene_import_plugin.cpp | 14 +++++++------- .../io_plugins/editor_texture_import_plugin.cpp | 14 +++++++------- .../editor_translation_import_plugin.cpp | 12 ++++++------ tools/editor/plugins/editor_preview_plugins.cpp | 9 +++++++-- tools/editor/plugins/material_editor_plugin.cpp | 2 +- tools/editor/plugins/mesh_editor_plugin.cpp | 2 +- tools/editor/plugins/sample_editor_plugin.cpp | 2 +- tools/editor/plugins/script_editor_plugin.cpp | 4 ++-- tools/editor/progress_dialog.cpp | 6 +++--- tools/editor/property_editor.cpp | 12 ++++++------ tools/editor/scenes_dock.cpp | 4 +++- tools/editor/script_editor_debugger.cpp | 2 +- 23 files changed, 107 insertions(+), 67 deletions(-) create mode 100644 tools/editor/editor_scale.cpp create mode 100644 tools/editor/editor_scale.h (limited to 'tools/editor') diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index b9d4949018..185ec17459 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -7,7 +7,7 @@ #include "editor_settings.h" #include "scene/gui/margin_container.h" #include "os/file_access.h" - +#include "editor_scale.h" EditorFileDialog::GetIconFunc EditorFileDialog::get_icon_func=NULL; EditorFileDialog::GetIconFunc EditorFileDialog::get_large_icon_func=NULL; @@ -347,7 +347,7 @@ void EditorFileDialog::_action_pressed() { if (!valid) { - exterr->popup_centered_minsize(Size2(250,80)); + exterr->popup_centered_minsize(Size2(250,80)*EDSCALE); return; } @@ -431,6 +431,7 @@ void EditorFileDialog::update_file_list() { int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + thumbnail_size*=EDSCALE; Ref folder_thumbnail; Ref file_thumbnail; @@ -840,7 +841,7 @@ void EditorFileDialog::_make_dir_confirm() { _push_history(); } else { - mkdirerr->popup_centered_minsize(Size2(250,50)); + mkdirerr->popup_centered_minsize(Size2(250,50)*EDSCALE); } makedirname->set_text(""); // reset label } @@ -848,7 +849,7 @@ void EditorFileDialog::_make_dir_confirm() { void EditorFileDialog::_make_dir() { - makedialog->popup_centered_minsize(Size2(250,80)); + makedialog->popup_centered_minsize(Size2(250,80)*EDSCALE); makedirname->grab_focus(); } diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp index e04dce294a..da947748a4 100644 --- a/tools/editor/editor_fonts.cpp +++ b/tools/editor/editor_fonts.cpp @@ -33,6 +33,8 @@ #include "builtin_fonts.h" #include "editor_settings.h" #include "scene/resources/dynamic_font.h" +#include "editor_scale.h" +#include "scene/resources/default_theme/default_theme.h" static Ref make_font(int p_height,int p_ascent, int p_valign, int p_charcount, const int *p_chars,const Ref &p_texture) { @@ -67,6 +69,7 @@ static Ref make_font(int p_height,int p_ascent, int p_valign, int p_ void editor_register_fonts(Ref p_theme) { + Ref dfd; dfd.instance(); dfd->set_font_ptr(_font_droid_sans,_font_droid_sans_size); @@ -79,7 +82,7 @@ void editor_register_fonts(Ref p_theme) { Ref df; df.instance(); - df->set_size(int(EditorSettings::get_singleton()->get("global/font_size"))); + df->set_size(int(EditorSettings::get_singleton()->get("global/font_size"))*EDSCALE); df->set_font_data(dfd); @@ -91,12 +94,12 @@ void editor_register_fonts(Ref p_theme) { Ref df_title; df_title.instance(); - df_title->set_size(int(EDITOR_DEF("help/help_title_font_size",18))); + df_title->set_size(int(EDITOR_DEF("help/help_title_font_size",18))*EDSCALE); df_title->set_font_data(dfd); Ref df_doc; df_doc.instance(); - df_doc->set_size(int(EDITOR_DEF("help/help_font_size",16))); + df_doc->set_size(int(EDITOR_DEF("help/help_font_size",16))*EDSCALE); df_doc->set_font_data(dfd); p_theme->set_font("doc","EditorFonts",df_doc); @@ -105,16 +108,25 @@ void editor_register_fonts(Ref p_theme) { Ref df_code; df_code.instance(); - df_code->set_size(int(EditorSettings::get_singleton()->get("global/source_font_size"))); + df_code->set_size(int(EditorSettings::get_singleton()->get("global/source_font_size"))*EDSCALE); df_code->set_font_data(dfmono); p_theme->set_font("source","EditorFonts",df_code); Ref df_doc_code; df_doc_code.instance(); - df_doc_code->set_size(int(EDITOR_DEF("help/help_source_font_size",14))); + df_doc_code->set_size(int(EDITOR_DEF("help/help_source_font_size",14))*EDSCALE); df_doc_code->set_font_data(dfmono); + p_theme->set_font("doc_source","EditorFonts",df_doc_code); + if (editor_is_hidpi()) { + //replace default theme + Ref di; + Ref ds; + fill_default_theme(p_theme,df,df_doc,di,ds,true); + + } + } diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 8313e38f02..1a050e5981 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -984,6 +984,7 @@ void EditorNode::_save_scene_with_preview(String p_file) { save.step(TTR("Creating Thumbnail"),3); Image img = VS::get_singleton()->viewport_get_screen_capture(viewport); int preview_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");; + preview_size*=EDSCALE; int width,height; if (img.get_width() > preview_size && img.get_width() >= img.get_height()) { @@ -2389,7 +2390,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { confirmation->get_ok()->set_text(TTR("Quit")); //confirmation->get_cancel()->show(); confirmation->set_text(TTR("Exit the editor?")); - confirmation->popup_centered(Size2(180,70)); + confirmation->popup_centered(Size2(180,70)*EDSCALE); break; } @@ -2826,7 +2827,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case SETTINGS_ABOUT: { - about->popup_centered(Size2(500,130)); + about->popup_centered(Size2(500,130)*EDSCALE); } break; case SOURCES_REIMPORT: { @@ -5381,7 +5382,7 @@ EditorNode::EditorNode() { dock_vb->add_child(dock_hb); dock_select = memnew( Control ); - dock_select->set_custom_minimum_size(Size2(128,64)); + dock_select->set_custom_minimum_size(Size2(128,64)*EDSCALE); dock_select->connect("input_event",this,"_dock_select_input"); dock_select->connect("draw",this,"_dock_select_draw"); dock_select->connect("mouse_exit",this,"_dock_popup_exit"); @@ -5396,7 +5397,7 @@ EditorNode::EditorNode() { //dock_select_popoup->set_(Size2(20,20)); for(int i=0;iset_custom_minimum_size(Size2(230,220)); + dock_slot[i]->set_custom_minimum_size(Size2(230,220)*EDSCALE); dock_slot[i]->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_slot[i]->set_popup(dock_select_popoup); dock_slot[i]->connect("pre_popup_pressed",this,"_dock_pre_popup",varray(i)); @@ -5436,7 +5437,7 @@ EditorNode::EditorNode() { srt->add_child(scene_tabs); scene_root_parent = memnew( PanelContainer ); - scene_root_parent->set_custom_minimum_size(Size2(0,80)); + scene_root_parent->set_custom_minimum_size(Size2(0,80)*EDSCALE); //Ref sp = scene_root_parent->get_stylebox("panel","TabContainer"); @@ -5553,7 +5554,7 @@ EditorNode::EditorNode() { { Control *sp = memnew( Control ); - sp->set_custom_minimum_size(Size2(30,0)); + sp->set_custom_minimum_size(Size2(30,0)*EDSCALE); menu_hb->add_child(sp); } @@ -5742,7 +5743,7 @@ EditorNode::EditorNode() { { Control *sp = memnew( Control ); - sp->set_custom_minimum_size(Size2(30,0)); + sp->set_custom_minimum_size(Size2(30,0)*EDSCALE); menu_hb->add_child(sp); } @@ -5764,7 +5765,7 @@ EditorNode::EditorNode() { { Control *sp = memnew( Control ); - sp->set_custom_minimum_size(Size2(30,0)); + sp->set_custom_minimum_size(Size2(30,0)*EDSCALE); menu_hb->add_child(sp); } @@ -5800,7 +5801,7 @@ EditorNode::EditorNode() { layout_dialog = memnew( EditorNameDialog ); gui_base->add_child(layout_dialog); layout_dialog->set_hide_on_ok(false); - layout_dialog->set_size(Size2(175, 70)); + layout_dialog->set_size(Size2(175, 70)*EDSCALE); layout_dialog->connect("name_confirmed", this,"_dialog_action"); sources_button = memnew( ToolButton ); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index db589bb1c3..e580931df3 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -85,6 +85,7 @@ #include "progress_dialog.h" +#include "editor_scale.h" /** @author Juan Linietsky */ diff --git a/tools/editor/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp index d31cf9e0fd..13b424c231 100644 --- a/tools/editor/editor_resource_preview.cpp +++ b/tools/editor/editor_resource_preview.cpp @@ -4,7 +4,7 @@ #include "io/resource_loader.h" #include "io/resource_saver.h" #include "globals.h" - +#include "editor_scale.h" Ref EditorResourcePreviewGenerator::generate_from_path(const String& p_path) { @@ -91,6 +91,7 @@ Ref EditorResourcePreview::_generate_preview(const QueueItem& p_item,co if (generated.is_valid()) { //print_line("was generated"); int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + thumbnail_size*=EDSCALE; //wow it generated a preview... save cache ResourceSaver::save(cache_base+".png",generated); FileAccess *f=FileAccess::open(cache_base+".txt",FileAccess::WRITE); @@ -132,6 +133,7 @@ void EditorResourcePreview::_thread() { uint64_t modtime = FileAccess::get_modified_time(item.path); int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + thumbnail_size*=EDSCALE; if (cache.has(item.path)) { //already has it because someone loaded it, just let it know it's ready diff --git a/tools/editor/editor_scale.cpp b/tools/editor/editor_scale.cpp new file mode 100644 index 0000000000..ecb1e1816f --- /dev/null +++ b/tools/editor/editor_scale.cpp @@ -0,0 +1,7 @@ +#include "editor_scale.h" +#include "os/os.h" + +bool editor_is_hidpi() { + + return OS::get_singleton()->get_screen_dpi(0) > 150; +} diff --git a/tools/editor/editor_scale.h b/tools/editor/editor_scale.h new file mode 100644 index 0000000000..0f0e90595c --- /dev/null +++ b/tools/editor/editor_scale.h @@ -0,0 +1,8 @@ +#ifndef EDITOR_SCALE_H +#define EDITOR_SCALE_H + + +bool editor_is_hidpi(); + +#define EDSCALE (editor_is_hidpi() ? 2 : 1) +#endif // EDITOR_SCALE_H diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index 14d2be66f6..f3216b092d 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -11,6 +11,7 @@ def make_editor_icons_action(target, source, env): s = cStringIO.StringIO() s.write("#include \"editor_icons.h\"\n\n") + s.write("#include \"editor_scale.h\"\n\n") s.write("#include \"scene/resources/theme.h\"\n\n") for x in pixmaps: @@ -36,7 +37,7 @@ def make_editor_icons_action(target, source, env): s.write("static Ref make_icon(const uint8_t* p_png) {\n") s.write("\tRef texture( memnew( ImageTexture ) );\n") s.write("\tImage img(p_png);\n") - #s.write("\timg.expand_x2_hq2x();\n") + s.write("\tif (editor_is_hidpi()) img.expand_x2_hq2x();\n") s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n") s.write("\treturn texture;\n") s.write("}\n\n") diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index f4d6af7e10..d5e6e3077e 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -510,13 +510,13 @@ class EditorFontImportDialog : public ConfirmationDialog { if (source->get_line_edit()->get_text()=="") { error_dialog->set_text(TTR("No source font file!")); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered(Size2(200,100)*EDSCALE); return; } if (dest->get_line_edit()->get_text()=="") { error_dialog->set_text(TTR("No target font resource!")); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered(Size2(200,100)*EDSCALE); return; } @@ -528,7 +528,7 @@ class EditorFontImportDialog : public ConfirmationDialog { if (rimd.is_null()) { error_dialog->set_text(TTR("Can't load/process source font.")); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered(Size2(200,100)*EDSCALE); return; } @@ -536,7 +536,7 @@ class EditorFontImportDialog : public ConfirmationDialog { if (err!=OK) { error_dialog->set_text(TTR("Couldn't save font.")); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered(Size2(200,100)*EDSCALE); return; } @@ -573,7 +573,7 @@ public: void popup_import(const String& p_path) { - popup_centered(Size2(600,500)); + popup_centered(Size2(600,500)*EDSCALE); if (p_path!="") { diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index 45da42969c..c20515f0f3 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -173,7 +173,7 @@ public: void popup_import(const String& p_path) { - popup_centered(Size2(400,400)); + popup_centered(Size2(400,400)*EDSCALE); if (p_path!="") { diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index 120bdc6f44..ac0795f522 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -221,7 +221,7 @@ public: void popup_import(const String& p_path) { - popup_centered(Size2(400,400)); + popup_centered(Size2(400,400)*EDSCALE); if (p_path!="") { Ref rimd = ResourceLoader::load_import_metadata(p_path); @@ -252,7 +252,7 @@ public: if (samples.size()==0) { error_dialog->set_text(TTR("No samples to import!")); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered(Size2(200,100)*EDSCALE); } if (save_path->get_text().strip_edges()=="") { @@ -293,7 +293,7 @@ public: String dst = save_path->get_text(); if (dst=="") { error_dialog->set_text(TTR("Save path is empty!")); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered(Size2(200,100)*EDSCALE); } dst = dst.plus_file(samples[i].get_file().basename()+".smp"); diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 3effb1d0aa..41dfb748fc 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -674,7 +674,7 @@ void EditorSceneImportDialog::_open_and_import() { if (unsaved) { - confirm_open->popup_centered_minsize(Size2(300,80)); + confirm_open->popup_centered_minsize(Size2(300,80)*EDSCALE); } else { _import(true); } @@ -735,7 +735,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) { Ref