Merge pull request #28071 from YeldhamDev/treedialog_style_fix

Fix styling in 'SceneTreeDialog'
This commit is contained in:
Rémi Verschelde 2019-04-16 10:09:37 +02:00 committed by GitHub
commit 192d176d30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1121,22 +1121,17 @@ SceneTreeEditor::~SceneTreeEditor() {
void SceneTreeDialog::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
connect("confirmed", this, "_select");
}
if (p_what == NOTIFICATION_EXIT_TREE) {
disconnect("confirmed", this, "_select");
}
if (p_what == NOTIFICATION_DRAW) {
RID ci = get_canvas_item();
get_stylebox("panel", "PopupMenu")->draw(ci, Rect2(Point2(), get_size()));
}
if (p_what == NOTIFICATION_VISIBILITY_CHANGED && is_visible_in_tree()) {
tree->update_tree();
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
connect("confirmed", this, "_select");
} break;
case NOTIFICATION_EXIT_TREE: {
disconnect("confirmed", this, "_select");
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible_in_tree())
tree->update_tree();
} break;
}
}
@ -1165,8 +1160,6 @@ SceneTreeDialog::SceneTreeDialog() {
tree = memnew(SceneTreeEditor(false, false, true));
add_child(tree);
//set_child_rect(tree);
tree->get_scene_tree()->connect("item_activated", this, "_select");
}