Merge pull request #59183 from YeldhamDev/assetlib_less_borders

Remove extra borders from the AssetLib plugin
This commit is contained in:
Rémi Verschelde 2022-03-16 23:50:18 +01:00 committed by GitHub
commit 178961a6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -1532,6 +1532,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("Information3dViewport", "EditorStyles", style_info_3d_viewport); theme->set_stylebox("Information3dViewport", "EditorStyles", style_info_3d_viewport);
// Asset Library. // Asset Library.
theme->set_stylebox("bg", "AssetLib", style_empty);
theme->set_stylebox("panel", "AssetLib", style_content_panel); theme->set_stylebox("panel", "AssetLib", style_content_panel);
theme->set_color("status_color", "AssetLib", Color(0.5, 0.5, 0.5)); theme->set_color("status_color", "AssetLib", Color(0.5, 0.5, 0.5));
theme->set_icon("dismiss", "AssetLib", theme->get_icon(SNAME("Close"), SNAME("EditorIcons"))); theme->set_icon("dismiss", "AssetLib", theme->get_icon(SNAME("Close"), SNAME("EditorIcons")));

View File

@ -577,6 +577,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
void EditorAssetLibrary::_notification(int p_what) { void EditorAssetLibrary::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("AssetLib")));
error_label->raise(); error_label->raise();
} break; } break;
@ -1377,7 +1378,6 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
initial_loading = true; initial_loading = true;
VBoxContainer *library_main = memnew(VBoxContainer); VBoxContainer *library_main = memnew(VBoxContainer);
add_child(library_main); add_child(library_main);
HBoxContainer *search_hb = memnew(HBoxContainer); HBoxContainer *search_hb = memnew(HBoxContainer);

View File

@ -1895,6 +1895,11 @@ void ProjectManager::_notification(int p_what) {
// to search without having to reach for their mouse // to search without having to reach for their mouse
search_box->grab_focus(); search_box->grab_focus();
} }
if (asset_library) {
// Removes extra border margins.
asset_library->add_theme_style_override("panel", memnew(StyleBoxEmpty));
}
} break; } break;
case NOTIFICATION_VISIBILITY_CHANGED: { case NOTIFICATION_VISIBILITY_CHANGED: {