diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-25 13:34:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 13:34:12 +0200 |
commit | 42194e2f097b570e786b3203aef0c7ecf2b67d2a (patch) | |
tree | 0904d9b44b3c114560ee76ba9d60e6304472d054 /editor/plugins/asset_library_editor_plugin.cpp | |
parent | 5fe971145c2bdebf2d68ee3cb3aeb126c7f68e46 (diff) | |
parent | b89d8bb56cf0106a129f98f81dbaba7df19964df (diff) |
Merge pull request #28354 from gdupr/gui_improvements_in_asset_editor
GUI improvements in the asset library editor.
Diffstat (limited to 'editor/plugins/asset_library_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 386bc1738e..0dfb53b34a 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -175,7 +175,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const Ref<Image> overlay = get_icon("PlayOverlay", "EditorIcons")->get_data(); Ref<Image> thumbnail = p_image->get_data(); thumbnail = thumbnail->duplicate(); - Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2); + Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width() / 2) / 2, (thumbnail->get_height() - overlay->get_height() / 2) / 2); // Overlay and thumbnail need the same format for `blend_rect` to work. thumbnail->convert(Image::FORMAT_RGBA8); @@ -310,15 +310,20 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { description = memnew(RichTextLabel); description->connect("meta_clicked", this, "_link_click"); + description->set_custom_minimum_size(Size2(440 * EDSCALE, 300 * EDSCALE)); desc_bg->add_child(description); + VBoxContainer *previews_vbox = memnew(VBoxContainer); + hbox->add_child(previews_vbox); + previews_vbox->add_constant_override("separation", 15 * EDSCALE); + preview = memnew(TextureRect); preview->set_custom_minimum_size(Size2(640 * EDSCALE, 345 * EDSCALE)); - hbox->add_child(preview); + previews_vbox->add_child(preview); previews_bg = memnew(PanelContainer); - vbox->add_child(previews_bg); - previews_bg->set_custom_minimum_size(Size2(0, 101 * EDSCALE)); + previews_vbox->add_child(previews_bg); + previews_bg->set_custom_minimum_size(Size2(640 * EDSCALE, 101 * EDSCALE)); previews = memnew(ScrollContainer); previews_bg->add_child(previews); |