Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Oct 23, 2023
1 parent 76c02b7 commit 647f0f7
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageProjectUrl>https://github.com/rds1983/Myra</PackageProjectUrl>
<RootNamespace>Myra</RootNamespace>
<Description>UI Library for MonoGame, FNA and Stride</Description>
<VersionPrefix>1.4.5</VersionPrefix>
<VersionPrefix>1.5.0</VersionPrefix>
<XNAssetsVersion>0.6.7</XNAssetsVersion>
<FontStashSharpVersion>1.3.0</FontStashSharpVersion>
<LangVersion>8.0</LangVersion>
Expand Down
10 changes: 1 addition & 9 deletions samples/Myra.Samples.Silk.NET.TrippyGL/AllWidgets.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,17 +399,9 @@ private void BuildUI()
var horizontalSplitPane1 = new HorizontalSplitPane();
horizontalSplitPane1.Widgets.Add(scrollViewer1);
horizontalSplitPane1.Widgets.Add(verticalSplitPane1);

StackPanel.SetProportionType(horizontalSplitPane1, ProportionType.Fill);

Spacing = 8;
Proportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Auto,
});
Proportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
Widgets.Add(_mainMenu);
Widgets.Add(horizontalSplitPane1);
}
Expand Down
10 changes: 1 addition & 9 deletions samples/Myra.Samples.Silk.NET/AllWidgets.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,17 +399,9 @@ private void BuildUI()
var horizontalSplitPane1 = new HorizontalSplitPane();
horizontalSplitPane1.Widgets.Add(scrollViewer1);
horizontalSplitPane1.Widgets.Add(verticalSplitPane1);
StackPanel.SetProportionType(horizontalSplitPane1, ProportionType.Fill);


Spacing = 8;
Proportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Auto,
});
Proportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
Widgets.Add(_mainMenu);
Widgets.Add(horizontalSplitPane1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void BuildUI()
label4.Text = "0.1";

_sliderScale = new HorizontalSlider();
_sliderScale.Minimum = 0.1;
_sliderScale.Minimum = 0.1f;
_sliderScale.Maximum = 10;
_sliderScale.Value = 1;
_sliderScale.Width = 200;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by MyraPad at 10/23/2023 9:55:20 AM */
/* Generated by MyraPad at 10/23/2023 10:53:19 AM */
using Myra;
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
Expand Down
6 changes: 2 additions & 4 deletions src/Myra/Graphics2D/UI/Containers/StackPanel.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Xml.Serialization;

#if MONOGAME || FNA
using Microsoft.Xna.Framework;
using Myra.Attributes;
using Myra.MML;

#if MONOGAME || FNA
using Microsoft.Xna.Framework;
#elif STRIDE
using Stride.Core.Mathematics;
#else
Expand Down
3 changes: 1 addition & 2 deletions src/Myra/Graphics2D/UI/DebugOptionsWindow.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by MyraPad at 10/23/2023 9:55:38 AM */
/* Generated by MyraPad at 10/23/2023 10:53:36 AM */
using Myra;
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
Expand Down Expand Up @@ -52,7 +52,6 @@ private void BuildUI()

Root = new VerticalStackPanel();
Root.Id = "Root";
StackPanel.SetProportionType(Root, Myra.Graphics2D.UI.ProportionType.Fill);
Root.Widgets.Add(_checkBoxWidgetFrames);
Root.Widgets.Add(_checkBoxKeyboardFocusedWidgetFrame);
Root.Widgets.Add(_checkBoxMouseInsideWidgetFrame);
Expand Down
4 changes: 1 addition & 3 deletions src/Myra/Graphics2D/UI/File/FileDialog.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by MyraPad at 10/23/2023 9:55:29 AM */
/* Generated by MyraPad at 10/23/2023 10:53:28 AM */
using Myra;
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
Expand Down Expand Up @@ -100,12 +100,10 @@ private void BuildUI()

var verticalStackPanel1 = new VerticalStackPanel();
verticalStackPanel1.Spacing = 4;
StackPanel.SetProportionType(verticalStackPanel1, Myra.Graphics2D.UI.ProportionType.Fill);
verticalStackPanel1.Widgets.Add(horizontalStackPanel1);
verticalStackPanel1.Widgets.Add(_splitPane);
verticalStackPanel1.Widgets.Add(horizontalStackPanel2);


Title = "Open File...";
Left = 980;
Top = 464;
Expand Down
7 changes: 1 addition & 6 deletions src/Myra/Graphics2D/UI/Properties/CollectionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ public CollectionEditor(IList collection, Type type)
_type = type;

InternalChild = new VerticalStackPanel();

InternalChild.Proportions.Add(new Proportion(ProportionType.Auto));
InternalChild.Proportions.Add(new Proportion(ProportionType.Fill));
InternalChild.Proportions.Add(new Proportion(ProportionType.Auto));
InternalChild.Proportions.Add(new Proportion(ProportionType.Auto));

InternalChild.Widgets.Add(new HorizontalSeparator());

var splitPanel = new HorizontalSplitPane();
Expand All @@ -44,6 +38,7 @@ public CollectionEditor(IList collection, Type type)
_listItems.Items.Add(new ListItem(BuildItemText(item), null, item));
}

StackPanel.SetProportionType(_listItems, ProportionType.Fill);
splitPanel.Widgets.Add(_listItems);

_propertyGrid = new PropertyGrid();
Expand Down
4 changes: 1 addition & 3 deletions src/Myra/Graphics2D/UI/Properties/PropertyGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,6 @@ private Widget CreateAttributeFileEditor(Record record, bool hasSetter, FilePath
TextBox path = null;
if (attribute.ShowPath)
{
result.Proportions.Add(Proportion.Fill);
path = new TextBox
{
Readonly = true,
Expand All @@ -1012,11 +1011,10 @@ private Widget CreateAttributeFileEditor(Record record, bool hasSetter, FilePath
path.Text = value.ToString();
}

StackPanel.SetProportionType(path, ProportionType.Fill);
result.Widgets.Add(path);
}

result.Proportions.Add(Proportion.Auto);

var button = new TextButton
{
Text = "Change...",
Expand Down
23 changes: 9 additions & 14 deletions src/Myra/Graphics2D/UI/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public SpriteFontBase TitleFont

[Browsable(false)]
[XmlIgnore]
public Grid TitleGrid { get; private set; }
public HorizontalStackPanel TitlePanel { get; private set; }

[Browsable(false)]
[XmlIgnore]
Expand Down Expand Up @@ -99,6 +99,7 @@ public Widget Content

if (value != null)
{
StackPanel.SetProportionType(value, ProportionType.Fill);
InternalChild.Widgets.Insert(1, value);
}

Expand Down Expand Up @@ -170,32 +171,26 @@ public Window(string styleName = Stylesheet.DefaultStyleName)

InternalChild.Spacing = 8;

InternalChild.Proportions.Add(new Proportion(ProportionType.Auto));
InternalChild.Proportions.Add(new Proportion(ProportionType.Fill));

TitleGrid = new Grid
TitlePanel = new HorizontalStackPanel
{
ColumnSpacing = 8
Spacing = 8
};
DragHandle = TitleGrid;

TitleGrid.ColumnsProportions.Add(new Proportion(ProportionType.Fill));
TitleGrid.ColumnsProportions.Add(new Proportion(ProportionType.Auto));
DragHandle = TitlePanel;

_titleLabel = new Label();
TitleGrid.Widgets.Add(_titleLabel);
StackPanel.SetProportionType(_titleLabel, ProportionType.Fill);
TitlePanel.Widgets.Add(_titleLabel);

CloseButton = new ImageButton();
Grid.SetColumn(CloseButton, 1);

CloseButton.Click += (sender, args) =>
{
Close();
};

TitleGrid.Widgets.Add(CloseButton);
TitlePanel.Widgets.Add(CloseButton);

InternalChild.Widgets.Add(TitleGrid);
InternalChild.Widgets.Add(TitlePanel);

SetStyle(styleName);
}
Expand Down

0 comments on commit 647f0f7

Please sign in to comment.