com.alicizax.unity.packagem.../Editor/PackageManager/Window/PackageBottomStateBar.cs
陈思海 d04ec57ba7 init
2025-02-20 10:48:57 +08:00

45 lines
1.4 KiB
C#

using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace AlicizaX.PackageManager.Editor
{
internal class PackageBottomStateBar : VisualElement
{
private readonly Label stateLabel;
private readonly Button btnRefresh;
public PackageBottomStateBar()
{
style.flexDirection = FlexDirection.Row;
style.flexShrink = 1;
style.justifyContent = Justify.FlexStart;
style.height = Length.Percent(5);
style.backgroundColor = new Color(0.2509804f, 0.2509804f, 0.2509804f);
style.borderTopWidth = 1;
stateLabel = new Label();
stateLabel.name = "stateLabel";
stateLabel.text = "Last update Feb 19,13:52";
stateLabel.style.alignSelf = Align.Center;
stateLabel.style.marginLeft = new Length(2, LengthUnit.Pixel);
stateLabel.style.flexGrow = 1; // 让 Label 占据剩余空间
Add(stateLabel);
btnRefresh = new Button();
btnRefresh.name = "btnRefresh";
btnRefresh.style.maxHeight = 30;
Image icon = new Image();
icon.image = EditorGUIUtility.IconContent("d_Refresh").image;
btnRefresh.Add(icon);
Add(btnRefresh);
}
private void OnBtnRefreshClick()
{
// RepositoryDataFetcher.RefreshPackageData(null);
}
}
}