Changed: fixes for form designer

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

No files matched your search

+27 -5
View File
@@ -9,7 +9,11 @@ namespace AppLauncher.Windows.Forms
{
protected readonly Color borderColour = Color.FromArgb(232, 231, 236);
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 titleColour = Color.FromArgb(156, 158, 171);
protected readonly int titleBarHeight = 56;
private bool isDragging = false;
@@ -36,7 +40,10 @@ namespace AppLauncher.Windows.Forms
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)
@@ -62,6 +69,12 @@ namespace AppLauncher.Windows.Forms
panel1.Width = this.DisplayRectangle.Width;
panel1.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom);
if (this.DesignMode)
{
imageBox1.Visible = imageBox2.Visible = imageBox3.Visible = false;
panel1.Visible = false;
}
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.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)]
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)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[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")]
public ContextMenuStrip TitleContextMenuStrip { get; set; } = null;
@@ -334,6 +347,15 @@ namespace AppLauncher.Windows.Forms
else if (e.Button == MouseButtons.Right)
{
this.TopMost = !this.TopMost;
if (this.TopMost)
{
imageBox2.Image = imageBox2.ImageNormal = Resource1.maximise3_20;
}
else
{
imageBox2.Image = imageBox2.ImageNormal = Resource1.maximise_20;
}
}
}