summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-23 12:08:55 +0200
committerGitHub <noreply@github.com>2019-04-23 12:08:55 +0200
commit04efa598681fc4903907d160f6dc80fc8537b43f (patch)
treef9ee013ff9dc2c757785f13f0f704f6b068044a3
parentb874b33a326222a7db51f17aa522e9f1fe4766bd (diff)
parent36f955e4f305cfe4b80237986e9a38bac4b92bf4 (diff)
Merge pull request #28292 from homer666/merge-from-scene-stuff
Minor "Merge From Scene" improvements
-rw-r--r--editor/editor_sub_scene.cpp6
-rw-r--r--editor/scene_tree_dock.cpp8
2 files changed, 10 insertions, 4 deletions
diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp
index e4807a37c6..987033b123 100644
--- a/editor/editor_sub_scene.cpp
+++ b/editor/editor_sub_scene.cpp
@@ -73,8 +73,8 @@ void EditorSubScene::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
- if (!is_visible_in_tree()) {
- }
+ if (is_visible() && scene == NULL)
+ _path_browse();
}
}
@@ -232,7 +232,7 @@ EditorSubScene::EditorSubScene() {
hb->add_child(path);
path->set_h_size_flags(SIZE_EXPAND_FILL);
Button *b = memnew(Button);
- b->set_text(" .. ");
+ b->set_text(TTR("Browse"));
hb->add_child(b);
b->connect("pressed", this, "_path_browse");
vb->add_margin_child(TTR("Scene Path:"), hb);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 6dc01e37bd..1dca542138 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1940,7 +1940,13 @@ void SceneTreeDock::set_selected(Node *p_node, bool p_emit_selected) {
void SceneTreeDock::import_subscene() {
- import_subscene_dialog->popup_centered_ratio();
+ Size2 popup_size = Size2(500, 800) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ import_subscene_dialog->popup_centered(popup_size);
}
void SceneTreeDock::_import_subscene() {