summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-09-17 10:44:22 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-09-17 10:44:22 -0300
commit02a694ff48fa8bd340777dbbd22fd01b97584395 (patch)
tree094dfa91b8c20f79030ee18e3334e21f88b0f9fc /tools/editor/plugins
parentf304c9f93a4c0f01e884064e8e7a2f293d5486f6 (diff)
parente6df7da6abe89979dea501cd48ff288f27a3c394 (diff)
Merge pull request #580 from marynate/PR-fix-particles-editor-menu
Particles editor menu not display in proper position
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/particles_editor_plugin.cpp18
-rw-r--r--tools/editor/plugins/particles_editor_plugin.h5
2 files changed, 11 insertions, 12 deletions
diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp
index 38781d93b9..418ad11704 100644
--- a/tools/editor/plugins/particles_editor_plugin.cpp
+++ b/tools/editor/plugins/particles_editor_plugin.cpp
@@ -29,6 +29,7 @@
#include "particles_editor_plugin.h"
#include "io/resource_loader.h"
#include "servers/visual/particle_system_sw.h"
+#include "tools/editor/plugins/spatial_editor_plugin.h"
void ParticlesEditor::_node_removed(Node *p_node) {
@@ -340,9 +341,11 @@ void ParticlesEditor::_bind_methods() {
ParticlesEditor::ParticlesEditor() {
+ particles_editor_hb = memnew ( HBoxContainer );
+ SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
options = memnew( MenuButton );
- add_child(options);
- options->set_area_as_parent_rect();
+ particles_editor_hb->add_child(options);
+ particles_editor_hb->hide();
options->set_text("Particles");
options->get_popup()->add_item("Generate AABB",MENU_OPTION_GENERATE_AABB);
@@ -429,8 +432,9 @@ void ParticlesEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
particles_editor->show();
+ particles_editor->particles_editor_hb->show();
} else {
-
+ particles_editor->particles_editor_hb->hide();
particles_editor->hide();
particles_editor->edit(NULL);
}
@@ -443,14 +447,6 @@ ParticlesEditorPlugin::ParticlesEditorPlugin(EditorNode *p_node) {
particles_editor = memnew( ParticlesEditor );
editor->get_viewport()->add_child(particles_editor);
-// particles_editor->set_anchor(MARGIN_LEFT,Control::ANCHOR_END);
-// particles_editor->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END);
- particles_editor->set_margin(MARGIN_LEFT,253);
- particles_editor->set_margin(MARGIN_RIGHT,280);
- particles_editor->set_margin(MARGIN_TOP,0);
- particles_editor->set_margin(MARGIN_BOTTOM,10);
-
-
particles_editor->hide();
}
diff --git a/tools/editor/plugins/particles_editor_plugin.h b/tools/editor/plugins/particles_editor_plugin.h
index ba655c9b39..3e4b0f73aa 100644
--- a/tools/editor/plugins/particles_editor_plugin.h
+++ b/tools/editor/plugins/particles_editor_plugin.h
@@ -43,7 +43,8 @@ class ParticlesEditor : public Control {
OBJ_TYPE(ParticlesEditor, Control );
Panel *panel;
- MenuButton * options;
+ MenuButton *options;
+ HBoxContainer *particles_editor_hb;
Particles *node;
@@ -78,6 +79,8 @@ class ParticlesEditor : public Control {
void _populate();
+friend class ParticlesEditorPlugin;
+
protected:
void _notification(int p_notification);