summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp6
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.h2
-rw-r--r--editor/plugins/audio_stream_editor_plugin.h2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/editor_preview_plugins.cpp8
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp1
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp59
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.h1
-rw-r--r--editor/plugins/script_text_editor.cpp25
-rw-r--r--editor/plugins/script_text_editor.h4
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp14
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp64
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.h28
14 files changed, 114 insertions, 106 deletions
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 41e2062ab2..8f6f244e8f 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -297,6 +297,12 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
if (mb.is_valid()) {
+ String cant_edit = _why_cant_edit_polygon();
+ if (cant_edit != String()) {
+ EditorNode::get_singleton()->show_warning(cant_edit);
+ return true;
+ }
+
Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();
Vector2 gpoint = mb->get_position();
diff --git a/editor/plugins/abstract_polygon_2d_editor.h b/editor/plugins/abstract_polygon_2d_editor.h
index 289c2785b1..f10af4ee6e 100644
--- a/editor/plugins/abstract_polygon_2d_editor.h
+++ b/editor/plugins/abstract_polygon_2d_editor.h
@@ -134,6 +134,8 @@ protected:
virtual bool _has_resource() const;
virtual void _create_resource();
+ virtual String _why_cant_edit_polygon() const { return String(); }
+
public:
bool forward_gui_input(const Ref<InputEvent> &p_event);
void forward_canvas_draw_over_viewport(Control *p_overlay);
diff --git a/editor/plugins/audio_stream_editor_plugin.h b/editor/plugins/audio_stream_editor_plugin.h
index e60bf6a38f..12e4faef94 100644
--- a/editor/plugins/audio_stream_editor_plugin.h
+++ b/editor/plugins/audio_stream_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/audio/audio_player.h"
+#include "scene/audio/audio_stream_player.h"
#include "scene/gui/color_rect.h"
#include "scene/resources/texture.h"
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index b2d2704f07..873bdd9e7f 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -42,9 +42,9 @@
#include "scene/2d/light_2d.h"
#include "scene/2d/particles_2d.h"
#include "scene/2d/polygon_2d.h"
-#include "scene/2d/screen_button.h"
#include "scene/2d/skeleton_2d.h"
#include "scene/2d/sprite.h"
+#include "scene/2d/touch_screen_button.h"
#include "scene/gui/grid_container.h"
#include "scene/gui/nine_patch_rect.h"
#include "scene/main/canvas_layer.h"
@@ -3288,7 +3288,7 @@ void CanvasItemEditor::_notification(int p_what) {
Control *control = Object::cast_to<Control>(E->get());
if (!control || Object::cast_to<Container>(control->get_parent())) {
presets_menu->set_disabled(true);
- presets_menu->set_tooltip(TTR("A child of a container gets its anchors and margins values overriden by its parent."));
+ presets_menu->set_tooltip(TTR("Children of containers have their anchors and margins values overridden by their parent."));
break;
}
}
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index fc572f54e1..10023d88bf 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -35,9 +35,9 @@
#include "scene/resources/circle_shape_2d.h"
#include "scene/resources/concave_polygon_shape_2d.h"
#include "scene/resources/convex_polygon_shape_2d.h"
+#include "scene/resources/line_shape_2d.h"
#include "scene/resources/rectangle_shape_2d.h"
#include "scene/resources/segment_shape_2d.h"
-#include "scene/resources/shape_line_2d.h"
Variant CollisionShape2DEditor::get_handle_value(int idx) const {
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 4556b11708..071a0287e6 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -36,7 +36,7 @@
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
-#include "scene/resources/bit_mask.h"
+#include "scene/resources/bit_map.h"
#include "scene/resources/dynamic_font.h"
#include "scene/resources/material.h"
#include "scene/resources/mesh.h"
@@ -334,7 +334,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Size
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+ Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
@@ -734,7 +734,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 p_
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+ Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
VS::get_singleton()->instance_set_base(mesh_instance, RID());
@@ -854,7 +854,7 @@ Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, c
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+ Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
img->convert(Image::FORMAT_RGBA8);
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index a944674cbd..bb7d50a9c1 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -91,6 +91,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) {
cpu_particles->set_transform(particles->get_transform());
cpu_particles->set_visible(particles->is_visible());
cpu_particles->set_pause_mode(particles->get_pause_mode());
+ cpu_particles->set_z_index(particles->get_z_index());
EditorNode::get_singleton()->get_scene_tree_dock()->replace_node(particles, cpu_particles, false);
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 1d7b4ffa41..28a17d0bef 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -52,6 +52,16 @@ Vector2 Polygon2DEditor::_get_offset(int p_idx) const {
return node->get_offset();
}
+String Polygon2DEditor::_why_cant_edit_polygon() const {
+
+ if (node->get_internal_vertex_count() > 0) {
+
+ return TTR("Polygon 2D has internal vertices, so it can no longer be edited in the viewport.");
+ }
+
+ return String();
+}
+
int Polygon2DEditor::_get_polygon_count() const {
if (node->get_internal_vertex_count() > 0) {
return 0; //do not edit if internal vertices exist
@@ -1028,6 +1038,9 @@ void Polygon2DEditor::_uv_draw() {
Ref<Texture> internal_handle = get_icon("EditorInternalHandle", "EditorIcons");
Color poly_line_color = Color(0.9, 0.5, 0.5);
+ if (polygons.size() || polygon_create.size()) {
+ poly_line_color.a *= 0.25;
+ }
Color polygon_line_color = Color(0.5, 0.5, 0.9);
Vector<Color> polygon_fill_color;
{
@@ -1041,6 +1054,30 @@ void Polygon2DEditor::_uv_draw() {
int uv_draw_max = uvs.size();
+ uv_draw_max -= node->get_internal_vertex_count();
+ if (uv_draw_max < 0) {
+ uv_draw_max = 0;
+ }
+
+ for (int i = 0; i < uvs.size(); i++) {
+
+ int next = uv_draw_max > 0 ? (i + 1) % uv_draw_max : 0;
+
+ if (i < uv_draw_max && uv_drag && uv_move_current == UV_MODE_EDIT_POINT && EDITOR_DEF("editors/poly_editor/show_previous_outline", true)) {
+ uv_edit_draw->draw_line(mtx.xform(points_prev[i]), mtx.xform(points_prev[next]), prev_color, 2 * EDSCALE);
+ }
+
+ Vector2 next_point = uvs[next];
+ if (uv_create && i == uvs.size() - 1) {
+ next_point = uv_create_to;
+ }
+ if (i < uv_draw_max /*&& polygons.size() == 0 && polygon_create.size() == 0*/) { //if using or creating polygons, do not show outline (will show polygons instead)
+ uv_edit_draw->draw_line(mtx.xform(uvs[i]), mtx.xform(next_point), poly_line_color, 2 * EDSCALE);
+ }
+
+ rect.expand_to(mtx.basis_xform(uvs[i]));
+ }
+
for (int i = 0; i < polygons.size(); i++) {
PoolVector<int> points = polygons[i];
@@ -1063,27 +1100,8 @@ void Polygon2DEditor::_uv_draw() {
}
}
- uv_draw_max -= node->get_internal_vertex_count();
- if (uv_draw_max < 0) {
- uv_draw_max = 0;
- }
-
for (int i = 0; i < uvs.size(); i++) {
- int next = uv_draw_max > 0 ? (i + 1) % uv_draw_max : 0;
-
- if (i < uv_draw_max && uv_drag && uv_move_current == UV_MODE_EDIT_POINT && EDITOR_DEF("editors/poly_editor/show_previous_outline", true)) {
- uv_edit_draw->draw_line(mtx.xform(points_prev[i]), mtx.xform(points_prev[next]), prev_color, 2 * EDSCALE);
- }
-
- Vector2 next_point = uvs[next];
- if (uv_create && i == uvs.size() - 1) {
- next_point = uv_create_to;
- }
- if (i < uv_draw_max && polygons.size() == 0 && polygon_create.size() == 0) { //if using or creating polygons, do not show outline (will show polygons instead)
- uv_edit_draw->draw_line(mtx.xform(uvs[i]), mtx.xform(next_point), poly_line_color, 2 * EDSCALE);
- }
-
if (weight_r.ptr()) {
Vector2 draw_pos = mtx.xform(uvs[i]);
float weight = weight_r[i];
@@ -1095,14 +1113,13 @@ void Polygon2DEditor::_uv_draw() {
uv_edit_draw->draw_texture(internal_handle, mtx.xform(uvs[i]) - internal_handle->get_size() * 0.5);
}
}
- rect.expand_to(mtx.basis_xform(uvs[i]));
}
if (polygon_create.size()) {
for (int i = 0; i < polygon_create.size(); i++) {
Vector2 from = uvs[polygon_create[i]];
Vector2 to = (i + 1) < polygon_create.size() ? uvs[polygon_create[i + 1]] : uv_create_to;
- uv_edit_draw->draw_line(mtx.xform(from), mtx.xform(to), poly_line_color, 2);
+ uv_edit_draw->draw_line(mtx.xform(from), mtx.xform(to), polygon_line_color, 2);
}
}
diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h
index d1849dd09b..d3277e90f7 100644
--- a/editor/plugins/polygon_2d_editor_plugin.h
+++ b/editor/plugins/polygon_2d_editor_plugin.h
@@ -152,6 +152,7 @@ protected:
virtual void _set_node(Node *p_polygon);
virtual Vector2 _get_offset(int p_idx) const;
+ virtual String _why_cant_edit_polygon() const;
virtual bool _has_uv() const { return true; };
virtual void _commit_action();
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 60dc156782..e95b1356bf 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -273,18 +273,12 @@ void ScriptTextEditor::_set_theme_for_script() {
}
}
-void ScriptTextEditor::_toggle_warning_pannel(const Ref<InputEvent> &p_event) {
- Ref<InputEventMouseButton> mb = p_event;
- if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
- warnings_panel->set_visible(!warnings_panel->is_visible());
- }
+void ScriptTextEditor::_show_warnings_panel(bool p_show) {
+ warnings_panel->set_visible(p_show);
}
-void ScriptTextEditor::_error_pressed(const Ref<InputEvent> &p_event) {
- Ref<InputEventMouseButton> mb = p_event;
- if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
- code_editor->goto_error();
- }
+void ScriptTextEditor::_error_pressed() {
+ code_editor->goto_error();
}
void ScriptTextEditor::_warning_clicked(Variant p_line) {
@@ -468,7 +462,7 @@ void ScriptTextEditor::_validate_script() {
}
}
- code_editor->get_warning_count_label()->set_text(itos(warnings.size()));
+ code_editor->set_warning_nb(warnings.size());
warnings_panel->clear();
warnings_panel->push_table(3);
for (List<ScriptLanguage::Warning>::Element *E = warnings.front(); E; E = E->next()) {
@@ -1107,7 +1101,7 @@ void ScriptTextEditor::_bind_methods() {
ClassDB::bind_method("_goto_line", &ScriptTextEditor::_goto_line);
ClassDB::bind_method("_lookup_symbol", &ScriptTextEditor::_lookup_symbol);
ClassDB::bind_method("_text_edit_gui_input", &ScriptTextEditor::_text_edit_gui_input);
- ClassDB::bind_method("_toggle_warning_pannel", &ScriptTextEditor::_toggle_warning_pannel);
+ ClassDB::bind_method("_show_warnings_panel", &ScriptTextEditor::_show_warnings_panel);
ClassDB::bind_method("_error_pressed", &ScriptTextEditor::_error_pressed);
ClassDB::bind_method("_warning_clicked", &ScriptTextEditor::_warning_clicked);
ClassDB::bind_method("_color_changed", &ScriptTextEditor::_color_changed);
@@ -1427,7 +1421,7 @@ ScriptTextEditor::ScriptTextEditor() {
code_editor = memnew(CodeTextEditor);
editor_box->add_child(code_editor);
- code_editor->add_constant_override("separation", 0);
+ code_editor->add_constant_override("separation", 2);
code_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE);
code_editor->connect("validate_script", this, "_validate_script");
code_editor->connect("load_theme_settings", this, "_load_theme_settings");
@@ -1445,9 +1439,8 @@ ScriptTextEditor::ScriptTextEditor() {
warnings_panel->set_focus_mode(FOCUS_CLICK);
warnings_panel->hide();
- code_editor->get_error_label()->connect("gui_input", this, "_error_pressed");
- code_editor->get_warning_label()->connect("gui_input", this, "_toggle_warning_pannel");
- code_editor->get_warning_count_label()->connect("gui_input", this, "_toggle_warning_pannel");
+ code_editor->connect("error_pressed", this, "_error_pressed");
+ code_editor->connect("show_warnings_panel", this, "_show_warnings_panel");
warnings_panel->connect("meta_clicked", this, "_warning_clicked");
update_settings();
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index 856e442d82..f83aadddef 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -125,8 +125,8 @@ protected:
void _code_complete_script(const String &p_code, List<String> *r_options, bool &r_force);
void _load_theme_settings();
void _set_theme_for_script();
- void _toggle_warning_pannel(const Ref<InputEvent> &p_event);
- void _error_pressed(const Ref<InputEvent> &p_event);
+ void _show_warnings_panel(bool p_show);
+ void _error_pressed();
void _warning_clicked(Variant p_line);
void _notification(int p_what);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 78bc989c5f..0704e57bb9 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -35,7 +35,7 @@
#include "core/os/keyboard.h"
#include "core/print_string.h"
#include "core/project_settings.h"
-#include "core/sort.h"
+#include "core/sort_array.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/plugins/animation_player_editor_plugin.h"
@@ -2865,6 +2865,18 @@ void SpatialEditorViewport::update_transform_gizmo_view() {
Transform xform = spatial_editor->get_gizmo_transform();
Transform camera_xform = camera->get_transform();
+
+ if (xform.origin.distance_squared_to(camera_xform.origin) < 0.01) {
+ for (int i = 0; i < 3; i++) {
+ VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
+ VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
+ VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
+ VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
+ VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
+ }
+ return;
+ }
+
Vector3 camz = -camera_xform.get_basis().get_axis(2).normalized();
Vector3 camy = -camera_xform.get_basis().get_axis(1).normalized();
Plane p(camera_xform.origin, camz);
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index b712cfc9d3..89bb7440fe 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -40,10 +40,8 @@ void SpriteFramesEditor::_gui_input(Ref<InputEvent> p_event) {
void SpriteFramesEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
- }
-
if (p_what == NOTIFICATION_ENTER_TREE) {
+
load->set_icon(get_icon("Load", "EditorIcons"));
copy->set_icon(get_icon("ActionCopy", "EditorIcons"));
paste->set_icon(get_icon("ActionPaste", "EditorIcons"));
@@ -54,14 +52,9 @@ void SpriteFramesEditor::_notification(int p_what) {
_delete->set_icon(get_icon("Remove", "EditorIcons"));
new_anim->set_icon(get_icon("New", "EditorIcons"));
remove_anim->set_icon(get_icon("Remove", "EditorIcons"));
- }
-
- if (p_what == NOTIFICATION_READY) {
+ } else if (p_what == NOTIFICATION_READY) {
- //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
- }
-
- if (p_what == NOTIFICATION_DRAW) {
+ add_constant_override("autohide", 1); // Fixes the dragger always showing up.
}
}
@@ -649,7 +642,6 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da
void SpriteFramesEditor::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_gui_input"), &SpriteFramesEditor::_gui_input);
ClassDB::bind_method(D_METHOD("_load_pressed"), &SpriteFramesEditor::_load_pressed);
ClassDB::bind_method(D_METHOD("_empty_pressed"), &SpriteFramesEditor::_empty_pressed);
ClassDB::bind_method(D_METHOD("_empty2_pressed"), &SpriteFramesEditor::_empty2_pressed);
@@ -673,31 +665,25 @@ void SpriteFramesEditor::_bind_methods() {
SpriteFramesEditor::SpriteFramesEditor() {
- //add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel"));
-
- split = memnew(HSplitContainer);
- add_child(split);
-
VBoxContainer *vbc_animlist = memnew(VBoxContainer);
- split->add_child(vbc_animlist);
+ add_child(vbc_animlist);
vbc_animlist->set_custom_minimum_size(Size2(150, 0) * EDSCALE);
- //vbc_animlist->set_v_size_flags(SIZE_EXPAND_FILL);
VBoxContainer *sub_vb = memnew(VBoxContainer);
- vbc_animlist->add_margin_child(TTR("Animations"), sub_vb, true);
+ vbc_animlist->add_margin_child(TTR("Animations:"), sub_vb, true);
sub_vb->set_v_size_flags(SIZE_EXPAND_FILL);
HBoxContainer *hbc_animlist = memnew(HBoxContainer);
sub_vb->add_child(hbc_animlist);
- new_anim = memnew(Button);
- new_anim->set_flat(true);
+ new_anim = memnew(ToolButton);
+ new_anim->set_tooltip(TTR("New Animation"));
hbc_animlist->add_child(new_anim);
new_anim->set_h_size_flags(SIZE_EXPAND_FILL);
new_anim->connect("pressed", this, "_animation_add");
- remove_anim = memnew(Button);
- remove_anim->set_flat(true);
+ remove_anim = memnew(ToolButton);
+ remove_anim->set_tooltip(TTR("Remove Animation"));
hbc_animlist->add_child(remove_anim);
remove_anim->connect("pressed", this, "_animation_remove");
@@ -722,56 +708,47 @@ SpriteFramesEditor::SpriteFramesEditor() {
anim_loop->connect("pressed", this, "_animation_loop_changed");
VBoxContainer *vbc = memnew(VBoxContainer);
- split->add_child(vbc);
+ add_child(vbc);
vbc->set_h_size_flags(SIZE_EXPAND_FILL);
sub_vb = memnew(VBoxContainer);
- vbc->add_margin_child(TTR("Animation Frames"), sub_vb, true);
+ vbc->add_margin_child(TTR("Animation Frames:"), sub_vb, true);
HBoxContainer *hbc = memnew(HBoxContainer);
sub_vb->add_child(hbc);
- //animations = memnew( ItemList );
-
- load = memnew(Button);
- load->set_flat(true);
+ load = memnew(ToolButton);
load->set_tooltip(TTR("Load Resource"));
hbc->add_child(load);
- copy = memnew(Button);
- copy->set_flat(true);
+ copy = memnew(ToolButton);
copy->set_tooltip(TTR("Copy"));
hbc->add_child(copy);
- paste = memnew(Button);
- paste->set_flat(true);
+ paste = memnew(ToolButton);
paste->set_tooltip(TTR("Paste"));
hbc->add_child(paste);
- empty = memnew(Button);
- empty->set_flat(true);
+ empty = memnew(ToolButton);
empty->set_tooltip(TTR("Insert Empty (Before)"));
hbc->add_child(empty);
- empty2 = memnew(Button);
- empty2->set_flat(true);
+ empty2 = memnew(ToolButton);
empty2->set_tooltip(TTR("Insert Empty (After)"));
hbc->add_child(empty2);
hbc->add_spacer(false);
- move_up = memnew(Button);
- move_up->set_flat(true);
+ move_up = memnew(ToolButton);
move_up->set_tooltip(TTR("Move (Before)"));
hbc->add_child(move_up);
- move_down = memnew(Button);
- move_down->set_flat(true);
+ move_down = memnew(ToolButton);
move_down->set_tooltip(TTR("Move (After)"));
hbc->add_child(move_down);
- _delete = memnew(Button);
- _delete->set_flat(true);
+ _delete = memnew(ToolButton);
+ _delete->set_tooltip(TTR("Delete"));
hbc->add_child(_delete);
file = memnew(EditorFileDialog);
@@ -787,7 +764,6 @@ SpriteFramesEditor::SpriteFramesEditor() {
tree->set_fixed_column_width(thumbnail_size * 3 / 2);
tree->set_max_text_lines(2);
tree->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size));
- //tree->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
tree->set_drag_forwarding(this);
sub_vb->add_child(tree);
diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h
index 3ef4ba290b..55dd10074e 100644
--- a/editor/plugins/sprite_frames_editor_plugin.h
+++ b/editor/plugins/sprite_frames_editor_plugin.h
@@ -39,25 +39,25 @@
#include "scene/gui/split_container.h"
#include "scene/gui/tree.h"
-class SpriteFramesEditor : public PanelContainer {
-
- GDCLASS(SpriteFramesEditor, PanelContainer);
-
- Button *load;
- Button *_delete;
- Button *copy;
- Button *paste;
- Button *empty;
- Button *empty2;
- Button *move_up;
- Button *move_down;
+class SpriteFramesEditor : public HSplitContainer {
+
+ GDCLASS(SpriteFramesEditor, HSplitContainer);
+
+ ToolButton *load;
+ ToolButton *_delete;
+ ToolButton *copy;
+ ToolButton *paste;
+ ToolButton *empty;
+ ToolButton *empty2;
+ ToolButton *move_up;
+ ToolButton *move_down;
ItemList *tree;
bool loading_scene;
int sel;
HSplitContainer *split;
- Button *new_anim;
- Button *remove_anim;
+ ToolButton *new_anim;
+ ToolButton *remove_anim;
Tree *animations;
SpinBox *anim_speed;