浏览代码

polish: hide suggested label containers if there are no suggested labels

/main
Mohsen Kamalzadeh 4 年前
当前提交
f6f41924
共有 1 个文件被更改,包括 20 次插入2 次删除
  1. 22
      com.unity.perception/Editor/GroundTruth/LabelingEditor.cs

22
com.unity.perception/Editor/GroundTruth/LabelingEditor.cs


private VisualElement m_AutoLabelingContainer;
private VisualElement m_FromLabelConfigsContainer;
private VisualElement m_SuggestedLabelsContainer;
private VisualElement m_SuggestedOnNamePanel;
private VisualElement m_SuggestedOnPathPanel;
private ListView m_CurrentLabelsListView;
private ListView m_SuggestLabelsListView_FromName;
private ListView m_SuggestLabelsListView_FromPath;

m_SuggestLabelsListView_FromName = m_Root.Q<ListView>("suggested-labels-name-listview");
m_SuggestLabelsListView_FromPath = m_Root.Q<ListView>("suggested-labels-path-listview");
m_LabelConfigsScrollView = m_Root.Q<ScrollView>("label-configs-scrollview");
m_SuggestedOnNamePanel = m_Root.Q<VisualElement>("suggested-labels-from-name");
m_SuggestedOnPathPanel = m_Root.Q<VisualElement>("suggested-labels-from-path");
m_AddButton = m_Root.Q<Button>("add-label");
m_CurrentAutoLabel = m_Root.Q<Label>("current-auto-label");
m_CurrentAutoLabelTitle = m_Root.Q<Label>("current-auto-label-title");

var addedTitle = m_Root.Q<Label>("added-labels-title");
addedTitle.text = "Common Labels of Selected Items";
var suggestedOnNamePanel = m_Root.Q<VisualElement>("suggested-labels-from-name");
suggestedOnNamePanel.RemoveFromHierarchy();
m_SuggestedOnNamePanel.style.display = DisplayStyle.None;
m_AddAutoLabelToConfButton.text = "Add Automatic Labels of All Selected Assets to Config...";
}

RefreshSuggestedLabelLists();
SetupSuggestedLabelsListViews();
SetupCurrentLabelsListView();
UpdateSuggestedPanelVisibility();
}
void SetupListsAndScrollers()

SetupSuggestedLabelsListViews();
//Add labels from Label Configs present in project
SetupLabelConfigsScrollView();
UpdateSuggestedPanelVisibility();
void UpdateSuggestedPanelVisibility()
{
m_SuggestedOnNamePanel.style.display = m_SuggestedLabelsBasedOnName.Count == 0 ? DisplayStyle.None : DisplayStyle.Flex;
m_SuggestedOnPathPanel.style.display = m_SuggestedLabelsBasedOnPath.Count == 0 ? DisplayStyle.None : DisplayStyle.Flex;
if (m_SuggestedLabelsBasedOnPath.Count == 0 && m_SuggestedLabelsBasedOnName.Count == 0)
{
m_SuggestedLabelsContainer.style.display = DisplayStyle.None;
}
}
void RefreshCommonLabels()
{

正在加载...
取消
保存