From bfe67a3b87ada532d27df015141af8eb6091ef89 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 13 Sep 2016 11:20:09 -0300 Subject: Make Godot detect if the screen is too small (<1200 pixels wide), and use single dock column like in 1.0 if that's the case. --- tools/editor/editor_node.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'tools/editor/editor_node.cpp') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 65cc383a00..dd84b30add 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -5366,10 +5366,15 @@ EditorNode::EditorNode() { // load settings if (!EditorSettings::get_singleton()) EditorSettings::create(); + + bool use_single_dock_column = false; { int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode"); if (dpi_mode==0) { - editor_set_scale( OS::get_singleton()->get_screen_dpi(0) > 150 ? 2.0 : 1.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; + } else if (dpi_mode==1) { editor_set_scale(0.75); } else if (dpi_mode==2) { @@ -5382,7 +5387,6 @@ EditorNode::EditorNode() { } - ResourceLoader::set_abort_on_missing_resources(false); FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); @@ -6201,12 +6205,24 @@ EditorNode::EditorNode() { node_dock = memnew( NodeDock ); //node_dock->set_undoredo(&editor_data.get_undo_redo()); - dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(node_dock); + if (use_single_dock_column) { + dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(node_dock); + } else { + dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(node_dock); + } scenes_dock = memnew( FileSystemDock(this) ); scenes_dock->set_name(TTR("FileSystem")); scenes_dock->set_display_mode(int(EditorSettings::get_singleton()->get("filesystem_dock/display_mode"))); - dock_slot[DOCK_SLOT_LEFT_UR]->add_child(scenes_dock); + + if (use_single_dock_column) { + dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(scenes_dock); + left_r_vsplit->hide(); + dock_slot[DOCK_SLOT_LEFT_UR]->hide(); + dock_slot[DOCK_SLOT_LEFT_BR]->hide(); + } else { + dock_slot[DOCK_SLOT_LEFT_UR]->add_child(scenes_dock); + } //prop_pallete->add_child(scenes_dock); scenes_dock->connect("open",this,"open_request"); scenes_dock->connect("instance",this,"_instance_request"); -- cgit v1.2.3