From b0da30bbde2bb198850ea45dc0006762b23f99a3 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 31 May 2017 09:14:27 -0400 Subject: [PATCH] COMPLETELY WORKING notification system! --- ShiftOS.WinForms/WinformsDesktop.cs | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 0cfd667..b9c4f37 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -106,7 +106,32 @@ namespace ShiftOS.WinForms flnotifications.Controls.Add(ic); ic.Show(); - //TODO: Settings pane on click. + ic.Click += (o, a) => + { + HideAppLauncher(); + + if(itype.BaseType == typeof(UserControl)) + { + UserControl ctrl = (UserControl)Activator.CreateInstance(itype); + (ctrl as IStatusIcon).Setup(); + currentSettingsPane = ctrl; + if(LoadedSkin.DesktopPanelPosition == 0) + { + ctrl.Top = desktoppanel.Height; + } + else + { + 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(); + } + + + }; } } @@ -151,6 +176,8 @@ namespace ShiftOS.WinForms notekiller.Start(); } + private UserControl currentSettingsPane = null; + /// /// Initializes a new instance of the class. /// @@ -1101,6 +1128,8 @@ namespace ShiftOS.WinForms { this.Invoke(new Action(() => { + currentSettingsPane?.Hide(); + currentSettingsPane = null; pnladvancedal.Hide(); })); }