颜色提示优化

This commit is contained in:
邬春鹏
2025-06-05 11:49:22 +08:00
parent 830eb7c460
commit f35248c119
2 changed files with 30 additions and 7 deletions

View File

@@ -848,7 +848,7 @@ namespace YooAsset.Editor
_groupDescTxt.SetValueWithoutNotify(selectGroup.GroupDesc); _groupDescTxt.SetValueWithoutNotify(selectGroup.GroupDesc);
_groupTagsTxt.SetValueWithoutNotify(selectGroup.AssetTags); _groupTagsTxt.SetValueWithoutNotify(selectGroup.AssetTags);
FillCollectorViewData(); FillCollectorViewData();
} }
private void AddGroupBtn_clicked() private void AddGroupBtn_clicked()
{ {
@@ -1054,13 +1054,17 @@ namespace YooAsset.Editor
{ {
if (collector.CollectPath.ToLower().Contains(_lowerSearchKey)) if (collector.CollectPath.ToLower().Contains(_lowerSearchKey))
{ {
objectField1.Q<Label>().style.color = new Color(1, 0, 0, 1); objectField1.Q<Label>().text = "<color=red>Collector</color>";
} }
else else
{ {
objectField1.Q<Label>().style.color = new Color(1, 1, 1, 1); objectField1.Q<Label>().text = "Collector";
} }
} }
else
{
objectField1.Q<Label>().text = "Collector";
}
objectField1.RegisterValueChangedCallback(evt => objectField1.RegisterValueChangedCallback(evt =>
{ {
@@ -1072,13 +1076,17 @@ namespace YooAsset.Editor
{ {
if(collector.CollectPath.ToLower().Contains(_lowerSearchKey)) if(collector.CollectPath.ToLower().Contains(_lowerSearchKey))
{ {
objectField1.Q<Label>().style.color = new Color(1, 0, 0, 1); objectField1.Q<Label>().text = "<color=red>Collector</color>";
} }
else else
{ {
objectField1.Q<Label>().style.color = new Color(1, 1, 1, 1); objectField1.Q<Label>().text = "Collector";
} }
} }
else
{
objectField1.Q<Label>().text = "Collector";
}
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector); AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
if (foldout.value) if (foldout.value)
@@ -1164,7 +1172,22 @@ namespace YooAsset.Editor
// Tags // Tags
var textFiled1 = element.Q<TextField>("TextField1"); var textFiled1 = element.Q<TextField>("TextField1");
textFiled1.SetValueWithoutNotify(collector.AssetTags); if(_viewMode == EViewMode.Search)
{
if(collector.AssetTags.ToLower().Contains(_lowerSearchKey))
{
textFiled1.label = "<color=red>Tags</color>";
}
else
{
textFiled1.label = "Tags";
}
}
else
{
textFiled1.label = "Tags";
}
textFiled1.SetValueWithoutNotify(collector.AssetTags);
textFiled1.RegisterValueChangedCallback(evt => textFiled1.RegisterValueChangedCallback(evt =>
{ {
collector.AssetTags = evt.newValue; collector.AssetTags = evt.newValue;

View File

@@ -50,7 +50,7 @@
<ui:VisualElement name="ActiveRuleContainer" style="height: 20px;" /> <ui:VisualElement name="ActiveRuleContainer" style="height: 20px;" />
<ui:TextField picking-mode="Ignore" label="Group Name" name="GroupName" /> <ui:TextField picking-mode="Ignore" label="Group Name" name="GroupName" />
<ui:TextField picking-mode="Ignore" label="Group Desc" name="GroupDesc" /> <ui:TextField picking-mode="Ignore" label="Group Desc" name="GroupDesc" />
<ui:TextField picking-mode="Ignore" label="Asset Tags" name="GroupTags" /> <ui:TextField picking-mode="Ignore" label="Asset Tags" name="GroupTags" style="border-left-color: rgb(255, 255, 255); border-right-color: rgb(255, 255, 255); border-top-color: rgb(255, 255, 255); border-bottom-color: rgb(255, 255, 255); border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;" />
<ui:VisualElement name="CollectorAddContainer" style="height: 20px; flex-direction: row-reverse;"> <ui:VisualElement name="CollectorAddContainer" style="height: 20px; flex-direction: row-reverse;">
<ui:Button text="[ + ]" display-tooltip-when-elided="true" name="AddBtn" /> <ui:Button text="[ + ]" display-tooltip-when-elided="true" name="AddBtn" />
</ui:VisualElement> </ui:VisualElement>