Added: minimise to tray icon + new icon

This commit is contained in:
Ray committed 2020-05-17 12:28:21 +01:00
1 parent b0d2c625ab
commit 557395b941
18 files changed
+1037 -137

No files matched your search

+40 -32
View File
@@ -21,14 +21,20 @@
}
protected ButtonState controlState = ButtonState.Idle;
protected bool isSelected = false;
public TButton() : base()
public TButton() : base()
{
InitializeComponent();
label1.ImageAlign = ContentAlignment.MiddleCenter;
label1.Click += delegate { this.OnClick(null); };
this.StyleDefault = new ButtonStyle() { BackColour = Color.White, PenColour = Color.Black, ForeImage = this.DefaultImage };
this.StyleDown = new ButtonStyle() { BackColour = Color.FromArgb(179, 179, 179), PenColour = Color.Black, ForeImage = this.DownImage };
this.StyleOver = new ButtonStyle() { BackColour = Color.FromArgb(51, 51, 51), PenColour = Color.White, ForeImage = this.OverImage };
this.StyleSelected = new ButtonStyle() { BackColour = Color.FromArgb(51, 51, 51), PenColour = Color.White, ForeImage = this.OverImage };
label1.Click += delegate { this.OnClick(null); };
label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; };
label1.MouseLeave += delegate { this.VisualState = ButtonState.Idle; };
label1.MouseDown += delegate { this.VisualState = ButtonState.Down; };
@@ -39,26 +45,6 @@
{
base.OnLoad(e);
// customise
this.StyleOver = new ButtonStyle()
{
BackColour = Color.FromArgb(51, 51, 51),
PenColour = Color.White,
ForeImage = this.OverImage
};
this.StyleDown = new ButtonStyle()
{
BackColour = Color.FromArgb(179, 179, 179),
PenColour = Color.Black,
ForeImage = this.DownImage
};
this.StyleDefault = new ButtonStyle()
{
BackColour = Color.White,
PenColour = Color.Black,
ForeImage = this.DefaultImage
};
this.VisualState = ButtonState.Idle;
}
@@ -76,8 +62,15 @@
}
else
{
updateButton(StyleDefault);
}
if (this.IsSelected)
{
updateButton(StyleSelected);
}
else
{
updateButton(StyleDefault);
}
}
break;
case ButtonState.Hover:
@@ -87,8 +80,16 @@
updateButton(StyleDown);
break;
default:
updateButton(StyleDefault);
break;
if (this.IsSelected)
{
updateButton(StyleSelected);
}
else
{
updateButton(StyleDefault);
}
break;
}
controlState = value;
@@ -118,14 +119,21 @@
[Category("Appearance")]
public Image DefaultImage { get; set; } = null;
[Browsable(false)]
public ButtonStyle StyleOver { get; set; } = new ButtonStyle();
public bool IsSelected
{
get => isSelected;
set
{
isSelected = value;
[Browsable(false)]
public ButtonStyle StyleDown { get; set; } = new ButtonStyle();
this.VisualState = this.VisualState;
}
}
[Browsable(false)]
public ButtonStyle StyleDefault { get; set; } = new ButtonStyle();
protected ButtonStyle StyleOver { get; set; } = new ButtonStyle();
protected ButtonStyle StyleDown { get; set; } = new ButtonStyle();
protected ButtonStyle StyleDefault { get; set; } = new ButtonStyle();
protected ButtonStyle StyleSelected { get; set; } = new ButtonStyle();
public void PerformClick() => this.OnClick(null);
}
@@ -84,10 +84,10 @@
public System.Windows.Forms.TextBox InnerTextBox { get => textBox1; set => textBox1 = value; }
[Category("Appearance"), Browsable(true)]
public Image NormalImage { get => imageBox1.NormalImage; set => imageBox1.NormalImage = value; }
public Image NormalImage { get => imageBox1.ImageNormal; set => imageBox1.ImageNormal = value; }
[Category("Appearance"), Browsable(true)]
public Image HighlightImage { get => imageBox1.HighlightImage; set => imageBox1.HighlightImage = value; }
public Image HighlightImage { get => imageBox1.ImageHover; set => imageBox1.ImageHover = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
+2 -2
View File
@@ -48,12 +48,12 @@
this.imageBox1.BackColor = System.Drawing.Color.Transparent;
this.imageBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox1.ErrorImage = null;
this.imageBox1.HighlightImage = null;
this.imageBox1.ImageHover = null;
this.imageBox1.Image = null;
this.imageBox1.InitialImage = null;
this.imageBox1.Location = new System.Drawing.Point(107, 4);
this.imageBox1.Name = "imageBox1";
this.imageBox1.NormalImage = null;
this.imageBox1.ImageNormal = null;
this.imageBox1.Size = new System.Drawing.Size(18, 25);
this.imageBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox1.TabIndex = 1;
+2 -2
View File
@@ -50,12 +50,12 @@
this.imgbxClose.BackColor = System.Drawing.Color.Transparent;
this.imgbxClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxClose.ErrorImage = null;
this.imgbxClose.HighlightImage = global::AppLauncher.Resource1.close2_16;
this.imgbxClose.ImageHover = global::AppLauncher.Resource1.close2_16;
this.imgbxClose.Image = null;
this.imgbxClose.InitialImage = null;
this.imgbxClose.Location = new System.Drawing.Point(308, 4);
this.imgbxClose.Name = "imgbxClose";
this.imgbxClose.NormalImage = global::AppLauncher.Resource1.close_16;
this.imgbxClose.ImageNormal = global::AppLauncher.Resource1.close_16;
this.imgbxClose.Size = new System.Drawing.Size(24, 24);
this.imgbxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxClose.TabIndex = 145;
+10 -10
View File
@@ -60,12 +60,12 @@
this.imageBox5.BackColor = System.Drawing.Color.Transparent;
this.imageBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox5.ErrorImage = null;
this.imageBox5.HighlightImage = global::AppLauncher.Resource1.edit2;
this.imageBox5.ImageHover = global::AppLauncher.Resource1.edit2;
this.imageBox5.Image = global::AppLauncher.Resource1.edit;
this.imageBox5.InitialImage = null;
this.imageBox5.Location = new System.Drawing.Point(52, 94);
this.imageBox5.Name = "imageBox5";
this.imageBox5.NormalImage = global::AppLauncher.Resource1.edit;
this.imageBox5.ImageNormal = global::AppLauncher.Resource1.edit;
this.imageBox5.Size = new System.Drawing.Size(18, 25);
this.imageBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox5.TabIndex = 6;
@@ -79,12 +79,12 @@
this.imageBox4.BackColor = System.Drawing.Color.Transparent;
this.imageBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox4.ErrorImage = null;
this.imageBox4.HighlightImage = global::AppLauncher.Resource1.arrow_down2;
this.imageBox4.ImageHover = global::AppLauncher.Resource1.arrow_down2;
this.imageBox4.Image = global::AppLauncher.Resource1.arrow_down;
this.imageBox4.InitialImage = null;
this.imageBox4.Location = new System.Drawing.Point(100, 94);
this.imageBox4.Name = "imageBox4";
this.imageBox4.NormalImage = global::AppLauncher.Resource1.arrow_down;
this.imageBox4.ImageNormal = global::AppLauncher.Resource1.arrow_down;
this.imageBox4.Size = new System.Drawing.Size(18, 25);
this.imageBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox4.TabIndex = 5;
@@ -98,12 +98,12 @@
this.imageBox3.BackColor = System.Drawing.Color.Transparent;
this.imageBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox3.ErrorImage = null;
this.imageBox3.HighlightImage = global::AppLauncher.Resource1.arrow_up2;
this.imageBox3.ImageHover = global::AppLauncher.Resource1.arrow_up2;
this.imageBox3.Image = global::AppLauncher.Resource1.arrow_up;
this.imageBox3.InitialImage = null;
this.imageBox3.Location = new System.Drawing.Point(76, 94);
this.imageBox3.Name = "imageBox3";
this.imageBox3.NormalImage = global::AppLauncher.Resource1.arrow_up;
this.imageBox3.ImageNormal = global::AppLauncher.Resource1.arrow_up;
this.imageBox3.Size = new System.Drawing.Size(18, 25);
this.imageBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox3.TabIndex = 4;
@@ -117,12 +117,12 @@
this.imageBox2.BackColor = System.Drawing.Color.Transparent;
this.imageBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox2.ErrorImage = null;
this.imageBox2.HighlightImage = global::AppLauncher.Resource1.minus2;
this.imageBox2.ImageHover = global::AppLauncher.Resource1.minus2;
this.imageBox2.Image = global::AppLauncher.Resource1.minus;
this.imageBox2.InitialImage = null;
this.imageBox2.Location = new System.Drawing.Point(28, 94);
this.imageBox2.Name = "imageBox2";
this.imageBox2.NormalImage = global::AppLauncher.Resource1.minus;
this.imageBox2.ImageNormal = global::AppLauncher.Resource1.minus;
this.imageBox2.Size = new System.Drawing.Size(18, 25);
this.imageBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox2.TabIndex = 3;
@@ -136,12 +136,12 @@
this.imageBox1.BackColor = System.Drawing.Color.Transparent;
this.imageBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox1.ErrorImage = null;
this.imageBox1.HighlightImage = global::AppLauncher.Resource1.plus2;
this.imageBox1.ImageHover = global::AppLauncher.Resource1.plus2;
this.imageBox1.Image = global::AppLauncher.Resource1.plus;
this.imageBox1.InitialImage = null;
this.imageBox1.Location = new System.Drawing.Point(4, 94);
this.imageBox1.Name = "imageBox1";
this.imageBox1.NormalImage = global::AppLauncher.Resource1.plus;
this.imageBox1.ImageNormal = global::AppLauncher.Resource1.plus;
this.imageBox1.Size = new System.Drawing.Size(18, 25);
this.imageBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox1.TabIndex = 2;