More Skinning

You can now set a skin and it will persist throughout all windows -
though there is a bug where hovering over a context button will change
it's color and leaving it will change it back to black. Will fix
soon™️.
This commit is contained in:
AShifter 2017-10-14 09:27:27 -06:00
parent 385d800066
commit e9a8a6df70
6 changed files with 324 additions and 309 deletions

Binary file not shown.

View file

@ -2,33 +2,19 @@
namespace ShiftOS.Engine.WindowManager namespace ShiftOS.Engine.WindowManager
{ {
public class ShiftSkinData public abstract class ShiftSkinData
{ {
// ColorData // ColorData
public Color leftTopCornerColor { get; set; } public static Color leftTopCornerColor = Color.Empty;
public Color titleBarColor { get; set; } public static Color titleBarColor = Color.Empty;
public Color rightTopCornerColor { get; set; } public static Color rightTopCornerColor = Color.Empty;
public Color btnCloseColor { get; set; } public static Color btnCloseColor = Color.Empty;
public Color btnMaxColor { get; set; } public static Color btnMaxColor = Color.Empty;
public Color btnMinColor { get; set; } public static Color btnMinColor = Color.Empty;
public Color leftSideColor { get; set; } public static Color leftSideColor = Color.Empty;
public Color rightSideColor { get; set; } public static Color rightSideColor = Color.Empty;
public Color leftBottomCornerColor { get; set; } public static Color leftBottomCornerColor = Color.Empty;
public Color bottomSideColor { get; set; } public static Color bottomSideColor = Color.Empty;
public Color rightBottomCornerColor { get; set; } public static Color rightBottomCornerColor = Color.Empty;
public Color borderColorColor { get; set; }
// SetBorderColor
public void setBorderColor(Color borderColor)
{
leftTopCornerColor = borderColor;
titleBarColor = borderColor;
rightTopCornerColor = borderColor;
leftSideColor = borderColor;
rightSideColor = borderColor;
leftBottomCornerColor = borderColor;
bottomSideColor = borderColor;
rightBottomCornerColor = borderColor;
}
} }
} }

View file

@ -35,8 +35,37 @@ namespace ShiftOS.Engine.WindowManager
Title = {Text = title} Title = {Text = title}
}; };
app.Width = content.Width + app.left.Width + app.right.Width; app.Width = content.Width + app.leftSide.Width + app.rightSide.Width;
app.Height = content.Height + app.bottom.Height + app.top.Height; app.Height = content.Height + app.bottomSide.Height + app.titleBar.Height;
if (ShiftSkinData.titleBarColor == Color.Empty)
{
Color borderColor = Color.FromArgb(64, 64, 64);
ShiftSkinData.btnCloseColor = Color.Black;
ShiftSkinData.btnMaxColor = Color.Black;
ShiftSkinData.btnMinColor = Color.Black;
ShiftSkinData.leftTopCornerColor = borderColor;
ShiftSkinData.titleBarColor = borderColor;
ShiftSkinData.rightTopCornerColor = borderColor;
ShiftSkinData.leftSideColor = borderColor;
ShiftSkinData.rightSideColor = borderColor;
ShiftSkinData.leftBottomCornerColor = borderColor;
ShiftSkinData.bottomSideColor = borderColor;
ShiftSkinData.rightBottomCornerColor = borderColor;
}
app.btnClose.BackColor = ShiftSkinData.btnCloseColor;
app.btnMax.BackColor = ShiftSkinData.btnMaxColor;
app.btnMin.BackColor = ShiftSkinData.btnMinColor;
app.leftTopCorner.BackColor = ShiftSkinData.leftTopCornerColor;
app.titleBar.BackColor = ShiftSkinData.titleBarColor;
app.rightTopCorner.BackColor = ShiftSkinData.rightTopCornerColor;
app.leftSide.BackColor = ShiftSkinData.leftSideColor;
app.rightSide.BackColor = ShiftSkinData.rightSideColor;
app.leftBottomCorner.BackColor = ShiftSkinData.leftBottomCornerColor;
app.bottomSide.BackColor = ShiftSkinData.bottomSideColor;
app.rightBottomCorner.BackColor = ShiftSkinData.rightBottomCornerColor;
// Icon Setup // Icon Setup
if (icon == null) if (icon == null)

View file

@ -30,166 +30,155 @@
{ {
this.program = new System.Windows.Forms.Panel(); this.program = new System.Windows.Forms.Panel();
this.programContent = new System.Windows.Forms.Panel(); this.programContent = new System.Windows.Forms.Panel();
this.bottomleftcorner = new System.Windows.Forms.Panel(); this.leftBottomCorner = new System.Windows.Forms.Panel();
this.toprightcorner = new System.Windows.Forms.Panel(); this.rightTopCorner = new System.Windows.Forms.Panel();
this.bottomrightcorner = new System.Windows.Forms.Panel(); this.rightBottomCorner = new System.Windows.Forms.Panel();
this.topleftcorner = new System.Windows.Forms.Panel(); this.leftTopCorner = new System.Windows.Forms.Panel();
this.bottom = new System.Windows.Forms.Panel(); this.bottomSide = new System.Windows.Forms.Panel();
this.top = new System.Windows.Forms.Panel(); this.titleBar = new System.Windows.Forms.Panel();
this.programIcon = new System.Windows.Forms.PictureBox(); this.programIcon = new System.Windows.Forms.PictureBox();
this.maximizebutton = new System.Windows.Forms.PictureBox(); this.btnMax = new System.Windows.Forms.PictureBox();
this.minimizebutton = new System.Windows.Forms.PictureBox(); this.btnMin = new System.Windows.Forms.PictureBox();
this.Title = new System.Windows.Forms.Label(); this.Title = new System.Windows.Forms.Label();
this.closebutton = new System.Windows.Forms.PictureBox(); this.btnClose = new System.Windows.Forms.PictureBox();
this.right = new System.Windows.Forms.Panel(); this.rightSide = new System.Windows.Forms.Panel();
this.left = new System.Windows.Forms.Panel(); this.leftSide = new System.Windows.Forms.Panel();
this.program.SuspendLayout(); this.program.SuspendLayout();
this.top.SuspendLayout(); this.titleBar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btnMax)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btnMin)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.closebutton)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btnClose)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// program // program
// //
this.program.BackColor = System.Drawing.Color.White; this.program.BackColor = System.Drawing.Color.White;
this.program.Controls.Add(this.programContent); this.program.Controls.Add(this.programContent);
this.program.Controls.Add(this.bottomleftcorner); this.program.Controls.Add(this.leftBottomCorner);
this.program.Controls.Add(this.toprightcorner); this.program.Controls.Add(this.rightTopCorner);
this.program.Controls.Add(this.bottomrightcorner); this.program.Controls.Add(this.rightBottomCorner);
this.program.Controls.Add(this.topleftcorner); this.program.Controls.Add(this.leftTopCorner);
this.program.Controls.Add(this.bottom); this.program.Controls.Add(this.bottomSide);
this.program.Controls.Add(this.top); this.program.Controls.Add(this.titleBar);
this.program.Controls.Add(this.right); this.program.Controls.Add(this.rightSide);
this.program.Controls.Add(this.left); this.program.Controls.Add(this.leftSide);
this.program.Dock = System.Windows.Forms.DockStyle.Fill; this.program.Dock = System.Windows.Forms.DockStyle.Fill;
this.program.Location = new System.Drawing.Point(0, 0); this.program.Location = new System.Drawing.Point(0, 0);
this.program.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.program.Name = "program"; this.program.Name = "program";
this.program.Size = new System.Drawing.Size(426, 402); this.program.Size = new System.Drawing.Size(284, 261);
this.program.TabIndex = 11; this.program.TabIndex = 11;
// //
// programContent // programContent
// //
this.programContent.Dock = System.Windows.Forms.DockStyle.Fill; this.programContent.Dock = System.Windows.Forms.DockStyle.Fill;
this.programContent.Location = new System.Drawing.Point(6, 46); this.programContent.Location = new System.Drawing.Point(4, 30);
this.programContent.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.programContent.Name = "programContent"; this.programContent.Name = "programContent";
this.programContent.Size = new System.Drawing.Size(414, 350); this.programContent.Size = new System.Drawing.Size(276, 227);
this.programContent.TabIndex = 11; this.programContent.TabIndex = 11;
// //
// bottomleftcorner // leftBottomCorner
// //
this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.leftBottomCorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.bottomleftcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.leftBottomCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.bottomleftcorner.Location = new System.Drawing.Point(0, 395); this.leftBottomCorner.Location = new System.Drawing.Point(0, 257);
this.bottomleftcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.leftBottomCorner.Name = "leftBottomCorner";
this.bottomleftcorner.Name = "bottomleftcorner"; this.leftBottomCorner.Size = new System.Drawing.Size(5, 4);
this.bottomleftcorner.Size = new System.Drawing.Size(8, 6); this.leftBottomCorner.TabIndex = 10;
this.bottomleftcorner.TabIndex = 10;
// //
// toprightcorner // rightTopCorner
// //
this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rightTopCorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.toprightcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.rightTopCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.toprightcorner.Location = new System.Drawing.Point(417, 0); this.rightTopCorner.Location = new System.Drawing.Point(278, 0);
this.toprightcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.rightTopCorner.Name = "rightTopCorner";
this.toprightcorner.Name = "toprightcorner"; this.rightTopCorner.Size = new System.Drawing.Size(6, 30);
this.toprightcorner.Size = new System.Drawing.Size(9, 46); this.rightTopCorner.TabIndex = 9;
this.toprightcorner.TabIndex = 9;
// //
// bottomrightcorner // rightBottomCorner
// //
this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.rightBottomCorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.bottomrightcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.rightBottomCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE; this.rightBottomCorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.bottomrightcorner.Location = new System.Drawing.Point(420, 395); this.rightBottomCorner.Location = new System.Drawing.Point(280, 257);
this.bottomrightcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.rightBottomCorner.Name = "rightBottomCorner";
this.bottomrightcorner.Name = "bottomrightcorner"; this.rightBottomCorner.Size = new System.Drawing.Size(4, 4);
this.bottomrightcorner.Size = new System.Drawing.Size(6, 6); this.rightBottomCorner.TabIndex = 4;
this.bottomrightcorner.TabIndex = 4;
// //
// topleftcorner // leftTopCorner
// //
this.topleftcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.leftTopCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.topleftcorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.leftTopCorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.topleftcorner.Location = new System.Drawing.Point(0, 0); this.leftTopCorner.Location = new System.Drawing.Point(0, 0);
this.topleftcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.leftTopCorner.Name = "leftTopCorner";
this.topleftcorner.Name = "topleftcorner"; this.leftTopCorner.Size = new System.Drawing.Size(7, 30);
this.topleftcorner.Size = new System.Drawing.Size(10, 46); this.leftTopCorner.TabIndex = 8;
this.topleftcorner.TabIndex = 8;
// //
// bottom // bottomSide
// //
this.bottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.bottomSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.bottom.Cursor = System.Windows.Forms.Cursors.SizeNS; this.bottomSide.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.bottom.Dock = System.Windows.Forms.DockStyle.Bottom; this.bottomSide.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottom.Location = new System.Drawing.Point(6, 396); this.bottomSide.Location = new System.Drawing.Point(4, 257);
this.bottom.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.bottomSide.Name = "bottomSide";
this.bottom.Name = "bottom"; this.bottomSide.Size = new System.Drawing.Size(276, 4);
this.bottom.Size = new System.Drawing.Size(414, 6); this.bottomSide.TabIndex = 3;
this.bottom.TabIndex = 3;
// //
// top // titleBar
// //
this.top.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.titleBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.top.Controls.Add(this.programIcon); this.titleBar.Controls.Add(this.programIcon);
this.top.Controls.Add(this.maximizebutton); this.titleBar.Controls.Add(this.btnMax);
this.top.Controls.Add(this.minimizebutton); this.titleBar.Controls.Add(this.btnMin);
this.top.Controls.Add(this.Title); this.titleBar.Controls.Add(this.Title);
this.top.Controls.Add(this.closebutton); this.titleBar.Controls.Add(this.btnClose);
this.top.Dock = System.Windows.Forms.DockStyle.Top; this.titleBar.Dock = System.Windows.Forms.DockStyle.Top;
this.top.ForeColor = System.Drawing.SystemColors.ControlText; this.titleBar.ForeColor = System.Drawing.SystemColors.ControlText;
this.top.Location = new System.Drawing.Point(6, 0); this.titleBar.Location = new System.Drawing.Point(4, 0);
this.top.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.titleBar.Name = "titleBar";
this.top.Name = "top"; this.titleBar.Size = new System.Drawing.Size(276, 30);
this.top.Size = new System.Drawing.Size(414, 46); this.titleBar.TabIndex = 0;
this.top.TabIndex = 0; this.titleBar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag);
this.top.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag);
// //
// programIcon // programIcon
// //
this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.programIcon.ErrorImage = null; this.programIcon.ErrorImage = null;
this.programIcon.InitialImage = null; this.programIcon.InitialImage = null;
this.programIcon.Location = new System.Drawing.Point(9, 11); this.programIcon.Location = new System.Drawing.Point(6, 7);
this.programIcon.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.programIcon.Name = "programIcon"; this.programIcon.Name = "programIcon";
this.programIcon.Size = new System.Drawing.Size(24, 25); this.programIcon.Size = new System.Drawing.Size(16, 16);
this.programIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.programIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.programIcon.TabIndex = 7; this.programIcon.TabIndex = 7;
this.programIcon.TabStop = false; this.programIcon.TabStop = false;
// //
// maximizebutton // btnMax
// //
this.maximizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; this.btnMax.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.maximizebutton.BackColor = System.Drawing.Color.Black; this.btnMax.BackColor = System.Drawing.Color.Black;
this.maximizebutton.Location = new System.Drawing.Point(345, 6); this.btnMax.Location = new System.Drawing.Point(230, 4);
this.maximizebutton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnMax.Name = "btnMax";
this.maximizebutton.Name = "maximizebutton"; this.btnMax.Size = new System.Drawing.Size(21, 21);
this.maximizebutton.Size = new System.Drawing.Size(32, 32); this.btnMax.TabIndex = 6;
this.maximizebutton.TabIndex = 6; this.btnMax.TabStop = false;
this.maximizebutton.TabStop = false; this.btnMax.MouseDown += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseDown);
this.maximizebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseDown); this.btnMax.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter);
this.maximizebutton.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter); this.btnMax.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave);
this.maximizebutton.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave); this.btnMax.MouseUp += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseUp);
this.maximizebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseUp);
// //
// minimizebutton // btnMin
// //
this.minimizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; this.btnMin.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.minimizebutton.BackColor = System.Drawing.Color.Black; this.btnMin.BackColor = System.Drawing.Color.Black;
this.minimizebutton.Location = new System.Drawing.Point(310, 6); this.btnMin.Location = new System.Drawing.Point(207, 4);
this.minimizebutton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnMin.Name = "btnMin";
this.minimizebutton.Name = "minimizebutton"; this.btnMin.Size = new System.Drawing.Size(21, 21);
this.minimizebutton.Size = new System.Drawing.Size(32, 32); this.btnMin.TabIndex = 5;
this.minimizebutton.TabIndex = 5; this.btnMin.TabStop = false;
this.minimizebutton.TabStop = false; this.btnMin.MouseDown += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseDown);
this.minimizebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseDown); this.btnMin.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter);
this.minimizebutton.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter); this.btnMin.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave);
this.minimizebutton.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave); this.btnMin.MouseUp += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseUp);
this.minimizebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseUp);
// //
// Title // Title
// //
@ -197,68 +186,63 @@
this.Title.BackColor = System.Drawing.Color.Transparent; this.Title.BackColor = System.Drawing.Color.Transparent;
this.Title.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Title.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Title.ForeColor = System.Drawing.Color.White; this.Title.ForeColor = System.Drawing.Color.White;
this.Title.Location = new System.Drawing.Point(38, 12); this.Title.Location = new System.Drawing.Point(25, 8);
this.Title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Title.Name = "Title"; this.Title.Name = "Title";
this.Title.Size = new System.Drawing.Size(149, 21); this.Title.Size = new System.Drawing.Size(98, 13);
this.Title.TabIndex = 3; this.Title.TabIndex = 3;
this.Title.Text = "Application Title"; this.Title.Text = "Application Title";
this.Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag); this.Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag);
// //
// closebutton // btnClose
// //
this.closebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; this.btnClose.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.closebutton.BackColor = System.Drawing.Color.Black; this.btnClose.BackColor = System.Drawing.Color.Black;
this.closebutton.Location = new System.Drawing.Point(380, 6); this.btnClose.Location = new System.Drawing.Point(253, 4);
this.closebutton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnClose.Name = "btnClose";
this.closebutton.Name = "closebutton"; this.btnClose.Size = new System.Drawing.Size(21, 21);
this.closebutton.Size = new System.Drawing.Size(32, 32); this.btnClose.TabIndex = 4;
this.closebutton.TabIndex = 4; this.btnClose.TabStop = false;
this.closebutton.TabStop = false; this.btnClose.Click += new System.EventHandler(this.closebutton_Click);
this.closebutton.Click += new System.EventHandler(this.closebutton_Click); this.btnClose.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown);
this.closebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown); this.btnClose.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter);
this.closebutton.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter); this.btnClose.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave);
this.closebutton.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave); this.btnClose.MouseUp += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseUp);
this.closebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseUp);
// //
// right // rightSide
// //
this.right.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.rightSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.right.Cursor = System.Windows.Forms.Cursors.SizeWE; this.rightSide.Cursor = System.Windows.Forms.Cursors.SizeWE;
this.right.Dock = System.Windows.Forms.DockStyle.Right; this.rightSide.Dock = System.Windows.Forms.DockStyle.Right;
this.right.Location = new System.Drawing.Point(420, 0); this.rightSide.Location = new System.Drawing.Point(280, 0);
this.right.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.rightSide.Name = "rightSide";
this.right.Name = "right"; this.rightSide.Size = new System.Drawing.Size(4, 261);
this.right.Size = new System.Drawing.Size(6, 402); this.rightSide.TabIndex = 2;
this.right.TabIndex = 2;
// //
// left // leftSide
// //
this.left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.leftSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.left.Dock = System.Windows.Forms.DockStyle.Left; this.leftSide.Dock = System.Windows.Forms.DockStyle.Left;
this.left.Location = new System.Drawing.Point(0, 0); this.leftSide.Location = new System.Drawing.Point(0, 0);
this.left.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.leftSide.Name = "leftSide";
this.left.Name = "left"; this.leftSide.Size = new System.Drawing.Size(4, 261);
this.left.Size = new System.Drawing.Size(6, 402); this.leftSide.TabIndex = 1;
this.left.TabIndex = 1;
// //
// ShiftWindow // ShiftWindow
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(426, 402); this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.program); this.Controls.Add(this.program);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "ShiftWindow"; this.Name = "ShiftWindow";
this.Text = "c"; this.Text = "c";
this.program.ResumeLayout(false); this.program.ResumeLayout(false);
this.top.ResumeLayout(false); this.titleBar.ResumeLayout(false);
this.top.PerformLayout(); this.titleBar.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.programIcon)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.programIcon)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnMax)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnMin)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.closebutton)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnClose)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -267,17 +251,17 @@
public System.Windows.Forms.PictureBox programIcon; public System.Windows.Forms.PictureBox programIcon;
public System.Windows.Forms.Panel programContent; public System.Windows.Forms.Panel programContent;
public System.Windows.Forms.Panel program; public System.Windows.Forms.Panel program;
public System.Windows.Forms.Panel bottomleftcorner; public System.Windows.Forms.Panel leftBottomCorner;
public System.Windows.Forms.Panel toprightcorner; public System.Windows.Forms.Panel rightTopCorner;
public System.Windows.Forms.Panel bottomrightcorner; public System.Windows.Forms.Panel rightBottomCorner;
public System.Windows.Forms.Panel topleftcorner; public System.Windows.Forms.Panel leftTopCorner;
public System.Windows.Forms.Panel bottom; public System.Windows.Forms.Panel bottomSide;
public System.Windows.Forms.Panel top; public System.Windows.Forms.Panel titleBar;
public System.Windows.Forms.PictureBox maximizebutton; public System.Windows.Forms.PictureBox btnMax;
public System.Windows.Forms.PictureBox minimizebutton; public System.Windows.Forms.PictureBox btnMin;
public System.Windows.Forms.Label Title; public System.Windows.Forms.Label Title;
public System.Windows.Forms.PictureBox closebutton; public System.Windows.Forms.PictureBox btnClose;
public System.Windows.Forms.Panel right; public System.Windows.Forms.Panel rightSide;
public System.Windows.Forms.Panel left; public System.Windows.Forms.Panel leftSide;
} }
} }

View file

@ -50,40 +50,40 @@ namespace ShiftOS.Engine.WindowManager
=> this.Close(); => this.Close();
private void closebutton_MouseEnter(object sender, EventArgs e) private void closebutton_MouseEnter(object sender, EventArgs e)
=> closebutton.BackColor = Color.Gray; => btnClose.BackColor = Color.Gray;
private void closebutton_MouseLeave(object sender, EventArgs e) private void closebutton_MouseLeave(object sender, EventArgs e)
=> closebutton.BackColor = Color.Black; => btnClose.BackColor = Color.Black;
private void maximizebutton_MouseEnter(object sender, EventArgs e) private void maximizebutton_MouseEnter(object sender, EventArgs e)
=> maximizebutton.BackColor = Color.Gray; => btnMax.BackColor = Color.Gray;
private void maximizebutton_MouseLeave(object sender, EventArgs e) private void maximizebutton_MouseLeave(object sender, EventArgs e)
=> maximizebutton.BackColor = Color.Black; => btnMax.BackColor = Color.Black;
private void minimizebutton_MouseEnter(object sender, EventArgs e) private void minimizebutton_MouseEnter(object sender, EventArgs e)
=> minimizebutton.BackColor = Color.Gray; => btnMin.BackColor = Color.Gray;
private void minimizebutton_MouseLeave(object sender, EventArgs e) private void minimizebutton_MouseLeave(object sender, EventArgs e)
=> minimizebutton.BackColor = Color.Black; => btnMin.BackColor = Color.Black;
private void closebutton_MouseDown(object sender, MouseEventArgs e) private void closebutton_MouseDown(object sender, MouseEventArgs e)
=> closebutton.BackColor = Color.Black; => btnClose.BackColor = Color.Black;
private void maximizebutton_MouseDown(object sender, MouseEventArgs e) private void maximizebutton_MouseDown(object sender, MouseEventArgs e)
=> maximizebutton.BackColor = Color.Black; => btnMax.BackColor = Color.Black;
private void minimizebutton_MouseDown(object sender, MouseEventArgs e) private void minimizebutton_MouseDown(object sender, MouseEventArgs e)
=> minimizebutton.BackColor = Color.Black; => btnMin.BackColor = Color.Black;
private void minimizebutton_MouseUp(object sender, MouseEventArgs e) private void minimizebutton_MouseUp(object sender, MouseEventArgs e)
=> minimizebutton.BackColor = Color.Gray; => btnMin.BackColor = Color.Gray;
private void maximizebutton_MouseUp(object sender, MouseEventArgs e) private void maximizebutton_MouseUp(object sender, MouseEventArgs e)
=> maximizebutton.BackColor = Color.Gray; => btnMax.BackColor = Color.Gray;
private void closebutton_MouseUp(object sender, MouseEventArgs e) private void closebutton_MouseUp(object sender, MouseEventArgs e)
=> closebutton.BackColor = Color.Gray; => btnClose.BackColor = Color.Gray;
} }
public interface IShiftWindowExtensions public interface IShiftWindowExtensions

View file

@ -9,7 +9,6 @@ namespace ShiftOS.Main.ShiftOS.Apps
public partial class Shifter : UserControl public partial class Shifter : UserControl
{ {
public int colorType; //This is a check to see what option was chosen. public int colorType; //This is a check to see what option was chosen.
ShiftSkinData skinConfig = new ShiftSkinData();
public Shifter() public Shifter()
{ {
InitializeComponent(); InitializeComponent();
@ -23,27 +22,43 @@ namespace ShiftOS.Main.ShiftOS.Apps
private void setDefaultSkin(object sender, EventArgs e) private void setDefaultSkin(object sender, EventArgs e)
{ {
skinConfig.setBorderColor(Color.FromArgb(64, 64, 64)); setBorderColor(Color.FromArgb(64, 64, 64));
skinConfig.btnCloseColor = Color.Black; ShiftSkinData.btnCloseColor = Color.Black;
skinConfig.btnMaxColor = Color.Black; ShiftSkinData.btnMaxColor = Color.Black;
skinConfig.btnMinColor = Color.Black; ShiftSkinData.btnMinColor = Color.Black;
button5_Click(sender, e);
} }
private void setColorSkin(object sender, EventArgs e) private void setColorSkin(object sender, EventArgs e)
{ {
skinConfig.setBorderColor(Color.Blue); setBorderColor(Color.Blue);
skinConfig.btnCloseColor = Color.Red; ShiftSkinData.btnCloseColor = Color.Red;
skinConfig.btnMaxColor = Color.Yellow; ShiftSkinData.btnMaxColor = Color.Yellow;
skinConfig.btnMinColor = Color.Green; ShiftSkinData.btnMinColor = Color.Green;
button5_Click(sender, e);
} }
private void setRandomSkin(object sender, EventArgs e) private void setRandomSkin(object sender, EventArgs e)
{ {
Random rnd = new Random(); Random rnd = new Random();
skinConfig.setBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); setBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)));
skinConfig.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); ShiftSkinData.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
skinConfig.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); ShiftSkinData.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
skinConfig.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); ShiftSkinData.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
button5_Click(sender, e);
}
// SetBorderColor
public void setBorderColor(Color borderColor)
{
ShiftSkinData.leftTopCornerColor = borderColor;
ShiftSkinData.titleBarColor = borderColor;
ShiftSkinData.rightTopCornerColor = borderColor;
ShiftSkinData.leftSideColor = borderColor;
ShiftSkinData.rightSideColor = borderColor;
ShiftSkinData.leftBottomCornerColor = borderColor;
ShiftSkinData.bottomSideColor = borderColor;
ShiftSkinData.rightBottomCornerColor = borderColor;
} }
private void button5_Click(object sender, EventArgs e) private void button5_Click(object sender, EventArgs e)
@ -51,17 +66,18 @@ namespace ShiftOS.Main.ShiftOS.Apps
foreach (var window in ShiftWM.Windows) foreach (var window in ShiftWM.Windows)
{ {
window.Invoke(new Action(() => window.top.BackColor = skinConfig.titleBarColor)); window.Invoke(new Action(() => window.titleBar.BackColor = ShiftSkinData.titleBarColor));
window.Invoke(new Action(() => window.topleftcorner.BackColor = skinConfig.leftTopCornerColor)); window.Invoke(new Action(() => window.leftTopCorner.BackColor = ShiftSkinData.leftTopCornerColor));
window.Invoke(new Action(() => window.toprightcorner.BackColor = skinConfig.rightTopCornerColor)); window.Invoke(new Action(() => window.rightTopCorner.BackColor = ShiftSkinData.rightTopCornerColor));
window.Invoke(new Action(() => window.left.BackColor = skinConfig.leftSideColor)); window.Invoke(new Action(() => window.leftSide.BackColor = ShiftSkinData.leftSideColor));
window.Invoke(new Action(() => window.right.BackColor = skinConfig.rightSideColor)); window.Invoke(new Action(() => window.rightSide.BackColor = ShiftSkinData.rightSideColor));
window.Invoke(new Action(() => window.bottomleftcorner.BackColor = skinConfig.leftBottomCornerColor)); window.Invoke(new Action(() => window.leftBottomCorner.BackColor = ShiftSkinData.leftBottomCornerColor));
window.Invoke(new Action(() => window.bottom.BackColor = skinConfig.bottomSideColor)); window.Invoke(new Action(() => window.bottomSide.BackColor = ShiftSkinData.bottomSideColor));
window.Invoke(new Action(() => window.bottomrightcorner.BackColor = skinConfig.rightBottomCornerColor)); window.Invoke(new Action(() => window.rightBottomCorner.BackColor = ShiftSkinData.rightBottomCornerColor));
window.Invoke(new Action(() => window.closebutton.BackColor = skinConfig.btnCloseColor)); window.Invoke(new Action(() => window.btnClose.BackColor = ShiftSkinData.btnCloseColor));
window.Invoke(new Action(() => window.maximizebutton.BackColor = skinConfig.btnMaxColor)); window.Invoke(new Action(() => window.btnMax.BackColor = ShiftSkinData.btnMaxColor));
window.Invoke(new Action(() => window.minimizebutton.BackColor = skinConfig.btnMinColor)); window.Invoke(new Action(() => window.btnMin.BackColor = ShiftSkinData.btnMinColor));
} }
} }
} }