Changed: fixes for form designer

This commit is contained in:
Ray 2020-10-20 22:42:40 +01:00
parent 96af2b6b3d
commit b635db2be6
6 changed files with 43 additions and 7 deletions

View File

@ -260,6 +260,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="favicon.ico" /> <Content Include="favicon.ico" />
<None Include="RyzStudio\Windows\Forms\Resources\maximise3_20.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.1.1.109")] [assembly: AssemblyFileVersion("0.1.1.113")]

12
Resource1.Designer.cs generated
View File

@ -19,7 +19,7 @@ namespace AppLauncher {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resource1 { internal class Resource1 {
@ -220,6 +220,16 @@ namespace AppLauncher {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap maximise3_20 {
get {
object obj = ResourceManager.GetObject("maximise3_20", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@ -163,6 +163,9 @@
<data name="maximise2_20" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="maximise2_20" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>RyzStudio\Windows\Forms\Resources\maximise2_20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>RyzStudio\Windows\Forms\Resources\maximise2_20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="maximise3_20" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>RyzStudio\Windows\Forms\Resources\maximise3_20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="maximise_20" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="maximise_20" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>RyzStudio\Windows\Forms\Resources\maximise_20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>RyzStudio\Windows\Forms\Resources\maximise_20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View File

@ -9,7 +9,11 @@ namespace AppLauncher.Windows.Forms
{ {
protected readonly Color borderColour = Color.FromArgb(232, 231, 236); protected readonly Color borderColour = Color.FromArgb(232, 231, 236);
protected readonly int borderWidth = 1; protected readonly int borderWidth = 1;
protected readonly Color backColour = Color.FromArgb(254, 254, 254);
protected readonly Color titleBarColour = Color.FromArgb(237, 240, 247); protected readonly Color titleBarColour = Color.FromArgb(237, 240, 247);
protected readonly Color titleColour = Color.FromArgb(156, 158, 171);
protected readonly int titleBarHeight = 56; protected readonly int titleBarHeight = 56;
private bool isDragging = false; private bool isDragging = false;
@ -36,7 +40,10 @@ namespace AppLauncher.Windows.Forms
this.StartPosition = FormStartPosition.Manual; this.StartPosition = FormStartPosition.Manual;
} }
notifyIcon1.Text = "Fizzy App Launcher"; this.BackColor = backColour;
this.Padding = new Padding(0);
notifyIcon1.Text = Application.ProductName;
} }
protected override void OnLoad(EventArgs e) protected override void OnLoad(EventArgs e)
@ -62,6 +69,12 @@ namespace AppLauncher.Windows.Forms
panel1.Width = this.DisplayRectangle.Width; panel1.Width = this.DisplayRectangle.Width;
panel1.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom); panel1.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom);
if (this.DesignMode)
{
imageBox1.Visible = imageBox2.Visible = imageBox3.Visible = false;
panel1.Visible = false;
}
this.ResumeLayout(); this.ResumeLayout();
} }
@ -147,9 +160,9 @@ namespace AppLauncher.Windows.Forms
g.FillRectangle(new SolidBrush(titleBarColour), area.X, area.Y, (area.Width + area.X), titleBarHeight); g.FillRectangle(new SolidBrush(titleBarColour), area.X, area.Y, (area.Width + area.X), titleBarHeight);
g.DrawLine(new Pen(borderColour, 1), area.X, (titleBarHeight + 1), (area.Width + area.X), (titleBarHeight + 1)); g.DrawLine(new Pen(borderColour, 1), area.X, (titleBarHeight + 1), (area.Width + area.X), (titleBarHeight + 1));
g.DrawImageUnscaled(Properties.Resources.app_icon_24, 17, 17); if (!DesignMode) g.DrawImageUnscaled(Properties.Resources.app_icon_24, 17, 17);
TextRenderer.DrawText(g, Application.ProductName, new Font(this.Font.FontFamily, 14F), new Point(58, 17), Color.FromArgb(156, 158, 171)); if (!DesignMode) TextRenderer.DrawText(g, Application.ProductName, new Font(this.Font.FontFamily, 14F), new Point(58, 17), titleColour);
} }
@ -161,13 +174,13 @@ namespace AppLauncher.Windows.Forms
} }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Color BackColor { get => base.BackColor; set => base.BackColor = Color.FromArgb(254, 254, 254); } public override Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; } public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = new Padding(0); } public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance")] [Category("Appearance")]
public ContextMenuStrip TitleContextMenuStrip { get; set; } = null; public ContextMenuStrip TitleContextMenuStrip { get; set; } = null;
@ -334,6 +347,15 @@ namespace AppLauncher.Windows.Forms
else if (e.Button == MouseButtons.Right) else if (e.Button == MouseButtons.Right)
{ {
this.TopMost = !this.TopMost; this.TopMost = !this.TopMost;
if (this.TopMost)
{
imageBox2.Image = imageBox2.ImageNormal = Resource1.maximise3_20;
}
else
{
imageBox2.Image = imageBox2.ImageNormal = Resource1.maximise_20;
}
} }
} }