diff options
| author | Michael <[email protected]> | 2017-05-31 19:23:40 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-31 19:23:40 -0400 |
| commit | 324104eb0b8650969b2205404e3ad83401fb100e (patch) | |
| tree | e1345eb1aee68d33eb16aaed57e9567e06a0fdf7 /ShiftOS.WinForms/WinformsDesktop.cs | |
| parent | b0da30bbde2bb198850ea45dc0006762b23f99a3 (diff) | |
| download | shiftos_thereturn-324104eb0b8650969b2205404e3ad83401fb100e.tar.gz shiftos_thereturn-324104eb0b8650969b2205404e3ad83401fb100e.tar.bz2 shiftos_thereturn-324104eb0b8650969b2205404e3ad83401fb100e.zip | |
volume control slider and other goodies
Diffstat (limited to 'ShiftOS.WinForms/WinformsDesktop.cs')
| -rw-r--r-- | ShiftOS.WinForms/WinformsDesktop.cs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index b9c4f37..f1dbe48 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -85,27 +85,24 @@ namespace ShiftOS.WinForms ic.Tag = itype.Name.ToLower(); //Next get the icon data if any. - var iconattrib = itype.GetCustomAttributes(false).FirstOrDefault(x => x is DefaultIconAttribute) as DefaultIconAttribute; - if(iconattrib != null) - { //We can use this attribute's ID in the skin engine to get an icon. - var img = GetIcon(iconattrib.ID); + var img = GetIcon(itype.Name); //Make it transparent. - (img as Bitmap).MakeTransparent(LoadedSkin.SystemKey); + (img as Bitmap).MakeTransparent(Color.White); //Assign it to the control ic.Image = img; //Set the sizing mode ic.SizeMode = PictureBoxSizeMode.StretchImage; - } - else - { - ic.BackColor = Color.White; //TODO: Make it skinnable. - } - ic.Size = new Size(20, 20); //TODO: make it skinnable + ic.Size = new Size(16, 16); //TODO: make it skinnable //add to the notification tray flnotifications.Controls.Add(ic); ic.Show(); + ic.BringToFront(); + + flnotifications.Show(); + + ic.Click += (o, a) => { HideAppLauncher(); @@ -115,7 +112,14 @@ namespace ShiftOS.WinForms UserControl ctrl = (UserControl)Activator.CreateInstance(itype); (ctrl as IStatusIcon).Setup(); currentSettingsPane = ctrl; - if(LoadedSkin.DesktopPanelPosition == 0) + ControlManager.SetupControls(ctrl); + this.Controls.Add(ctrl); + ctrl.BringToFront(); + int left = ic.Parent.PointToScreen(ic.Location).X; + int realleft = left - ctrl.Width; + realleft += ic.Width; + ctrl.Left = realleft; + if (LoadedSkin.DesktopPanelPosition == 0) { ctrl.Top = desktoppanel.Height; } @@ -123,10 +127,6 @@ namespace ShiftOS.WinForms { ctrl.Top = this.Height - desktoppanel.Height - ctrl.Height; } - int noteleft = flnotifications.PointToScreen(ic.Location).X; - int realleft = (this.Width - (noteleft + ic.Width)) - ctrl.Width; - ctrl.Left = realleft; - ControlManager.SetupControls(ctrl); ctrl.Show(); } |
