summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-09-13 11:20:09 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-09-13 11:20:09 -0300
commitbfe67a3b87ada532d27df015141af8eb6091ef89 (patch)
tree0624dd10f9a1ef401688a1ef8bca97cd5dca3f59 /tools/editor/editor_node.cpp
parent8bcb6a290c61d40333cf3aa73e362836b6e12659 (diff)
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.
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp24
1 files changed, 20 insertions, 4 deletions
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");