Huge optimizations.

Windows load A LOT faster, and Shifter has a preview.
This commit is contained in:
Michael 2017-04-14 10:03:28 -04:00
parent 71440207cd
commit 791290857f
7 changed files with 793 additions and 111 deletions

View file

@ -52,103 +52,284 @@ namespace ShiftOS.WinForms.Applications
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Shifter));
this.panel1 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.pnlpreview = new System.Windows.Forms.Panel();
this.pnlwindow = new System.Windows.Forms.Panel();
this.pnlcontents = new System.Windows.Forms.Panel();
this.pnltitle = new System.Windows.Forms.Panel();
this.pnlicon = new System.Windows.Forms.Panel();
this.pnlminimize = new System.Windows.Forms.Panel();
this.pnlmaximize = new System.Windows.Forms.Panel();
this.pnlclose = new System.Windows.Forms.Panel();
this.pnltitleleft = new System.Windows.Forms.Panel();
this.pnltitleright = new System.Windows.Forms.Panel();
this.lbtitletext = new System.Windows.Forms.Label();
this.pnlbottom = new System.Windows.Forms.Panel();
this.pnlbottomr = new System.Windows.Forms.Panel();
this.pnlbottoml = new System.Windows.Forms.Panel();
this.pnlright = new System.Windows.Forms.Panel();
this.pnlleft = new System.Windows.Forms.Panel();
this.pnlsettingsholder = new System.Windows.Forms.Panel();
this.flbody = new System.Windows.Forms.FlowLayoutPanel();
this.flcategory = new System.Windows.Forms.FlowLayoutPanel();
this.panel3 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.pnlcategoryholder = new System.Windows.Forms.Panel();
this.flmeta = new System.Windows.Forms.FlowLayoutPanel();
this.btnapply = new System.Windows.Forms.Button();
this.mspreview = new System.Windows.Forms.MenuStrip();
this.menuToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.subitem1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.subitem2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.subitem3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.separatorToolStripMenuItem = new System.Windows.Forms.ToolStripSeparator();
this.menuItem3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tspreview = new System.Windows.Forms.ToolStrip();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripTextBox1 = new System.Windows.Forms.ToolStripTextBox();
this.panel1.SuspendLayout();
this.panel4.SuspendLayout();
this.panel3.SuspendLayout();
this.panel2.SuspendLayout();
this.pnlpreview.SuspendLayout();
this.pnlwindow.SuspendLayout();
this.pnlcontents.SuspendLayout();
this.pnltitle.SuspendLayout();
this.pnlbottom.SuspendLayout();
this.pnlsettingsholder.SuspendLayout();
this.pnlcategoryholder.SuspendLayout();
this.mspreview.SuspendLayout();
this.tspreview.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.panel4);
this.panel1.Controls.Add(this.panel3);
this.panel1.Controls.Add(this.panel2);
this.panel1.Controls.Add(this.pnlpreview);
this.panel1.Controls.Add(this.pnlsettingsholder);
this.panel1.Controls.Add(this.pnlcategoryholder);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(893, 539);
this.panel1.TabIndex = 0;
//
// panel4
// pnlpreview
//
this.panel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
this.pnlpreview.Controls.Add(this.pnlwindow);
this.pnlpreview.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlpreview.Location = new System.Drawing.Point(136, 0);
this.pnlpreview.Name = "pnlpreview";
this.pnlpreview.Size = new System.Drawing.Size(757, 286);
this.pnlpreview.TabIndex = 1;
//
// pnlwindow
//
this.pnlwindow.Controls.Add(this.pnlcontents);
this.pnlwindow.Controls.Add(this.pnltitle);
this.pnlwindow.Controls.Add(this.pnlbottom);
this.pnlwindow.Controls.Add(this.pnlright);
this.pnlwindow.Controls.Add(this.pnlleft);
this.pnlwindow.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlwindow.Location = new System.Drawing.Point(0, 0);
this.pnlwindow.Name = "pnlwindow";
this.pnlwindow.Size = new System.Drawing.Size(757, 286);
this.pnlwindow.TabIndex = 0;
//
// pnlcontents
//
this.pnlcontents.BackColor = System.Drawing.Color.Black;
this.pnlcontents.Controls.Add(this.tspreview);
this.pnlcontents.Controls.Add(this.mspreview);
this.pnlcontents.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlcontents.ForeColor = System.Drawing.Color.White;
this.pnlcontents.Location = new System.Drawing.Point(2, 30);
this.pnlcontents.Name = "pnlcontents";
this.pnlcontents.Size = new System.Drawing.Size(753, 254);
this.pnlcontents.TabIndex = 9;
//
// pnltitle
//
this.pnltitle.BackColor = System.Drawing.Color.Black;
this.pnltitle.Controls.Add(this.pnlicon);
this.pnltitle.Controls.Add(this.pnlminimize);
this.pnltitle.Controls.Add(this.pnlmaximize);
this.pnltitle.Controls.Add(this.pnlclose);
this.pnltitle.Controls.Add(this.pnltitleleft);
this.pnltitle.Controls.Add(this.pnltitleright);
this.pnltitle.Controls.Add(this.lbtitletext);
this.pnltitle.Dock = System.Windows.Forms.DockStyle.Top;
this.pnltitle.Location = new System.Drawing.Point(2, 0);
this.pnltitle.Name = "pnltitle";
this.pnltitle.Size = new System.Drawing.Size(753, 30);
this.pnltitle.TabIndex = 5;
//
// pnlicon
//
this.pnlicon.Location = new System.Drawing.Point(9, -76);
this.pnlicon.Name = "pnlicon";
this.pnlicon.Size = new System.Drawing.Size(200, 100);
this.pnlicon.TabIndex = 6;
//
// pnlminimize
//
this.pnlminimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pnlminimize.BackColor = System.Drawing.Color.Green;
this.pnlminimize.Location = new System.Drawing.Point(672, 3);
this.pnlminimize.Name = "pnlminimize";
this.pnlminimize.Size = new System.Drawing.Size(24, 24);
this.pnlminimize.TabIndex = 3;
//
// pnlmaximize
//
this.pnlmaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pnlmaximize.BackColor = System.Drawing.Color.Yellow;
this.pnlmaximize.Location = new System.Drawing.Point(699, 3);
this.pnlmaximize.Name = "pnlmaximize";
this.pnlmaximize.Size = new System.Drawing.Size(24, 24);
this.pnlmaximize.TabIndex = 2;
//
// pnlclose
//
this.pnlclose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pnlclose.BackColor = System.Drawing.Color.Red;
this.pnlclose.Location = new System.Drawing.Point(726, 3);
this.pnlclose.Name = "pnlclose";
this.pnlclose.Size = new System.Drawing.Size(24, 24);
this.pnlclose.TabIndex = 1;
//
// pnltitleleft
//
this.pnltitleleft.Dock = System.Windows.Forms.DockStyle.Left;
this.pnltitleleft.Location = new System.Drawing.Point(0, 0);
this.pnltitleleft.Name = "pnltitleleft";
this.pnltitleleft.Size = new System.Drawing.Size(2, 30);
this.pnltitleleft.TabIndex = 4;
//
// pnltitleright
//
this.pnltitleright.Dock = System.Windows.Forms.DockStyle.Right;
this.pnltitleright.Location = new System.Drawing.Point(751, 0);
this.pnltitleright.Name = "pnltitleright";
this.pnltitleright.Size = new System.Drawing.Size(2, 30);
this.pnltitleright.TabIndex = 5;
//
// lbtitletext
//
this.lbtitletext.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel4.Controls.Add(this.flbody);
this.panel4.Controls.Add(this.flcategory);
this.panel4.Location = new System.Drawing.Point(154, 283);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(734, 253);
this.panel4.TabIndex = 2;
this.lbtitletext.AutoSize = true;
this.lbtitletext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lbtitletext.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Bold);
this.lbtitletext.ForeColor = System.Drawing.Color.White;
this.lbtitletext.Location = new System.Drawing.Point(75, 9);
this.lbtitletext.Name = "lbtitletext";
this.lbtitletext.Size = new System.Drawing.Size(77, 14);
this.lbtitletext.TabIndex = 0;
this.lbtitletext.Text = "Title text";
this.lbtitletext.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lbtitletext.UseMnemonic = false;
//
// pnlbottom
//
this.pnlbottom.BackColor = System.Drawing.Color.Black;
this.pnlbottom.Controls.Add(this.pnlbottomr);
this.pnlbottom.Controls.Add(this.pnlbottoml);
this.pnlbottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlbottom.Location = new System.Drawing.Point(2, 284);
this.pnlbottom.Name = "pnlbottom";
this.pnlbottom.Size = new System.Drawing.Size(753, 2);
this.pnlbottom.TabIndex = 6;
//
// pnlbottomr
//
this.pnlbottomr.Dock = System.Windows.Forms.DockStyle.Right;
this.pnlbottomr.Location = new System.Drawing.Point(751, 0);
this.pnlbottomr.Name = "pnlbottomr";
this.pnlbottomr.Size = new System.Drawing.Size(2, 2);
this.pnlbottomr.TabIndex = 3;
//
// pnlbottoml
//
this.pnlbottoml.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlbottoml.Location = new System.Drawing.Point(0, 0);
this.pnlbottoml.Name = "pnlbottoml";
this.pnlbottoml.Size = new System.Drawing.Size(2, 2);
this.pnlbottoml.TabIndex = 2;
//
// pnlright
//
this.pnlright.BackColor = System.Drawing.Color.Black;
this.pnlright.Dock = System.Windows.Forms.DockStyle.Right;
this.pnlright.Location = new System.Drawing.Point(755, 0);
this.pnlright.Name = "pnlright";
this.pnlright.Size = new System.Drawing.Size(2, 286);
this.pnlright.TabIndex = 8;
//
// pnlleft
//
this.pnlleft.BackColor = System.Drawing.Color.Black;
this.pnlleft.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlleft.Location = new System.Drawing.Point(0, 0);
this.pnlleft.Name = "pnlleft";
this.pnlleft.Size = new System.Drawing.Size(2, 286);
this.pnlleft.TabIndex = 7;
//
// pnlsettingsholder
//
this.pnlsettingsholder.Controls.Add(this.flbody);
this.pnlsettingsholder.Controls.Add(this.flcategory);
this.pnlsettingsholder.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlsettingsholder.Location = new System.Drawing.Point(136, 286);
this.pnlsettingsholder.Name = "pnlsettingsholder";
this.pnlsettingsholder.Padding = new System.Windows.Forms.Padding(10);
this.pnlsettingsholder.Size = new System.Drawing.Size(757, 253);
this.pnlsettingsholder.TabIndex = 2;
//
// flbody
//
this.flbody.AutoScroll = true;
this.flbody.Dock = System.Windows.Forms.DockStyle.Fill;
this.flbody.Location = new System.Drawing.Point(126, 0);
this.flbody.Location = new System.Drawing.Point(136, 10);
this.flbody.Name = "flbody";
this.flbody.Size = new System.Drawing.Size(608, 253);
this.flbody.Size = new System.Drawing.Size(611, 233);
this.flbody.TabIndex = 3;
//
// flcategory
//
this.flcategory.Dock = System.Windows.Forms.DockStyle.Left;
this.flcategory.Location = new System.Drawing.Point(0, 0);
this.flcategory.Location = new System.Drawing.Point(10, 10);
this.flcategory.Name = "flcategory";
this.flcategory.Size = new System.Drawing.Size(126, 253);
this.flcategory.Size = new System.Drawing.Size(126, 233);
this.flcategory.TabIndex = 2;
//
// panel3
// pnlcategoryholder
//
this.panel3.Controls.Add(this.label1);
this.panel3.Location = new System.Drawing.Point(155, 12);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(640, 360);
this.panel3.TabIndex = 1;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(640, 360);
this.label1.TabIndex = 0;
this.label1.Text = "Preview not available.";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel2
//
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panel2.Controls.Add(this.flmeta);
this.panel2.Controls.Add(this.btnapply);
this.panel2.Location = new System.Drawing.Point(12, 12);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(136, 511);
this.panel2.TabIndex = 0;
this.pnlcategoryholder.Controls.Add(this.flmeta);
this.pnlcategoryholder.Controls.Add(this.btnapply);
this.pnlcategoryholder.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlcategoryholder.Location = new System.Drawing.Point(0, 0);
this.pnlcategoryholder.Name = "pnlcategoryholder";
this.pnlcategoryholder.Padding = new System.Windows.Forms.Padding(10);
this.pnlcategoryholder.Size = new System.Drawing.Size(136, 539);
this.pnlcategoryholder.TabIndex = 0;
//
// flmeta
//
this.flmeta.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.flmeta.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flmeta.Location = new System.Drawing.Point(4, 4);
this.flmeta.Location = new System.Drawing.Point(14, 14);
this.flmeta.Name = "flmeta";
this.flmeta.Size = new System.Drawing.Size(126, 450);
this.flmeta.Size = new System.Drawing.Size(126, 458);
this.flmeta.TabIndex = 1;
//
// btnapply
//
this.btnapply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnapply.Location = new System.Drawing.Point(3, 460);
this.btnapply.Location = new System.Drawing.Point(13, 478);
this.btnapply.Name = "btnapply";
this.btnapply.Size = new System.Drawing.Size(127, 48);
this.btnapply.TabIndex = 0;
@ -156,19 +337,155 @@ namespace ShiftOS.WinForms.Applications
this.btnapply.UseVisualStyleBackColor = true;
this.btnapply.Click += new System.EventHandler(this.btnapply_Click);
//
// mspreview
//
this.mspreview.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuToolStripMenuItem});
this.mspreview.Location = new System.Drawing.Point(0, 0);
this.mspreview.Name = "mspreview";
this.mspreview.Size = new System.Drawing.Size(753, 24);
this.mspreview.TabIndex = 0;
this.mspreview.Text = "menuStrip1";
//
// menuToolStripMenuItem
//
this.menuToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItem1ToolStripMenuItem,
this.menuItem2ToolStripMenuItem,
this.separatorToolStripMenuItem,
this.menuItem3ToolStripMenuItem});
this.menuToolStripMenuItem.Name = "menuToolStripMenuItem";
this.menuToolStripMenuItem.Size = new System.Drawing.Size(50, 20);
this.menuToolStripMenuItem.Text = "Menu";
//
// menuItem1ToolStripMenuItem
//
this.menuItem1ToolStripMenuItem.Name = "menuItem1ToolStripMenuItem";
this.menuItem1ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.menuItem1ToolStripMenuItem.Text = "Menu Item 1";
//
// menuItem2ToolStripMenuItem
//
this.menuItem2ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.subitem1ToolStripMenuItem,
this.subitem2ToolStripMenuItem,
this.subitem3ToolStripMenuItem});
this.menuItem2ToolStripMenuItem.Name = "menuItem2ToolStripMenuItem";
this.menuItem2ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.menuItem2ToolStripMenuItem.Text = "Menu Item 2";
//
// subitem1ToolStripMenuItem
//
this.subitem1ToolStripMenuItem.Name = "subitem1ToolStripMenuItem";
this.subitem1ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.subitem1ToolStripMenuItem.Text = "Subitem 1";
//
// subitem2ToolStripMenuItem
//
this.subitem2ToolStripMenuItem.Name = "subitem2ToolStripMenuItem";
this.subitem2ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.subitem2ToolStripMenuItem.Text = "Subitem 2";
//
// subitem3ToolStripMenuItem
//
this.subitem3ToolStripMenuItem.Name = "subitem3ToolStripMenuItem";
this.subitem3ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.subitem3ToolStripMenuItem.Text = "Subitem 3";
//
// separatorToolStripMenuItem
//
this.separatorToolStripMenuItem.Name = "separatorToolStripMenuItem";
this.separatorToolStripMenuItem.Size = new System.Drawing.Size(149, 6);
//
// menuItem3ToolStripMenuItem
//
this.menuItem3ToolStripMenuItem.Name = "menuItem3ToolStripMenuItem";
this.menuItem3ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.menuItem3ToolStripMenuItem.Text = "Menu Item 3";
//
// tspreview
//
this.tspreview.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripLabel1,
this.toolStripButton2,
this.toolStripButton3,
this.toolStripButton1,
this.toolStripSeparator1,
this.toolStripTextBox1});
this.tspreview.Location = new System.Drawing.Point(0, 24);
this.tspreview.Name = "tspreview";
this.tspreview.Size = new System.Drawing.Size(753, 25);
this.tspreview.TabIndex = 1;
this.tspreview.Text = "toolStrip1";
//
// toolStripLabel1
//
this.toolStripLabel1.Name = "toolStripLabel1";
this.toolStripLabel1.Size = new System.Drawing.Size(81, 22);
this.toolStripLabel1.Text = "Toolbar Label:";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton1.Enabled = false;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(56, 22);
this.toolStripButton1.Text = "Disabled";
//
// toolStripButton2
//
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(51, 22);
this.toolStripButton2.Text = "Regular";
//
// toolStripButton3
//
this.toolStripButton3.Checked = true;
this.toolStripButton3.CheckState = System.Windows.Forms.CheckState.Checked;
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(57, 22);
this.toolStripButton3.Text = "Checked";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// toolStripTextBox1
//
this.toolStripTextBox1.Name = "toolStripTextBox1";
this.toolStripTextBox1.Size = new System.Drawing.Size(100, 25);
//
// Shifter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panel1);
this.Name = "Shifter";
this.Text = "{SHIFTER_NAME}";
this.Size = new System.Drawing.Size(893, 539);
this.Load += new System.EventHandler(this.Shifter_Load);
this.panel1.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.pnlpreview.ResumeLayout(false);
this.pnlwindow.ResumeLayout(false);
this.pnlcontents.ResumeLayout(false);
this.pnlcontents.PerformLayout();
this.pnltitle.ResumeLayout(false);
this.pnltitle.PerformLayout();
this.pnlbottom.ResumeLayout(false);
this.pnlsettingsholder.ResumeLayout(false);
this.pnlcategoryholder.ResumeLayout(false);
this.mspreview.ResumeLayout(false);
this.mspreview.PerformLayout();
this.tspreview.ResumeLayout(false);
this.tspreview.PerformLayout();
this.ResumeLayout(false);
}
@ -176,13 +493,43 @@ namespace ShiftOS.WinForms.Applications
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel pnlcategoryholder;
private System.Windows.Forms.FlowLayoutPanel flmeta;
private System.Windows.Forms.Button btnapply;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel pnlsettingsholder;
private System.Windows.Forms.FlowLayoutPanel flbody;
private System.Windows.Forms.FlowLayoutPanel flcategory;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel pnlpreview;
private System.Windows.Forms.Panel pnlwindow;
private System.Windows.Forms.Panel pnlcontents;
private System.Windows.Forms.Panel pnltitle;
private System.Windows.Forms.Panel pnlicon;
private System.Windows.Forms.Panel pnlminimize;
private System.Windows.Forms.Panel pnlmaximize;
private System.Windows.Forms.Panel pnlclose;
private System.Windows.Forms.Panel pnltitleleft;
private System.Windows.Forms.Panel pnltitleright;
private System.Windows.Forms.Label lbtitletext;
private System.Windows.Forms.Panel pnlbottom;
private System.Windows.Forms.Panel pnlbottomr;
private System.Windows.Forms.Panel pnlbottoml;
private System.Windows.Forms.Panel pnlright;
private System.Windows.Forms.Panel pnlleft;
private System.Windows.Forms.MenuStrip mspreview;
private System.Windows.Forms.ToolStripMenuItem menuToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem menuItem1ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem menuItem2ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem subitem1ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem subitem2ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem subitem3ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator separatorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem menuItem3ToolStripMenuItem;
private System.Windows.Forms.ToolStrip tspreview;
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripTextBox toolStripTextBox1;
}
}

View file

@ -47,6 +47,193 @@ namespace ShiftOS.WinForms.Applications
PopulateShifter();
}
[ShifterMeta("Windows")]
public void SetupWindowPreview()
{
pnlwindow.BringToFront();
WBSetup();
}
[ShifterMeta("Menus")]
public void SetupMenusPreview()
{
SetupWindowPreview();
}
[ShifterMeta("System")]
public void SetupSystemPreview()
{
SetupWindowPreview();
}
/// <summary>
/// Setup this instance.
/// </summary>
public void WBSetup()
{
this.lbtitletext.Text = "Window Preview";
if (SaveSystem.CurrentSave != null)
{
this.pnltitle.Visible = Shiftorium.UpgradeInstalled("wm_titlebar");
this.pnlclose.Visible = Shiftorium.UpgradeInstalled("close_button");
this.pnlminimize.Visible = Shiftorium.UpgradeInstalled("minimize_button");
this.pnlmaximize.Visible =Shiftorium.UpgradeInstalled("maximize_button");
WBSetupSkin();
}
else
{
this.pnltitle.Visible = false;
this.pnlclose.Visible = false;
this.pnlminimize.Visible = false;
this.pnlmaximize.Visible = false;
}
}
public Image GetImage(string id)
{
var type = typeof(ShiftOS.Engine.Skin);
foreach(var field in type.GetFields(BindingFlags.Public | BindingFlags.Instance))
{
foreach(var attrib in field.GetCustomAttributes(false))
{
if(attrib is ImageAttribute)
{
var img = attrib as ImageAttribute;
if(img.Name == id)
{
return SkinEngine.ImageFromBinary((byte[])field.GetValue(LoadedSkin));
}
}
}
}
return null;
}
public ImageLayout GetImageLayout(string img)
{
if (LoadedSkin.SkinImageLayouts.ContainsKey(img))
{
return LoadedSkin.SkinImageLayouts[img];
}
else
{
LoadedSkin.SkinImageLayouts.Add(img, ImageLayout.Tile);
return ImageLayout.Tile;
}
}
/// <summary>
/// Setups the skin.
/// </summary>
/// <returns>The skin.</returns>
public void WBSetupSkin()
{
this.DoubleBuffered = true;
var renderer = new ShiftOSMenuRenderer(LoadedSkin);
mspreview.Renderer = renderer;
tspreview.Renderer = renderer;
pnltitle.Height = LoadedSkin.TitlebarHeight;
pnltitle.BackColor = LoadedSkin.TitleBackgroundColor;
pnltitle.BackgroundImage = GetImage("titlebar");
pnltitleleft.Visible = LoadedSkin.ShowTitleCorners;
pnltitleright.Visible = LoadedSkin.ShowTitleCorners;
pnltitleleft.BackColor = LoadedSkin.TitleLeftCornerBackground;
pnltitleright.BackColor = LoadedSkin.TitleRightCornerBackground;
pnltitleleft.Width = LoadedSkin.TitleLeftCornerWidth;
pnltitleright.Width = LoadedSkin.TitleRightCornerWidth;
pnltitleleft.BackgroundImage = GetImage("titleleft");
pnltitleleft.BackgroundImageLayout = GetImageLayout("titleleft");
pnltitleright.BackgroundImage = GetImage("titleright");
pnltitleright.BackgroundImageLayout = GetImageLayout("titleright");
pnltitle.BackgroundImageLayout = GetImageLayout("titlebar"); //RETARD ALERT. WHY WASN'T THIS THERE WHEN IMAGELAYOUTS WERE FIRST IMPLEMENTED?
lbtitletext.BackColor = (pnltitle.BackgroundImage != null) ? Color.Transparent : LoadedSkin.TitleBackgroundColor;
lbtitletext.ForeColor = LoadedSkin.TitleTextColor;
lbtitletext.Font = LoadedSkin.TitleFont;
pnlleft.BackColor = LoadedSkin.BorderLeftBackground;
pnlleft.BackgroundImage = GetImage("leftborder");
pnlleft.BackgroundImageLayout = GetImageLayout("leftborder");
pnlleft.Width = LoadedSkin.LeftBorderWidth;
pnlright.BackColor = LoadedSkin.BorderRightBackground;
pnlright.BackgroundImage = GetImage("rightborder");
pnlright.BackgroundImageLayout = GetImageLayout("rightborder");
pnlright.Width = LoadedSkin.RightBorderWidth;
pnlbottom.BackColor = LoadedSkin.BorderBottomBackground;
pnlbottom.BackgroundImage = GetImage("bottomborder");
pnlbottom.BackgroundImageLayout = GetImageLayout("bottomborder");
pnlbottom.Height = LoadedSkin.BottomBorderWidth;
pnlbottomr.BackColor = LoadedSkin.BorderBottomRightBackground;
pnlbottomr.BackgroundImage = GetImage("bottomrborder");
pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborder");
pnlbottoml.BackColor = LoadedSkin.BorderBottomLeftBackground;
pnlbottoml.BackgroundImage = GetImage("bottomlborder");
pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborder");
lbtitletext.ForeColor = LoadedSkin.TitleTextColor;
lbtitletext.Font = LoadedSkin.TitleFont;
pnlclose.BackColor = LoadedSkin.CloseButtonColor;
pnlclose.BackgroundImage = GetImage("closebutton");
pnlclose.BackgroundImageLayout = GetImageLayout("closebutton");
pnlminimize.BackColor = LoadedSkin.MinimizeButtonColor;
pnlminimize.BackgroundImage = GetImage("minimizebutton");
pnlminimize.BackgroundImageLayout = GetImageLayout("minimizebutton");
pnlmaximize.BackColor = LoadedSkin.MaximizeButtonColor;
pnlmaximize.BackgroundImage = GetImage("maximizebutton");
pnlmaximize.BackgroundImageLayout = GetImageLayout("maximizebutton");
pnlclose.Size = LoadedSkin.CloseButtonSize;
pnlminimize.Size = LoadedSkin.MinimizeButtonSize;
pnlmaximize.Size = LoadedSkin.MaximizeButtonSize;
pnlclose.Location = FromRight(LoadedSkin.CloseButtonFromSide);
pnlminimize.Location = FromRight(LoadedSkin.MinimizeButtonFromSide);
pnlmaximize.Location = FromRight(LoadedSkin.MaximizeButtonFromSide);
pnlclose.Left -= pnlclose.Width;
pnlmaximize.Left -= pnlmaximize.Width;
pnlminimize.Left -= pnlminimize.Width;
switch (LoadedSkin.TitleTextCentered)
{
case false:
lbtitletext.Location = new Point(16 + LoadedSkin.TitlebarIconFromSide.X + LoadedSkin.TitleTextLeft.X,
LoadedSkin.TitleTextLeft.Y);
break;
default:
lbtitletext.Left = (pnltitle.Width - lbtitletext.Width) / 2;
lbtitletext.Top = LoadedSkin.TitleTextLeft.Y;
break;
}
if (Shiftorium.UpgradeInstalled("app_icons"))
{
pnlicon.Show();
pnlicon.Size = new Size(16, 16);
pnlicon.BackColor = Color.Transparent;
pnlicon.BackgroundImageLayout = ImageLayout.Stretch;
pnlicon.Location = LoadedSkin.TitlebarIconFromSide;
}
else
{
pnlicon.Hide();
}
}
/// <summary>
/// Froms the right.
/// </summary>
/// <returns>The right.</returns>
/// <param name="input">Input.</param>
public Point FromRight(Point input)
{
return new Point(pnltitle.Width - input.X, input.Y);
}
public int CodepointValue = 0;
public List<ShifterSetting> settings = new List<ShifterSetting>();
public Skin LoadedSkin = null;
@ -123,6 +310,21 @@ namespace ShiftOS.WinForms.Applications
btn.FlatStyle = FlatStyle.Flat;
btn.Click += (o, a) =>
{
foreach(var mth in this.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance))
{
foreach(var attrib in mth.GetCustomAttributes(false))
{
if(attrib is ShifterMetaAttribute)
{
var meta = attrib as ShifterMetaAttribute;
if(meta.Meta == btn.Text)
{
mth?.Invoke(this, null);
}
}
}
}
PopulateSubcategories(c);
};
@ -164,6 +366,21 @@ namespace ShiftOS.WinForms.Applications
}
}
public void InvokeSetup(string cat)
{
foreach(var mth in this.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance))
{
foreach(var attr in mth.GetCustomAttributes(false))
{
if(attr is ShifterMetaAttribute)
{
if ((attr as ShifterMetaAttribute).Meta == cat)
mth.Invoke(this, null);
}
}
}
}
public void PopulateBody(string cat, string subcat)
{
flbody.Controls.Clear();
@ -233,6 +450,7 @@ namespace ShiftOS.WinForms.Applications
width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
}
InvokeSetup(cat);
};
width.TextChanged += tc;
@ -247,7 +465,12 @@ namespace ShiftOS.WinForms.Applications
labelHeight = str.Height;
str.Text = c.Field.GetValue(LoadedSkin).ToString();
flbody.SetFlowBreak(str, true);
str.TextChanged += (o, a) => { c.Field.SetValue(LoadedSkin, str.Text); CodepointValue += 100; };
str.TextChanged += (o, a) =>
{
c.Field.SetValue(LoadedSkin, str.Text); CodepointValue += 100;
InvokeSetup(cat);
};
flbody.Controls.Add(str);
str.Show();
}
@ -271,6 +494,8 @@ namespace ShiftOS.WinForms.Applications
color.BackgroundImageLayout = layout;
LoadedSkin.SkinImageLayouts[c.Field.GetImageName()] = layout;
CodepointValue += 700;
InvokeSetup(cat);
})));
};
flbody.Controls.Add(color);
@ -316,6 +541,8 @@ namespace ShiftOS.WinForms.Applications
width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
}
InvokeSetup(cat);
};
width.TextChanged += tc;
@ -331,6 +558,8 @@ namespace ShiftOS.WinForms.Applications
{
c.Field.SetValue(LoadedSkin, check.Checked);
CodepointValue += 50;
InvokeSetup(cat);
};
flbody.SetFlowBreak(check, true);
@ -377,6 +606,8 @@ namespace ShiftOS.WinForms.Applications
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
CodepointValue += 100;
InvokeSetup(cat);
};
style.SelectedIndexChanged += (o, a) =>
@ -387,6 +618,8 @@ namespace ShiftOS.WinForms.Applications
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
CodepointValue += 50;
InvokeSetup(cat);
};
size.TextChanged += (o, a) =>
@ -404,6 +637,8 @@ namespace ShiftOS.WinForms.Applications
size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
}
CodepointValue += 50;
InvokeSetup(cat);
};
flbody.Controls.Add(name);
@ -434,6 +669,8 @@ namespace ShiftOS.WinForms.Applications
{
color.BackColor = col;
CodepointValue += 300;
InvokeSetup(cat);
})));
};
flbody.SetFlowBreak(color, true);
@ -457,6 +694,8 @@ namespace ShiftOS.WinForms.Applications
cBox.SelectedIndexChanged += (o, a) =>
{
c.Field.SetValue(LoadedSkin, Enum.Parse(c.Field.FieldType, cBox.Text));
InvokeSetup(cat);
};
labelHeight = cBox.Height;
@ -482,6 +721,8 @@ namespace ShiftOS.WinForms.Applications
{
c.Field.SetValue(LoadedSkin, name.SelectedIndex);
CodepointValue += 75;
InvokeSetup(cat);
};
labelHeight = name.Height;
flbody.Controls.Add(name);
@ -517,6 +758,8 @@ namespace ShiftOS.WinForms.Applications
{
width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
}
InvokeSetup(cat);
};
width.TextChanged += tc;

View file

@ -117,4 +117,56 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="tspreview.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolStripButton3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="mspreview.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -28,16 +28,16 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using static ShiftOS.Engine.SkinEngine;
using ShiftOS.Engine;
using System.Windows.Forms;
namespace ShiftOS.WinForms.Tools
{
public class ShiftOSMenuRenderer : ToolStripProfessionalRenderer
{
public ShiftOSMenuRenderer() : base(new ShiftOSColorTable())
public ShiftOSMenuRenderer() : base(new ShiftOSColorTable(ShiftOS.Engine.SkinEngine.LoadedSkin))
{
}
public ShiftOSMenuRenderer(ProfessionalColorTable table) : base(table)
@ -45,6 +45,26 @@ namespace ShiftOS.WinForms.Tools
}
public ShiftOSMenuRenderer(Skin skn) : base(new ShiftOSColorTable(skn))
{
}
public Skin LoadedSkin
{
get
{
if(ColorTable is ShiftOSColorTable)
{
return (ColorTable as ShiftOSColorTable).LoadedSkin;
}
else
{
return SkinEngine.LoadedSkin;
}
}
}
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
{
if (e.Item.Tag?.ToString() == "applauncherbutton")
@ -99,6 +119,18 @@ namespace ShiftOS.WinForms.Tools
public class ShiftOSColorTable : ProfessionalColorTable
{
public ShiftOSColorTable(ShiftOS.Engine.Skin skn)
{
LoadedSkin = skn;
}
public Skin LoadedSkin { get; private set; }
public Image GetImage(string id)
{
return SkinEngine.GetImage(id);
}
public override Color ButtonSelectedHighlight
{
get { return LoadedSkin.Menu_ButtonSelectedHighlight; }
@ -327,6 +359,19 @@ namespace ShiftOS.WinForms.Tools
public class AppLauncherColorTable : ProfessionalColorTable
{
public Image GetImage(string id)
{
return SkinEngine.GetImage(id);
}
public Skin LoadedSkin
{
get
{
return SkinEngine.LoadedSkin;
}
}
public override Color ButtonSelectedHighlight
{
get { return LoadedSkin.Menu_ButtonSelectedHighlight; }

View file

@ -129,7 +129,6 @@ namespace ShiftOS.WinForms
this.pnlcontents.Controls.Add(this._parentWindow);
this._parentWindow.Dock = DockStyle.Fill;
this._parentWindow.Show();
ControlManager.SetupControls(this._parentWindow);
ParentWindow.OnSkinLoad();
@ -139,9 +138,40 @@ namespace ShiftOS.WinForms
Setup();
ParentWindow.OnUpgrade();
};
Setup();
this._parentWindow.TextChanged += (o, a) =>
{
Setup();
Desktop.ResetPanelButtons();
Desktop.ShowWindow(this);
};
this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
if (!this.IsDialog)
{
Engine.AppearanceManager.OpenForms.Add(this);
}
SaveSystem.GameReady += () =>
{
if (Shiftorium.UpgradeInstalled("wm_free_placement"))
{
AppearanceManager.Invoke(new Action(() =>
{
this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
}));
}
AppearanceManager.Invoke(new Action(() =>
{
Setup();
}));
};
ParentWindow.OnLoad();
}
/// <summary>
@ -178,46 +208,7 @@ namespace ShiftOS.WinForms
public void WindowBorder_Load(object sender, EventArgs e)
{
this.DoubleBuffered = true;
this._parentWindow.TextChanged += (o, a) =>
{
Setup();
Desktop.ResetPanelButtons();
};
this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
if (!this.IsDialog)
{
Engine.AppearanceManager.OpenForms.Add(this);
}
SaveSystem.GameReady += () =>
{
if (Shiftorium.UpgradeInstalled("wm_free_placement"))
{
AppearanceManager.Invoke(new Action(() =>
{
this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
}));
}
AppearanceManager.Invoke(new Action(() =>
{
Setup();
}));
};
ControlManager.SetupControls(this);
Setup();
var sWin = (IShiftOSWindow)ParentWindow;
sWin.OnLoad();
this._parentWindow.Show();
}
/// <summary>

View file

@ -120,8 +120,7 @@ namespace ShiftOS.WinForms
var wb = new WindowBorder(form as UserControl);
wb.IsDialog = true;
wb.Show();
Desktop.ShowWindow(wb);
}
public override void SetupWindow(IShiftOSWindow form)
@ -213,6 +212,7 @@ namespace ShiftOS.WinForms
wb.FormClosed -= onClose;
};
wb.FormClosed += onClose;
Desktop.ShowWindow(wb);
SetupWindows();
}

View file

@ -64,10 +64,14 @@ namespace ShiftOS.Engine {
public static class SkinEngine {
public static ImageLayout GetImageLayout(string img) {
if (LoadedSkin.SkinImageLayouts.ContainsKey(img)) {
public static ImageLayout GetImageLayout(string img)
{
if (LoadedSkin.SkinImageLayouts.ContainsKey(img))
{
return LoadedSkin.SkinImageLayouts[img];
} else {
}
else
{
LoadedSkin.SkinImageLayouts.Add(img, ImageLayout.Tile);
return ImageLayout.Tile;
}