This commit is contained in:
FloppyDiskDrive 2017-11-18 12:29:34 -06:00
commit b61561692c
6 changed files with 181 additions and 118 deletions

View file

@ -33,9 +33,6 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -47,6 +44,9 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Whoa, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Whoa.1.5.0\lib\net45\Whoa.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />

View file

@ -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;
}
}

View file

@ -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,10 +106,41 @@ 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));
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);
}
}

View file

@ -34,9 +34,10 @@
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textPadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.taskbarClock = new System.Windows.Forms.ToolStripLabel();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.shifterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.taskbar.SuspendLayout();
this.SuspendLayout();
//
@ -45,8 +46,9 @@
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(1916, 1052);
this.listView1.Size = new System.Drawing.Size(1277, 684);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
//
@ -58,10 +60,9 @@
this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1,
this.taskbarClock});
this.taskbar.Location = new System.Drawing.Point(0, 1020);
this.taskbar.Location = new System.Drawing.Point(0, 653);
this.taskbar.Name = "taskbar";
this.taskbar.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0);
this.taskbar.Size = new System.Drawing.Size(1916, 32);
this.taskbar.Size = new System.Drawing.Size(1277, 31);
this.taskbar.TabIndex = 1;
this.taskbar.Text = "toolStrip1";
//
@ -70,34 +71,42 @@
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.terminalToolStripMenuItem,
this.textPadToolStripMenuItem,
this.fileSkimmerToolStripMenuItem});
this.fileSkimmerToolStripMenuItem,
this.shifterToolStripMenuItem});
this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser;
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(131, 29);
this.toolStripDropDownButton1.Size = new System.Drawing.Size(95, 28);
this.toolStripDropDownButton1.Tag = ((uint)(0u));
this.toolStripDropDownButton1.Text = "Programs";
//
// terminalToolStripMenuItem
//
this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem";
this.terminalToolStripMenuItem.Size = new System.Drawing.Size(210, 30);
this.terminalToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.terminalToolStripMenuItem.Text = "Terminal";
this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click);
//
// textPadToolStripMenuItem
//
this.textPadToolStripMenuItem.Name = "textPadToolStripMenuItem";
this.textPadToolStripMenuItem.Size = new System.Drawing.Size(210, 30);
this.textPadToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.textPadToolStripMenuItem.Text = "TextPad";
this.textPadToolStripMenuItem.Click += new System.EventHandler(this.textPadToolStripMenuItem_Click);
//
// fileSkimmerToolStripMenuItem
//
this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem";
this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.fileSkimmerToolStripMenuItem.Text = "File Skimmer";
this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click);
//
// taskbarClock
//
this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock;
this.taskbarClock.Name = "taskbarClock";
this.taskbarClock.Size = new System.Drawing.Size(70, 29);
this.taskbarClock.Size = new System.Drawing.Size(52, 28);
this.taskbarClock.Tag = ((uint)(0u));
this.taskbarClock.Text = "0:00";
//
@ -106,20 +115,21 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// fileSkimmerToolStripMenuItem
// shifterToolStripMenuItem
//
this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem";
this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(210, 30);
this.fileSkimmerToolStripMenuItem.Text = "File Skimmer";
this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click);
this.shifterToolStripMenuItem.Name = "shifterToolStripMenuItem";
this.shifterToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.shifterToolStripMenuItem.Text = "Shifter";
this.shifterToolStripMenuItem.Click += new System.EventHandler(this.shifterToolStripMenuItem_Click);
//
// Desktop
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1916, 1052);
this.ClientSize = new System.Drawing.Size(1277, 684);
this.Controls.Add(this.taskbar);
this.Controls.Add(this.listView1);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "Desktop";
this.Text = "Desktop";
this.taskbar.ResumeLayout(false);
@ -139,5 +149,6 @@
private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem textPadToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fileSkimmerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem shifterToolStripMenuItem;
}
}

View file

@ -72,5 +72,11 @@ namespace ShiftOS.Main.ShiftOS
var fs = new FileSkimmer();
ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer);
}
private void shifterToolStripMenuItem_Click(object sender, EventArgs e)
{
Apps.ShifterStuff.Shifter app = new Apps.ShifterStuff.Shifter();
ShiftWM.Init(app, "Shifter", null);
}
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
<package id="Whoa" version="1.5.0" targetFramework="net45" />
</packages>