Skip to content

Commit

Permalink
Another fix for closeable tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Oct 3, 2024
1 parent e519307 commit 49242e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@

<ItemGroup>
<ProjectReference Include="..\..\src\Myra\Myra.FNA.Core.csproj" />
</ItemGroup></Project>
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions src/Myra/Graphics2D/UI/Properties/PropertyGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ public object Object

_object = value;
Rebuild();

ObjectChanged?.Invoke(this, EventArgs.Empty);
}
}

Expand Down Expand Up @@ -340,6 +342,7 @@ public string Filter
public Func<Record, object, Widget> CustomWidgetProvider;

public event EventHandler<GenericEventArgs<string>> PropertyChanged;
public event EventHandler ObjectChanged;

private PropertyGrid(TreeStyle style, string category, Record parentProperty, PropertyGrid parentGrid = null)
{
Expand Down
4 changes: 3 additions & 1 deletion src/Myra/Graphics2D/UI/Selectors/TabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ protected override void InsertItem(TabItem item, int index)

var button = new ListViewButton
{
Tag = item,
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Height = item.Height,
Expand All @@ -246,10 +245,13 @@ protected override void InsertItem(TabItem item, int index)

if (!CloseableTabs)
{
button.Tag = item;
_gridButtons.Widgets.Insert(index, button);
} else
{
var topItemPanel = new HorizontalStackPanel();
topItemPanel.Tag = item;

topItemPanel.Widgets.Add(button);
StackPanel.SetProportionType(button, ProportionType.Fill);

Expand Down

0 comments on commit 49242e4

Please sign in to comment.