Fixed: layout sometimes doesn't load
This commit is contained in:
parent
30149df2a4
commit
eff57558ca
12
MainForm.cs
12
MainForm.cs
@ -431,6 +431,18 @@ namespace AppLauncher
|
||||
//
|
||||
ThreadControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop);
|
||||
ThreadControl.SetVisible(this, true);
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new MethodInvoker(() => {
|
||||
this.Focus();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Focus();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Fizzy App Launcher")]
|
||||
[assembly: AssemblyTitle("Fizzy Launcher")]
|
||||
[assembly: AssemblyDescription("Application and shortcut launcher")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Hi, I'm Ray")]
|
||||
[assembly: AssemblyProduct("Fizzy App Launcher")]
|
||||
[assembly: AssemblyProduct("Fizzy Launcher")]
|
||||
[assembly: AssemblyCopyright("Copyright © Ray Lam 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.1.94")]
|
||||
[assembly: AssemblyVersion("0.1.1.064")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
@ -149,7 +149,7 @@ namespace AppLauncher.Windows.Forms
|
||||
|
||||
g.DrawImageUnscaled(Properties.Resources.app_icon_24, 17, 17);
|
||||
|
||||
TextRenderer.DrawText(g, "Fizzy App Launcher", new Font(this.Font.FontFamily, 14F), new Point(58, 17), Color.FromArgb(156, 158, 171));
|
||||
TextRenderer.DrawText(g, "Fizzy Launcher", new Font(this.Font.FontFamily, 14F), new Point(58, 17), Color.FromArgb(156, 158, 171));
|
||||
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace AppLauncher.Windows.Forms
|
||||
protected readonly int collapseIncrement = 6;
|
||||
protected readonly int expandIncrement = 8;
|
||||
|
||||
protected TileGroupModel groupInfo = null;
|
||||
protected TileGroupModel groupModel = null;
|
||||
protected List<Item> items = new List<Item>();
|
||||
|
||||
protected int collapseHeight = 0;
|
||||
@ -132,7 +132,7 @@ namespace AppLauncher.Windows.Forms
|
||||
|
||||
g.DrawImageUnscaled((isChecked ? Properties.Resources.toggle_right_ea_16 : Properties.Resources.toggle_left_ea_16), 2, 2);
|
||||
|
||||
TextRenderer.DrawText(g, groupInfo?.Title, new Font(this.Font.FontFamily, 8.25F), new Point(25, 4), Color.FromArgb(99, 105, 119));
|
||||
TextRenderer.DrawText(g, groupModel?.Title, new Font(this.Font.FontFamily, 8.25F), new Point(25, 4), Color.FromArgb(99, 105, 119));
|
||||
}
|
||||
|
||||
protected override async void OnResize(EventArgs e)
|
||||
@ -224,10 +224,10 @@ namespace AppLauncher.Windows.Forms
|
||||
{
|
||||
TileGroupModel rs = new TileGroupModel()
|
||||
{
|
||||
Title = groupInfo.Title,
|
||||
Title = groupModel.Title,
|
||||
GridSize = new Size(this.GridSize.X, this.GridSize.Y),
|
||||
IsExpanded = isChecked,
|
||||
IsExclusive = groupInfo.IsExclusive,
|
||||
IsExclusive = groupModel.IsExclusive,
|
||||
Items = this.Tiles
|
||||
};
|
||||
|
||||
@ -409,26 +409,27 @@ namespace AppLauncher.Windows.Forms
|
||||
}));
|
||||
}
|
||||
|
||||
public void AddRow() =>this.SetGridSize(groupInfo.GridSize.Width, (groupInfo.GridSize.Height + 1));
|
||||
public void AddRow() =>this.SetGridSize(groupModel.GridSize.Width, (groupModel.GridSize.Height + 1));
|
||||
|
||||
public void EditGroup() => EditGroupForm.ShowDialog(this);
|
||||
|
||||
public void LoadModel(TileGroupModel model)
|
||||
{
|
||||
groupInfo = model;
|
||||
groupModel = model;
|
||||
|
||||
isChecked = groupInfo.IsExpanded;
|
||||
isChecked = groupModel.IsExpanded;
|
||||
|
||||
this.SetGridSize(groupInfo.GridSize.Width, groupInfo.GridSize.Height);
|
||||
this.SetGridSize(groupModel.GridSize.Width, groupModel.GridSize.Height);
|
||||
this.LoadTiles(model.Items);
|
||||
this.SetGridSize(groupModel.GridSize.Width, groupModel.GridSize.Height);
|
||||
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
public void UpdateModel(TileGroupModel model)
|
||||
{
|
||||
groupInfo = model;
|
||||
isChecked = groupInfo.IsExpanded;
|
||||
groupModel = model;
|
||||
isChecked = groupModel.IsExpanded;
|
||||
|
||||
this.Invalidate();
|
||||
}
|
||||
@ -581,7 +582,9 @@ namespace AppLauncher.Windows.Forms
|
||||
|
||||
expandedHeight = (this.TileSize * height) + labelHeight;
|
||||
|
||||
this.Size = new Size((this.TileSize * width), (isChecked ? this.ExpandedHeight : this.CollapseHeight));
|
||||
int w = (this.TileSize * gridSize.X);
|
||||
|
||||
this.Size = new Size(w, (isChecked ? this.ExpandedHeight : this.CollapseHeight));
|
||||
}
|
||||
|
||||
protected Point convertCoordToLocation(Point position) => new Point((position.X * this.TileSize), ((position.Y * this.TileSize) + labelHeight));
|
||||
|
Reference in New Issue
Block a user