From c103f32ea3b19c3588d54dcef98e307f8b823f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 24 Mar 2017 17:39:16 +0100 Subject: [PATCH] Only assume HiDPI mode if DPI >= 192 and width > 2000 Also fix detection of single-column dock if width < 1200, it only worked with hidpi_mode=auto. --- editor/editor_node.cpp | 8 +++----- editor/project_manager.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 078bb95ec9a..72f2318f12e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4821,14 +4821,10 @@ EditorNode::EditorNode() { if (!EditorSettings::get_singleton()) EditorSettings::create(); - bool use_single_dock_column = false; { int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode"); if (dpi_mode == 0) { - editor_set_scale(OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x > 2000 ? 2.0 : 1.0); - - use_single_dock_column = OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x < 1200; - + editor_set_scale(OS::get_singleton()->get_screen_dpi(0) >= 192 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x > 2000 ? 2.0 : 1.0); } else if (dpi_mode == 1) { editor_set_scale(0.75); } else if (dpi_mode == 2) { @@ -5654,6 +5650,8 @@ EditorNode::EditorNode() { dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(import_dock); import_dock->set_name(TTR("Import")); + bool use_single_dock_column = (OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x < 1200); + node_dock = memnew(NodeDock); //node_dock->set_undoredo(&editor_data.get_undo_redo()); if (use_single_dock_column) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 7fa8e9bf84a..5278efb3c6a 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1178,7 +1178,7 @@ ProjectManager::ProjectManager() { { int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode"); if (dpi_mode == 0) { - editor_set_scale(OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x > 2000 ? 2.0 : 1.0); + editor_set_scale(OS::get_singleton()->get_screen_dpi(0) >= 192 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x > 2000 ? 2.0 : 1.0); } else if (dpi_mode == 1) { editor_set_scale(0.75); } else if (dpi_mode == 2) {