Clean-up
This commit is contained in:
parent
adeb97dbb5
commit
7722340560
@ -122,7 +122,6 @@
|
||||
<Compile Include="RyzStudio\Windows\ThemedForms\TextButtonBox.designer.cs">
|
||||
<DependentUpon>TextButtonBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RyzStudio\Windows\ThemedForms\ThemeStyle.cs" />
|
||||
<Compile Include="RyzStudio\Windows\ThemedForms\UserControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -106,7 +106,19 @@ namespace RyzStudio.Windows.Forms
|
||||
[Browsable(false)]
|
||||
public Style StyleDefault { get; set; } = new Style();
|
||||
|
||||
public void PerformClick() => this.OnClick(null);
|
||||
public void PerformClick()
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new MethodInvoker(() => {
|
||||
this.OnClick(null);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnClick(null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
namespace RyzStudio.Windows.ThemedForms
|
||||
{
|
||||
public enum ButtonState
|
||||
{
|
||||
Normal = 0,
|
||||
Hover,
|
||||
Down
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
namespace RyzStudio.Windows.ThemedForms
|
||||
{
|
||||
using System.Drawing;
|
||||
|
||||
public class ButtonStyle
|
||||
{
|
||||
public Color BackColour { get; set; }
|
||||
public Color PenColour { get; set; }
|
||||
public Image ForeImage { get; set; } = null;
|
||||
|
||||
public ButtonStyle(Color backColour, Color penColour)
|
||||
{
|
||||
this.BackColour = backColour;
|
||||
this.PenColour = penColour;
|
||||
this.ForeImage = null;
|
||||
}
|
||||
|
||||
public ButtonStyle(Color backColour, Color penColour, Image foreImage)
|
||||
{
|
||||
this.BackColour = backColour;
|
||||
this.PenColour = penColour;
|
||||
this.ForeImage = foreImage;
|
||||
}
|
||||
}
|
||||
}
|
@ -6,11 +6,11 @@
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
public partial class TextButtonBox : RyzStudio.Windows.ThemedForms.UserControl
|
||||
public partial class ButtonTextBox : RyzStudio.Windows.ThemedForms.UserControl
|
||||
{
|
||||
protected readonly Padding textboxPadding = new Padding(6, 6, 6, 6);
|
||||
|
||||
public TextButtonBox() : base()
|
||||
public ButtonTextBox() : base()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
|
||||
break;
|
||||
case Keys.Escape:
|
||||
tryClose();
|
||||
close();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
@ -112,7 +112,7 @@
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public new Padding Margin { get { return base.Margin; } set { base.Margin = value; } }
|
||||
|
||||
protected override void updateBackground(Graphics g, ThemeStyle style)
|
||||
protected override void updateBackground(Graphics g, Style style)
|
||||
{
|
||||
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace RyzStudio.Windows.ThemedForms
|
||||
{
|
||||
partial class TextButtonBox
|
||||
partial class ButtonTextBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
@ -50,7 +50,7 @@
|
||||
|
||||
break;
|
||||
case Keys.Escape:
|
||||
tryClose();
|
||||
close();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
@ -83,7 +83,7 @@
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public new Padding Margin { get => base.Margin; set => base.Margin = value; }
|
||||
|
||||
protected override void updateBackground(Graphics g, ThemeStyle style)
|
||||
protected override void updateBackground(Graphics g, Style style)
|
||||
{
|
||||
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
break;
|
||||
case Keys.Escape:
|
||||
tryClose();
|
||||
close();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
@ -82,7 +82,7 @@
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public new Padding Margin { get { return base.Margin; } set { base.Margin = value; } }
|
||||
|
||||
protected override void updateBackground(Graphics g, ThemeStyle style)
|
||||
protected override void updateBackground(Graphics g, Style style)
|
||||
{
|
||||
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
|
||||
|
||||
|
@ -1,34 +0,0 @@
|
||||
namespace RyzStudio.Windows.ThemedForms
|
||||
{
|
||||
using System.Drawing;
|
||||
|
||||
public struct ThemeStyle
|
||||
{
|
||||
public int BorderWidth;
|
||||
public int BorderRadius;
|
||||
public int BorderPadding;
|
||||
public Color BorderColour;
|
||||
public Color BackColour;
|
||||
public Color ForeColour;
|
||||
|
||||
public ThemeStyle(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour)
|
||||
{
|
||||
this.BorderWidth = borderWidth;
|
||||
this.BorderRadius = borderRadius;
|
||||
this.BorderPadding = borderPadding;
|
||||
this.BorderColour = borderColour;
|
||||
this.BackColour = backColour;
|
||||
this.ForeColour = Color.Black;
|
||||
}
|
||||
|
||||
public ThemeStyle(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour, Color foreColour)
|
||||
{
|
||||
this.BorderWidth = borderWidth;
|
||||
this.BorderRadius = borderRadius;
|
||||
this.BorderPadding = borderPadding;
|
||||
this.BorderColour = borderColour;
|
||||
this.BackColour = backColour;
|
||||
this.ForeColour = foreColour;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,44 @@
|
||||
namespace RyzStudio.Windows.ThemedForms
|
||||
{
|
||||
using System;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using RyzStudio.Drawing;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace RyzStudio.Windows.ThemedForms
|
||||
{
|
||||
public partial class UserControl : System.Windows.Forms.UserControl
|
||||
{
|
||||
//protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(112, 112, 112), Color.White);
|
||||
protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White);
|
||||
public class Style
|
||||
{
|
||||
public int BorderWidth;
|
||||
public int BorderRadius;
|
||||
public int BorderPadding;
|
||||
public Color BorderColour;
|
||||
public Color BackColour;
|
||||
public Color ForeColour;
|
||||
|
||||
public Style(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour)
|
||||
{
|
||||
this.BorderWidth = borderWidth;
|
||||
this.BorderRadius = borderRadius;
|
||||
this.BorderPadding = borderPadding;
|
||||
this.BorderColour = borderColour;
|
||||
this.BackColour = backColour;
|
||||
this.ForeColour = Color.Black;
|
||||
}
|
||||
|
||||
public Style(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour, Color foreColour)
|
||||
{
|
||||
this.BorderWidth = borderWidth;
|
||||
this.BorderRadius = borderRadius;
|
||||
this.BorderPadding = borderPadding;
|
||||
this.BorderColour = borderColour;
|
||||
this.BackColour = backColour;
|
||||
this.ForeColour = foreColour;
|
||||
}
|
||||
}
|
||||
|
||||
protected Style styleActive = new Style(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White);
|
||||
|
||||
public UserControl()
|
||||
{
|
||||
@ -39,7 +68,7 @@
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
|
||||
|
||||
protected virtual void updateBackground(Graphics g, ThemeStyle style)
|
||||
protected virtual void updateBackground(Graphics g, Style style)
|
||||
{
|
||||
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
|
||||
|
||||
@ -50,7 +79,7 @@
|
||||
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
|
||||
}
|
||||
|
||||
protected virtual void tryClose()
|
||||
protected virtual void close()
|
||||
{
|
||||
if (this.Parent == null)
|
||||
{
|
||||
|
@ -23,9 +23,9 @@ namespace AppLauncher.Windows.Forms
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private TextButtonBox textBox2;
|
||||
private ButtonTextBox textBox2;
|
||||
private TextBox textBox3;
|
||||
private TextButtonBox textBox4;
|
||||
private ButtonTextBox textBox4;
|
||||
private Button button1;
|
||||
private PickerBox pickerBox1;
|
||||
private PickerBox pickerBox2;
|
||||
@ -63,9 +63,9 @@ namespace AppLauncher.Windows.Forms
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox2 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
|
||||
this.textBox2 = new RyzStudio.Windows.ThemedForms.ButtonTextBox();
|
||||
this.textBox3 = new RyzStudio.Windows.ThemedForms.TextBox();
|
||||
this.textBox4 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
|
||||
this.textBox4 = new RyzStudio.Windows.ThemedForms.ButtonTextBox();
|
||||
this.button1 = new RyzStudio.Windows.ThemedForms.Button();
|
||||
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.PickerBox();
|
||||
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.PickerBox();
|
||||
|
@ -19,9 +19,9 @@ namespace AppLauncher.Windows.Forms
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private TextButtonBox textBox2;
|
||||
private ButtonTextBox textBox2;
|
||||
private TextBox textBox3;
|
||||
private TextButtonBox textBox4;
|
||||
private ButtonTextBox textBox4;
|
||||
private Button button1;
|
||||
private PickerBox pickerBox1;
|
||||
private PickerBox pickerBox2;
|
||||
@ -56,9 +56,9 @@ namespace AppLauncher.Windows.Forms
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox2 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
|
||||
this.textBox2 = new RyzStudio.Windows.ThemedForms.ButtonTextBox();
|
||||
this.textBox3 = new RyzStudio.Windows.ThemedForms.TextBox();
|
||||
this.textBox4 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
|
||||
this.textBox4 = new RyzStudio.Windows.ThemedForms.ButtonTextBox();
|
||||
this.button1 = new RyzStudio.Windows.ThemedForms.Button();
|
||||
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.PickerBox();
|
||||
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.PickerBox();
|
||||
|
Reference in New Issue
Block a user