mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-15 17:27:56 +00:00
Fix layout file properties with proper tab loading.
This commit is contained in:
parent
0c58133531
commit
a09db22b48
1 changed files with 13 additions and 10 deletions
|
@ -65,22 +65,17 @@ namespace LayoutBXLYT
|
|||
}
|
||||
|
||||
private STPropertyGrid propertyGrid;
|
||||
private object activeProperty;
|
||||
public void LoadProperties(object properties)
|
||||
{
|
||||
Reset();
|
||||
|
||||
MaterialMode = false;
|
||||
|
||||
AddTab("Properties");
|
||||
activeProperty = properties;
|
||||
|
||||
if (propertyGrid == null || propertyGrid.Disposing || propertyGrid.IsDisposed)
|
||||
{
|
||||
propertyGrid = new STPropertyGrid();
|
||||
propertyGrid.Dock = DockStyle.Fill;
|
||||
stPanel1.Controls.Add(propertyGrid);
|
||||
}
|
||||
|
||||
propertyGrid.LoadProperty(properties, ProperyChanged);
|
||||
AddTab("Properties", LoadPropertyData);
|
||||
stToolStrip1.Items[0].PerformClick();
|
||||
}
|
||||
|
||||
private void ProperyChanged()
|
||||
|
@ -178,7 +173,8 @@ namespace LayoutBXLYT
|
|||
else
|
||||
tabIndex = Runtime.LayoutEditor.NullPaneTabIndex;
|
||||
|
||||
stToolStrip1.Items[tabIndex].PerformClick();
|
||||
if (tabIndex < stToolStrip1.Items.Count)
|
||||
stToolStrip1.Items[tabIndex].PerformClick();
|
||||
|
||||
Loaded = true;
|
||||
}
|
||||
|
@ -214,6 +210,13 @@ namespace LayoutBXLYT
|
|||
Runtime.LayoutEditor.NullPaneTabIndex = tabIndex;
|
||||
}
|
||||
|
||||
public void LoadPropertyData(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTabIndex();
|
||||
propertyGrid = GetActiveEditor<STPropertyGrid>();
|
||||
propertyGrid.LoadProperty(activeProperty, ProperyChanged);
|
||||
}
|
||||
|
||||
public void LoadAnimationData(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTabIndex();
|
||||
|
|
Loading…
Reference in a new issue