From 65e2230f6e75df07441eda3038066f901ff143d9 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 12 Jan 2020 15:24:15 +0800 Subject: [PATCH] Fixes min size of various editor plugins on HiDPI * AnimationTree * AudioStream * ResourcePreloader * ShaderEditor * VisualShaderEditor --- editor/plugins/animation_tree_editor_plugin.cpp | 3 ++- editor/plugins/audio_stream_editor_plugin.cpp | 3 ++- editor/plugins/resource_preloader_editor_plugin.cpp | 3 ++- editor/plugins/shader_editor_plugin.cpp | 3 ++- editor/plugins/visual_shader_editor_plugin.cpp | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index a0b58b8f7e4..8dc7e4638db 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -39,6 +39,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" @@ -284,7 +285,7 @@ AnimationTreeEditorPlugin::AnimationTreeEditorPlugin(EditorNode *p_node) { editor = p_node; anim_tree_editor = memnew(AnimationTreeEditor); - anim_tree_editor->set_custom_minimum_size(Size2(0, 300)); + anim_tree_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); button = editor->add_bottom_panel_item(TTR("AnimationTree"), anim_tree_editor); button->hide(); diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index b6e5d48a83e..60cb2ff54d9 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "core/io/resource_loader.h" #include "core/project_settings.h" #include "editor/audio_stream_preview.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" void AudioStreamEditor::_notification(int p_what) { @@ -208,7 +209,7 @@ void AudioStreamEditor::_bind_methods() { AudioStreamEditor::AudioStreamEditor() { - set_custom_minimum_size(Size2(1, 100)); + set_custom_minimum_size(Size2(1, 100) * EDSCALE); _current = 0; _dragging = false; diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index d423be7d247..fb04f50827f 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -32,6 +32,7 @@ #include "core/io/resource_loader.h" #include "core/project_settings.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" void ResourcePreloaderEditor::_gui_input(Ref p_event) { @@ -438,7 +439,7 @@ ResourcePreloaderEditorPlugin::ResourcePreloaderEditorPlugin(EditorNode *p_node) editor = p_node; preloader_editor = memnew(ResourcePreloaderEditor); - preloader_editor->set_custom_minimum_size(Size2(0, 250)); + preloader_editor->set_custom_minimum_size(Size2(0, 250) * EDSCALE); button = editor->add_bottom_panel_item(TTR("ResourcePreloader"), preloader_editor); button->hide(); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 7e55415134d..c0b5053f9d9 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -35,6 +35,7 @@ #include "core/os/keyboard.h" #include "core/os/os.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/property_editor.h" #include "servers/visual/shader_types.h" @@ -756,7 +757,7 @@ ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) { editor = p_node; shader_editor = memnew(ShaderEditor(p_node)); - shader_editor->set_custom_minimum_size(Size2(0, 300)); + shader_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); button = editor->add_bottom_panel_item(TTR("Shader"), shader_editor); button->hide(); } diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 972e4f2172d..e334d4b0939 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -2852,7 +2852,7 @@ VisualShaderEditorPlugin::VisualShaderEditorPlugin(EditorNode *p_node) { editor = p_node; visual_shader_editor = memnew(VisualShaderEditor); - visual_shader_editor->set_custom_minimum_size(Size2(0, 300)); + visual_shader_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); button = editor->add_bottom_panel_item(TTR("VisualShader"), visual_shader_editor); button->hide();