aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/plugins/sample_editor_plugin.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-05-23 17:10:26 -0300
committerJuan Linietsky2016-05-23 17:11:49 -0300
commitd3495b128a700b6f830ec90ff0b544ad1333b867 (patch)
tree78d1a96d928f912e9d5e1f8502d7651c47e209b6 /tools/editor/plugins/sample_editor_plugin.cpp
parentb777b32470fc7cba345f3ff2ee419074104f8f9b (diff)
downloadgodot-d3495b128a700b6f830ec90ff0b544ad1333b867.tar.gz
godot-d3495b128a700b6f830ec90ff0b544ad1333b867.tar.zst
godot-d3495b128a700b6f830ec90ff0b544ad1333b867.zip
-Improve resource previews
-Also fixed draw_texture_rect() tile parameter
Diffstat (limited to 'tools/editor/plugins/sample_editor_plugin.cpp')
-rw-r--r--tools/editor/plugins/sample_editor_plugin.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp
index 3a54273d1..f9217e47f 100644
--- a/tools/editor/plugins/sample_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_editor_plugin.cpp
@@ -328,7 +328,7 @@ void SampleEditor::_update_sample() {
return; //bye or unsupported
generate_preview_texture(sample,peakdisplay);
- info_label->set_text(TTR("Length:")+" "+vformat(TTR("%d frames"), sample->get_length())+" ("+String::num(sample->get_length()/(float)sample->get_mix_rate(),2)+" s), "+(sample->get_format()==Sample::FORMAT_PCM16?TTR("16 Bits"):TTR("8 Bits"))+", "+(sample->is_stereo()?TTR("Stereo"):TTR("Mono"))+".");
+ info_label->set_text(TTR("Length:")+" "+String::num(sample->get_length()/(float)sample->get_mix_rate(),2)+"s");
library->add_sample("default",sample);
}
@@ -404,6 +404,8 @@ SampleEditor::SampleEditor() {
play->connect("pressed", this,"_play_pressed");
stop->connect("pressed", this,"_stop_pressed");
+ set_custom_minimum_size(Size2(1,150));
+
}
@@ -438,10 +440,7 @@ SampleEditorPlugin::SampleEditorPlugin(EditorNode *p_node) {
editor=p_node;
sample_editor = memnew( SampleEditor );
- editor->get_viewport()->add_child(sample_editor);
- sample_editor->set_area_as_parent_rect();
- sample_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END);
- sample_editor->set_margin( MARGIN_TOP, 120 );
+ add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM,sample_editor);
sample_editor->hide();