ShiftOS-Rewind/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs

69 lines
3.1 KiB
C#
Raw Normal View History

2017-09-24 16:55:03 -05:00
using System;
using System.Windows.Forms;
using ShiftOS.Engine;
2017-09-24 16:55:03 -05:00
using ShiftOS.Engine.WindowManager;
using System.Drawing;
2017-09-24 16:55:03 -05:00
namespace ShiftOS.Main.ShiftOS.Apps
{
public partial class Shifter : UserControl
{
public int colorType; //This is a check to see what option was chosen.
ShiftSkinData skinConfig = new ShiftSkinData();
2017-09-24 16:55:03 -05:00
public Shifter()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
colorType = 1;
ShiftWM.Init(new SelectColor(), "Select a color", Properties.Resources.iconColourPicker_fw.ToIcon());
2017-09-24 16:55:03 -05:00
}
2017-10-01 09:52:36 -06:00
private void setDefaultSkin(object sender, EventArgs e)
2017-10-01 09:52:36 -06:00
{
skinConfig.setBorderColor(Color.FromArgb(64, 64, 64));
skinConfig.btnCloseColor = Color.Black;
skinConfig.btnMaxColor = Color.Black;
skinConfig.btnMinColor = Color.Black;
}
2017-10-01 09:52:36 -06:00
private void setColorSkin(object sender, EventArgs e)
{
skinConfig.setBorderColor(Color.Blue);
skinConfig.btnCloseColor = Color.Red;
skinConfig.btnMaxColor = Color.Yellow;
skinConfig.btnMinColor = Color.Green;
}
private void setRandomSkin(object sender, EventArgs e)
{
Random rnd = new Random();
skinConfig.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));
skinConfig.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));
2017-10-01 09:52:36 -06:00
}
private void button5_Click(object sender, EventArgs e)
2017-10-01 09:52:36 -06:00
{
foreach (var window in ShiftWM.Windows)
{
window.Invoke(new Action(() => window.top.BackColor = skinConfig.titleBarColor));
window.Invoke(new Action(() => window.topleftcorner.BackColor = skinConfig.leftTopCornerColor));
window.Invoke(new Action(() => window.toprightcorner.BackColor = skinConfig.rightTopCornerColor));
window.Invoke(new Action(() => window.left.BackColor = skinConfig.leftSideColor));
window.Invoke(new Action(() => window.right.BackColor = skinConfig.rightSideColor));
window.Invoke(new Action(() => window.bottomleftcorner.BackColor = skinConfig.leftBottomCornerColor));
window.Invoke(new Action(() => window.bottom.BackColor = skinConfig.bottomSideColor));
window.Invoke(new Action(() => window.bottomrightcorner.BackColor = skinConfig.rightBottomCornerColor));
window.Invoke(new Action(() => window.closebutton.BackColor = skinConfig.btnCloseColor));
window.Invoke(new Action(() => window.maximizebutton.BackColor = skinConfig.btnMaxColor));
window.Invoke(new Action(() => window.minimizebutton.BackColor = skinConfig.btnMinColor));
}
2017-10-01 09:52:36 -06:00
}
2017-09-24 16:55:03 -05:00
}
}