diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide new file mode 100644 index 0000000..6ac0af0 Binary files /dev/null and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index 6740db1..2c9b364 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -34,6 +34,9 @@ ..\packages\Magick.NET-Q16-AnyCPU.7.0.7.300\lib\net40\Magick.NET-Q16-AnyCPU.dll + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + diff --git a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs index 2c03123..9f4bf45 100644 --- a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs +++ b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs @@ -11,6 +11,9 @@ namespace ShiftOS.Engine.WindowManager public static Color btnCloseColor = Color.Empty; public static Color btnMaxColor = Color.Empty; public static Color btnMinColor = Color.Empty; + public static Color btnCloseHoverColor = Color.Empty; + public static Color btnMaxHoverColor = Color.Empty; + public static Color btnMinHoverColor = Color.Empty; public static Color leftSideColor = Color.Empty; public static Color rightSideColor = Color.Empty; public static Color leftBottomCornerColor = Color.Empty; diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs index 211324c..df479ba 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs @@ -161,10 +161,8 @@ this.btnMax.Size = new System.Drawing.Size(21, 21); this.btnMax.TabIndex = 6; this.btnMax.TabStop = false; - this.btnMax.MouseDown += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseDown); this.btnMax.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter); this.btnMax.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave); - this.btnMax.MouseUp += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseUp); // // btnMin // @@ -175,10 +173,8 @@ this.btnMin.Size = new System.Drawing.Size(21, 21); this.btnMin.TabIndex = 5; this.btnMin.TabStop = false; - this.btnMin.MouseDown += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseDown); this.btnMin.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter); this.btnMin.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave); - this.btnMin.MouseUp += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseUp); // // Title // @@ -203,10 +199,8 @@ this.btnClose.TabIndex = 4; this.btnClose.TabStop = false; this.btnClose.Click += new System.EventHandler(this.closebutton_Click); - this.btnClose.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown); this.btnClose.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter); this.btnClose.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave); - this.btnClose.MouseUp += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseUp); // // rightSide // diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.cs index c091d40..a8b9c79 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWindow.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWindow.cs @@ -50,23 +50,25 @@ namespace ShiftOS.Engine.WindowManager => this.Close(); private void closebutton_MouseEnter(object sender, EventArgs e) - => btnClose.BackColor = Color.Gray; + => btnClose.BackColor = ShiftSkinData.btnCloseHoverColor; - private void closebutton_MouseLeave(object sender, EventArgs e) - => btnClose.BackColor = Color.Black; + private void closebutton_MouseLeave(object sender, EventArgs e) + => btnClose.BackColor = ShiftSkinData.btnCloseColor; private void maximizebutton_MouseEnter(object sender, EventArgs e) - => btnMax.BackColor = Color.Gray; + => btnMax.BackColor = ShiftSkinData.btnMaxHoverColor; - private void maximizebutton_MouseLeave(object sender, EventArgs e) - => btnMax.BackColor = Color.Black; + private void maximizebutton_MouseLeave(object sender, EventArgs e) + => btnMax.BackColor = ShiftSkinData.btnMaxColor; - private void minimizebutton_MouseEnter(object sender, EventArgs e) - => btnMin.BackColor = Color.Gray; + private void minimizebutton_MouseEnter(object sender, EventArgs e) + => btnMin.BackColor = ShiftSkinData.btnMinHoverColor; + - private void minimizebutton_MouseLeave(object sender, EventArgs e) - => btnMin.BackColor = Color.Black; + private void minimizebutton_MouseLeave(object sender, EventArgs e) + => btnMin.BackColor = ShiftSkinData.btnMinColor; + /* private void closebutton_MouseDown(object sender, MouseEventArgs e) => btnClose.BackColor = Color.Black; @@ -75,15 +77,8 @@ namespace ShiftOS.Engine.WindowManager private void minimizebutton_MouseDown(object sender, MouseEventArgs e) => btnMin.BackColor = Color.Black; + */ - private void minimizebutton_MouseUp(object sender, MouseEventArgs e) - => btnMin.BackColor = Color.Gray; - - private void maximizebutton_MouseUp(object sender, MouseEventArgs e) - => btnMax.BackColor = Color.Gray; - - private void closebutton_MouseUp(object sender, MouseEventArgs e) - => btnClose.BackColor = Color.Gray; } public interface IShiftWindowExtensions diff --git a/ShiftOS.Engine/packages.config b/ShiftOS.Engine/packages.config index d376894..2f27f01 100644 --- a/ShiftOS.Engine/packages.config +++ b/ShiftOS.Engine/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index 7c19b38..f511503 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -31,6 +31,9 @@ 4 + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + @@ -119,6 +122,7 @@ Desktop.cs + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index 7a97915..f26fe4d 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -26,12 +26,12 @@ namespace ShiftOS.Main.ShiftOS.Apps { _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - /* + foreach (var window in ShiftWM.Windows) { - window.Invoke(new Action(() => window.top.BackColor = _finalColor)); + window.Invoke(new Action(() => window.titleBar.BackColor = _finalColor)); } - */ + ShiftWM.StartInfoboxSession("Success!", $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", InfoboxTemplate.ButtonType.Ok); } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs index 47bc115..ac81a5c 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs @@ -37,6 +37,7 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button1 = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.btnSave = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -57,6 +58,7 @@ // // tabPage1 // + this.tabPage1.Controls.Add(this.btnSave); this.tabPage1.Controls.Add(this.button5); this.tabPage1.Controls.Add(this.button4); this.tabPage1.Controls.Add(this.button3); @@ -74,7 +76,7 @@ // this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button5.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button5.Location = new System.Drawing.Point(6, 267); + this.button5.Location = new System.Drawing.Point(6, 239); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(314, 23); this.button5.TabIndex = 5; @@ -86,7 +88,7 @@ // this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button4.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button4.Location = new System.Drawing.Point(6, 209); + this.button4.Location = new System.Drawing.Point(6, 181); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(314, 23); this.button4.TabIndex = 4; @@ -98,7 +100,7 @@ // this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button3.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button3.Location = new System.Drawing.Point(6, 238); + this.button3.Location = new System.Drawing.Point(6, 210); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(155, 23); this.button3.TabIndex = 3; @@ -110,7 +112,7 @@ // this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button2.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button2.Location = new System.Drawing.Point(171, 238); + this.button2.Location = new System.Drawing.Point(171, 210); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(149, 23); this.button2.TabIndex = 2; @@ -150,6 +152,18 @@ this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // + // btnSave + // + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.btnSave.Location = new System.Drawing.Point(6, 267); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(314, 23); + this.btnSave.TabIndex = 6; + this.btnSave.Text = "Save Skin"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // // Shifter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -175,5 +189,6 @@ private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button btnSave; } } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs index 177942d..609b617 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs @@ -3,6 +3,8 @@ using System.Windows.Forms; using ShiftOS.Engine; using ShiftOS.Engine.WindowManager; using System.Drawing; +using System.IO; +using Newtonsoft.Json; namespace ShiftOS.Main.ShiftOS.Apps { @@ -35,6 +37,9 @@ namespace ShiftOS.Main.ShiftOS.Apps ShiftSkinData.btnCloseColor = Color.Red; ShiftSkinData.btnMaxColor = Color.Yellow; ShiftSkinData.btnMinColor = Color.Green; + ShiftSkinData.btnCloseHoverColor = Color.FromArgb(255, 102, 102); + ShiftSkinData.btnMaxHoverColor = Color.FromArgb(255, 255, 153); + ShiftSkinData.btnMinColor = Color.FromArgb(102, 255, 102); button5_Click(sender, e); } @@ -45,6 +50,9 @@ namespace ShiftOS.Main.ShiftOS.Apps ShiftSkinData.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); ShiftSkinData.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); ShiftSkinData.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.btnCloseHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.btnMaxHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.btnMinHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); button5_Click(sender, e); } @@ -80,5 +88,26 @@ namespace ShiftOS.Main.ShiftOS.Apps } } + + private void btnSave_Click(object sender, EventArgs e) + { + Color[] shiftColors = new Color[14]; + shiftColors[0] = ShiftSkinData.leftTopCornerColor; + shiftColors[1] = ShiftSkinData.titleBarColor; + shiftColors[2] = ShiftSkinData.rightTopCornerColor; + shiftColors[3] = ShiftSkinData.leftSideColor; + shiftColors[4] = ShiftSkinData.rightSideColor; + shiftColors[5] = ShiftSkinData.leftBottomCornerColor; + shiftColors[6] = ShiftSkinData.bottomSideColor; + shiftColors[7] = ShiftSkinData.rightBottomCornerColor; + shiftColors[8] = ShiftSkinData.btnCloseColor; + shiftColors[9] = ShiftSkinData.btnMaxColor; + shiftColors[10] = ShiftSkinData.btnMinColor; + shiftColors[11] = ShiftSkinData.btnCloseHoverColor; + shiftColors[12] = ShiftSkinData.btnMaxHoverColor; + shiftColors[13] = ShiftSkinData.btnMinHoverColor; + File.WriteAllText(@"C:\Users\Public\Documents\Skin.json", JsonConvert.SerializeObject(shiftColors)); + ShiftWM.StartInfoboxSession("Saved Skin", "Saved Skin to C:\\Users\\Public\\Documents\\Skin.json", InfoboxTemplate.ButtonType.Ok); + } } } diff --git a/ShiftOS.Main/packages.config b/ShiftOS.Main/packages.config new file mode 100644 index 0000000..ee51c23 --- /dev/null +++ b/ShiftOS.Main/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file