|
|
|
|
|
|
VisualElement m_SettingsContainer; |
|
|
|
bool m_ShowSettings = false; |
|
|
|
VisualElement m_SettingsButton; |
|
|
|
VisualElement m_SettingsDivider; |
|
|
|
VisualElement m_Settings; |
|
|
|
|
|
|
|
public void Initialize(AbstractMaterialNode inNode, PreviewManager previewManager, IEdgeConnectorListener connectorListener) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
parent.Add(buttonContainer); |
|
|
|
|
|
|
|
m_SettingsContainer = new VisualElement { name = "settings-container" }; |
|
|
|
Add(m_SettingsContainer); |
|
|
|
m_SettingsContainer.SendToBack(); |
|
|
|
|
|
|
|
//m_SettingsContainer.SendToBack();
|
|
|
|
m_SettingsContainer = new VisualElement { name = "settings-container" }; |
|
|
|
contents.Add(m_SettingsContainer); |
|
|
|
if (node.hasPreview) |
|
|
|
m_SettingsContainer.PlaceBehind(m_PreviewFiller); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if(!m_ShowSettings)
|
|
|
|
//else
|
|
|
|
// settingsButton.Add(new VisualElement { name = "icon-clicked" });
|
|
|
|
|
|
|
|
{ |
|
|
|
//var graph = (AbstractMaterialGraph)node.owner;
|
|
|
|
// martintt have to add this to the node to the right of it.
|
|
|
|
|
|
|
|
{ |
|
|
|
/* |
|
|
|
if (m_ShowSettings) |
|
|
|
{ |
|
|
|
m_SettingsContainer.Add(settings.CreateSettingsElement()); |
|
|
|
} |
|
|
|
else |
|
|
|
m_SettingsContainer.RemoveAt(0); |
|
|
|
*/ |
|
|
|
//Add(settings.CreateSettingsElement());
|
|
|
|
} |
|
|
|
buttonContainer.Add(collapseButton); |
|
|
|
} |
|
|
|
|
|
|
m_ShowSettings = !m_ShowSettings; |
|
|
|
if (m_ShowSettings) |
|
|
|
{ |
|
|
|
m_SettingsContainer.Add(settings.CreateSettingsElement()); |
|
|
|
m_SettingsDivider = new VisualElement { name = "divider" }; |
|
|
|
m_SettingsDivider.AddToClassList("horizontal"); |
|
|
|
m_SettingsContainer.Add(m_SettingsDivider); |
|
|
|
|
|
|
|
m_Settings = settings.CreateSettingsElement(); |
|
|
|
m_SettingsContainer.Add(m_Settings); |
|
|
|
|
|
|
|
m_SettingsContainer.RemoveAt(0); |
|
|
|
m_SettingsDivider.RemoveFromHierarchy(); |
|
|
|
m_Settings.RemoveFromHierarchy(); |
|
|
|
|
|
|
|
m_SettingsButton.RemoveFromClassList("clicked"); |
|
|
|
} |
|
|
|
} |
|
|
|