diff options
Diffstat (limited to 'ShiftOS.WinForms')
10 files changed, 130 insertions, 32 deletions
diff --git a/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs b/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs index 6263ff7..d7f03a0 100644 --- a/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs +++ b/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs @@ -141,12 +141,10 @@ namespace ShiftOS.WinForms.Applications // // pgplaytime // - this.pgplaytime.BlockSize = 5; this.pgplaytime.Location = new System.Drawing.Point(46, 3); this.pgplaytime.Maximum = 100; this.pgplaytime.Name = "pgplaytime"; this.pgplaytime.Size = new System.Drawing.Size(749, 23); - this.pgplaytime.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pgplaytime.TabIndex = 1; this.pgplaytime.Tag = "keepbg"; this.pgplaytime.Text = "shiftedProgressBar1"; diff --git a/ShiftOS.WinForms/Applications/Installer.Designer.cs b/ShiftOS.WinForms/Applications/Installer.Designer.cs index 48f9146..b01986d 100644 --- a/ShiftOS.WinForms/Applications/Installer.Designer.cs +++ b/ShiftOS.WinForms/Applications/Installer.Designer.cs @@ -118,12 +118,10 @@ // this.pginstall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pginstall.BlockSize = 5; this.pginstall.Location = new System.Drawing.Point(17, 161); this.pginstall.Maximum = 100; this.pginstall.Name = "pginstall"; this.pginstall.Size = new System.Drawing.Size(414, 23); - this.pginstall.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pginstall.TabIndex = 2; this.pginstall.Text = "shiftedProgressBar1"; this.pginstall.Value = 0; diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs index f9d0bb4..dc107c4 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs @@ -242,12 +242,10 @@ namespace ShiftOS.WinForms.Applications // this.pgupgradeprogress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pgupgradeprogress.BlockSize = 5; this.pgupgradeprogress.Location = new System.Drawing.Point(146, 390); this.pgupgradeprogress.Maximum = 100; this.pgupgradeprogress.Name = "pgupgradeprogress"; this.pgupgradeprogress.Size = new System.Drawing.Size(254, 23); - this.pgupgradeprogress.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pgupgradeprogress.TabIndex = 1; this.pgupgradeprogress.Value = 25; // diff --git a/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs b/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs index 0b23b8e..d30e2df 100644 --- a/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs +++ b/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs @@ -64,12 +64,10 @@ // this.pgdownload.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pgdownload.BlockSize = 5; this.pgdownload.Location = new System.Drawing.Point(86, 4); this.pgdownload.Maximum = 100; this.pgdownload.Name = "pgdownload"; this.pgdownload.Size = new System.Drawing.Size(427, 23); - this.pgdownload.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pgdownload.TabIndex = 2; this.pgdownload.Text = "Updating..."; this.pgdownload.Value = 0; diff --git a/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs b/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs index d915c31..1d93047 100644 --- a/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs +++ b/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs @@ -91,12 +91,10 @@ // // pgplaytime // - this.pgplaytime.BlockSize = 5; this.pgplaytime.Location = new System.Drawing.Point(46, 3); this.pgplaytime.Maximum = 100; this.pgplaytime.Name = "pgplaytime"; this.pgplaytime.Size = new System.Drawing.Size(749, 23); - this.pgplaytime.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pgplaytime.TabIndex = 1; this.pgplaytime.Tag = "keepbg"; this.pgplaytime.Text = "shiftedProgressBar1"; diff --git a/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs b/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs index e5a2c33..ceaff02 100644 --- a/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs +++ b/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs @@ -31,6 +31,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using ShiftOS.Engine; namespace ShiftOS.WinForms.Controls { @@ -46,7 +47,7 @@ namespace ShiftOS.WinForms.Controls t.Interval = 100; t.Tick += (o, a) => { - if(this._style == ProgressBarStyle.Marquee) + if(this.Style == ProgressBarStyle.Marquee) { if(_marqueePos >= this.Width) { @@ -89,46 +90,100 @@ namespace ShiftOS.WinForms.Controls } } - public ProgressBarStyle _style = ProgressBarStyle.Continuous; - public ProgressBarStyle Style { - get { return _style; } - set { _style = value; this.Refresh(); } + get + { + return SkinEngine.LoadedSkin.ProgressBarStyle; + } } - private int _blocksize = 5; - public int BlockSize { - get { return _blocksize; } - set + get { - _blocksize = value; - this.Refresh(); + return SkinEngine.LoadedSkin.ProgressBarBlockSize; + } + } + + public Color RealBackColor + { + get + { + return SkinEngine.LoadedSkin.ProgressBarBackgroundColor; + } + } + + public Image RealBackgroundImage + { + get + { + return SkinEngine.GetImage("progressbarbg"); + } + } + + public Image ProgressImage + { + get + { + return SkinEngine.GetImage("progress"); + } + } + + public Color ProgressColor + { + get + { + return SkinEngine.LoadedSkin.ProgressColor; } } protected override void OnPaint(PaintEventArgs pe) { - pe.Graphics.Clear(Color.Black); - switch (_style) + pe.Graphics.Clear(this.RealBackColor); + if(RealBackgroundImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(RealBackgroundImage), new Rectangle(0, 0, this.Width, this.Height)); + } + switch (Style) { case ProgressBarStyle.Continuous: double width = linear(this.Value, 0, this.Maximum, 0, this.Width); - pe.Graphics.FillRectangle(new SolidBrush(Color.Green), new RectangleF(0, 0, (float)width, this.Height)); + if (ProgressImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new RectangleF(0, 0, (float)width, this.Height)); + } + else + { + pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new RectangleF(0, 0, (float)width, this.Height)); + } break; case ProgressBarStyle.Blocks: - int block_count = this.Width / (this._blocksize + 2); + int block_count = this.Width / (this.BlockSize + 2); int blocks = (int)linear(this.Value, 0, this.Maximum, 0, block_count); for(int i = 0; i < blocks - 1; i++) { - int position = i * (_blocksize + 2); - pe.Graphics.FillRectangle(new SolidBrush(Color.Green), new Rectangle(position, 0, _blocksize, this.Height)); + int position = i * (BlockSize + 2); + if (ProgressImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(position, 0, BlockSize, this.Height)); + + } + else + { + pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(position, 0, BlockSize, this.Height)); + } } break; case ProgressBarStyle.Marquee: - pe.Graphics.FillRectangle(new SolidBrush(Color.Green), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); + if (ProgressImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); + } + else + { + pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); + } break; } } diff --git a/ShiftOS.WinForms/DesktopWidgets/UpgradePercentage.Designer.cs b/ShiftOS.WinForms/DesktopWidgets/UpgradePercentage.Designer.cs index ca0d587..4867c8d 100644 --- a/ShiftOS.WinForms/DesktopWidgets/UpgradePercentage.Designer.cs +++ b/ShiftOS.WinForms/DesktopWidgets/UpgradePercentage.Designer.cs @@ -34,13 +34,11 @@ // // pgupgrades // - this.pgupgrades.BlockSize = 5; this.pgupgrades.Dock = System.Windows.Forms.DockStyle.Bottom; this.pgupgrades.Location = new System.Drawing.Point(0, 99); this.pgupgrades.Maximum = 100; this.pgupgrades.Name = "pgupgrades"; this.pgupgrades.Size = new System.Drawing.Size(227, 23); - this.pgupgrades.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pgupgrades.TabIndex = 0; this.pgupgrades.Text = "shiftedProgressBar1"; this.pgupgrades.Value = 0; diff --git a/ShiftOS.WinForms/DownloadControl.Designer.cs b/ShiftOS.WinForms/DownloadControl.Designer.cs index 2587b93..69c828d 100644 --- a/ShiftOS.WinForms/DownloadControl.Designer.cs +++ b/ShiftOS.WinForms/DownloadControl.Designer.cs @@ -83,12 +83,10 @@ namespace ShiftOS.WinForms // this.pgprogress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pgprogress.BlockSize = 5; this.pgprogress.Location = new System.Drawing.Point(4, 52); this.pgprogress.Maximum = 100; this.pgprogress.Name = "pgprogress"; this.pgprogress.Size = new System.Drawing.Size(371, 23); - this.pgprogress.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.pgprogress.TabIndex = 0; this.pgprogress.Text = "shiftedProgressBar1"; this.pgprogress.Value = 0; diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index c3d27ae..cc68c6f 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -8,6 +8,20 @@ Category: "Enhancements", }, { + Name: "Shift Progress Bar", + Cost: 150, + Description: "Want to customize the look of all ShiftOS Progress Bars? Buy this upgrade today and you'll get the ability to set the foreground and background color of the progress bar, and many more things!.", + Dependencies: "shifter;shift_buttons", + Category: "Customization" + }, + { + Name: "Shift Buttons", + Cost: 150, + Description: "Want to customize the look of all ShiftOS buttons? This Shifter upgrade gives you a new \"Buttons\" category in the System category to do just that.", + Dependencies: "shifter", + Category: "Customization" + }, + { Name: "GUI Based Login Screen", Cost: 500, Description: "Tired of using the text-based login screen in ShiftOS? Well, we have a functioning window manager, and a functioning desktop, why not use these tools to create a functioning and awesome-looking login screen?", diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs index 3d66b2b..4f888ab 100644 --- a/ShiftOS.WinForms/Tools/ControlManager.cs +++ b/ShiftOS.WinForms/Tools/ControlManager.cs @@ -214,6 +214,49 @@ namespace ShiftOS.WinForms.Tools { } + + if(ctrl is Button) + { + Desktop.InvokeOnWorkerThread(() => + { + Button b = ctrl as Button; + b.BackColor = SkinEngine.LoadedSkin.ButtonBackgroundColor; + b.BackgroundImage = SkinEngine.GetImage("buttonidle"); + b.BackgroundImageLayout = SkinEngine.GetImageLayout("buttonidle"); + b.FlatAppearance.BorderSize = SkinEngine.LoadedSkin.ButtonBorderWidth; + b.FlatAppearance.BorderColor = SkinEngine.LoadedSkin.ButtonForegroundColor; + b.ForeColor = SkinEngine.LoadedSkin.ButtonForegroundColor; + b.Font = SkinEngine.LoadedSkin.ButtonTextFont; + + b.MouseEnter += (o, a) => + { + b.BackColor = SkinEngine.LoadedSkin.ButtonHoverColor; + b.BackgroundImage = SkinEngine.GetImage("buttonhover"); + b.BackgroundImageLayout = SkinEngine.GetImageLayout("buttonhover"); + }; + b.MouseLeave += (o, a) => + { + b.BackColor = SkinEngine.LoadedSkin.ButtonBackgroundColor; + b.BackgroundImage = SkinEngine.GetImage("buttonidle"); + b.BackgroundImageLayout = SkinEngine.GetImageLayout("buttonidle"); + }; + b.MouseUp += (o, a) => + { + b.BackColor = SkinEngine.LoadedSkin.ButtonBackgroundColor; + b.BackgroundImage = SkinEngine.GetImage("buttonidle"); + b.BackgroundImageLayout = SkinEngine.GetImageLayout("buttonidle"); + }; + + b.MouseDown += (o, a) => + { + b.BackColor = SkinEngine.LoadedSkin.ButtonPressedColor; + b.BackgroundImage = SkinEngine.GetImage("buttonpressed"); + b.BackgroundImageLayout = SkinEngine.GetImageLayout("buttonpressed"); + + }; + }); + } + ctrl.KeyDown += (o, a) => { if (a.Control && a.KeyCode == Keys.T) |
