diff options
| author | AShifter <[email protected]> | 2017-11-18 11:04:51 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-18 11:04:51 -0700 |
| commit | 55ac320b52adfb8aca5ecd8c5fe19af6de6b0bb8 (patch) | |
| tree | 824e8a0fd15ef4bcf630b8bb43a86083de199f62 /ShiftOS.Main/ShiftOS/Apps | |
| parent | cc734557de877186c5f5eb1e59efdcb785ac37a8 (diff) | |
| parent | ad5f166619c4f7a81bb708aea6cf5b5e9ab11a1e (diff) | |
| download | shiftos-rewind-55ac320b52adfb8aca5ecd8c5fe19af6de6b0bb8.tar.gz shiftos-rewind-55ac320b52adfb8aca5ecd8c5fe19af6de6b0bb8.tar.bz2 shiftos-rewind-55ac320b52adfb8aca5ecd8c5fe19af6de6b0bb8.zip | |
Merge pull request #16 from AShifter/master
Master
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Apps')
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs | 41 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs | 41 |
2 files changed, 64 insertions, 18 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs index 2ed43b4..8bbbac2 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs @@ -30,6 +30,7 @@ { this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.btnSave = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); @@ -37,7 +38,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.btnLoad = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -58,6 +59,7 @@ // // tabPage1 // + this.tabPage1.Controls.Add(this.btnLoad); this.tabPage1.Controls.Add(this.btnSave); this.tabPage1.Controls.Add(this.button5); this.tabPage1.Controls.Add(this.button4); @@ -72,6 +74,18 @@ this.tabPage1.Text = "Titlebar"; this.tabPage1.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(155, 23); + this.btnSave.TabIndex = 6; + this.btnSave.Text = "Save Skin"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // // button5 // this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -112,9 +126,9 @@ // 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, 210); + this.button2.Location = new System.Drawing.Point(165, 210); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(149, 23); + this.button2.Size = new System.Drawing.Size(155, 23); this.button2.TabIndex = 2; this.button2.Text = "Set Colorful Skin"; this.button2.UseVisualStyleBackColor = true; @@ -152,17 +166,17 @@ this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // - // btnSave + // btnLoad // - 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); + this.btnLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnLoad.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.btnLoad.Location = new System.Drawing.Point(165, 267); + this.btnLoad.Name = "btnLoad"; + this.btnLoad.Size = new System.Drawing.Size(155, 23); + this.btnLoad.TabIndex = 7; + this.btnLoad.Text = "Load Skin"; + this.btnLoad.UseVisualStyleBackColor = true; + this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click); // // Shifter // @@ -190,5 +204,6 @@ private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button btnSave; + private System.Windows.Forms.Button btnLoad; } } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs index df093f0..1f31ae3 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs @@ -2,10 +2,10 @@ using System.Drawing; using System.IO; using System.Windows.Forms; -using Newtonsoft.Json; using ShiftOS.Engine.Misc; using ShiftOS.Engine.WindowManager; using ShiftOS.Main.Properties; +using Whoa; namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff { @@ -106,11 +106,42 @@ namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff 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( + + using (var fobj = File.OpenWrite(@"C:\Users\Public\Documents\Skin.whoa")) + Whoa.Whoa.SerialiseObject(fobj, shiftColors); + + ShiftWM.StartInfoboxSession( "Saved Skin", - "Saved Skin to C:\\Users\\Public\\Documents\\Skin.json", + "Saved Skin to C:\\Users\\Public\\Documents\\Skin.whoa", InfoboxTemplate.ButtonType.Ok); } - } + + private void btnLoad_Click(object sender, EventArgs e) + { + var shiftColors = new Color[14]; + using (var fobj = File.OpenRead(@"C:\Users\Public\Documents\Skin.whoa")) + shiftColors = Whoa.Whoa.DeserialiseObject<Color[]>(fobj); + + ShiftSkinData.LeftTopCornerColor = shiftColors[0]; + ShiftSkinData.TitleBarColor = shiftColors[1]; + ShiftSkinData.RightTopCornerColor = shiftColors[2]; + ShiftSkinData.LeftSideColor = shiftColors[3]; + ShiftSkinData.RightSideColor = shiftColors[4]; + ShiftSkinData.LeftBottomCornerColor = shiftColors[5]; + ShiftSkinData.BottomSideColor = shiftColors[6]; + ShiftSkinData.RightBottomCornerColor = shiftColors[7]; + ShiftSkinData.BtnCloseColor = shiftColors[8]; + ShiftSkinData.BtnMaxColor = shiftColors[9]; + ShiftSkinData.BtnMinColor = shiftColors[10]; + ShiftSkinData.BtnCloseHoverColor = shiftColors[11]; + ShiftSkinData.BtnMaxHoverColor = shiftColors[12]; + ShiftSkinData.BtnMinHoverColor = shiftColors[13]; + + button5_Click(sender, e); + ShiftWM.StartInfoboxSession( + "Loaded Skin", + "Loaded Skin from C:\\Users\\Public\\Documents\\Skin.whoa", + InfoboxTemplate.ButtonType.Ok); + } + } }
\ No newline at end of file |
