diff options
| author | Michael <[email protected]> | 2017-05-30 21:50:19 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-30 21:50:19 -0400 |
| commit | ecf5297dbb9fd551005963dc1d430ed348848390 (patch) | |
| tree | d14ff61b9912c09123826b76727adc9359ae4136 | |
| parent | 0451b5d15703987b6be1160917ea31d36f6ee125 (diff) | |
| download | shiftos_thereturn-ecf5297dbb9fd551005963dc1d430ed348848390.tar.gz shiftos_thereturn-ecf5297dbb9fd551005963dc1d430ed348848390.tar.bz2 shiftos_thereturn-ecf5297dbb9fd551005963dc1d430ed348848390.zip | |
slightly fix balloon notes
| -rw-r--r-- | ShiftOS.WinForms/WinformsDesktop.cs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 95e7c1a..76c5050 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -47,8 +47,24 @@ namespace ShiftOS.WinForms /// <summary> /// Winforms desktop. /// </summary> + [Namespace("desktop")] public partial class WinformsDesktop : Form, IDesktop { + [Command("pushnote")] + [RequiresArgument("target")] + [RequiresArgument("title")] + [RequiresArgument("body")] + public static bool PushNote(Dictionary<string, object> args) + { + string ta = args["target"].ToString(); + string ti = args["title"].ToString(); + string bo = args["body"].ToString(); + + Desktop.PushNotification(ta, ti, bo); + + return true; + } + public List<IDesktopWidget> Widgets = new List<IDesktopWidget>(); @@ -64,7 +80,7 @@ namespace ShiftOS.WinForms pnlnotificationbox.Left = desktoppanel.Width - pnlnotificationbox.Width; else { - int left = ctl.PointToScreen(ctl.Location).X; + int left = ctl.Parent.PointToScreen(ctl.Location).X; int realleft = left - pnlnotificationbox.Width; realleft += ctl.Width; pnlnotificationbox.Left = realleft; @@ -75,6 +91,7 @@ namespace ShiftOS.WinForms pnlnotificationbox.Top = desktoppanel.Height; else pnlnotificationbox.Top = this.Height - desktoppanel.Height - pnlnotificationbox.Height; + ControlManager.SetupControls(pnlnotificationbox); var notekiller = new System.Windows.Forms.Timer(); notekiller.Interval = 10000; notekiller.Tick += (o, a) => @@ -83,6 +100,7 @@ namespace ShiftOS.WinForms }; Engine.AudioManager.PlayStream(Properties.Resources.infobox); pnlnotificationbox.Show(); + pnlnotificationbox.BringToFront(); notekiller.Start(); } |
