diff options
| author | Michael <[email protected]> | 2017-02-25 10:03:36 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-25 10:03:36 -0500 |
| commit | 910a1c455e0176bfff7776e47f9160e349cfaf67 (patch) | |
| tree | 0d8b17eafb1bd76d3b6daadabc2452bd807d72e1 /ShiftOS.WinForms/Applications/Notifications.cs | |
| parent | ea18e37bffacbb8d52b875eecc860dc985ba8bc5 (diff) | |
| download | shiftos_thereturn-910a1c455e0176bfff7776e47f9160e349cfaf67.tar.gz shiftos_thereturn-910a1c455e0176bfff7776e47f9160e349cfaf67.tar.bz2 shiftos_thereturn-910a1c455e0176bfff7776e47f9160e349cfaf67.zip | |
Notification counter on desktop.
Diffstat (limited to 'ShiftOS.WinForms/Applications/Notifications.cs')
| -rw-r--r-- | ShiftOS.WinForms/Applications/Notifications.cs | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/ShiftOS.WinForms/Applications/Notifications.cs b/ShiftOS.WinForms/Applications/Notifications.cs index 4f7cc55..6fb659d 100644 --- a/ShiftOS.WinForms/Applications/Notifications.cs +++ b/ShiftOS.WinForms/Applications/Notifications.cs @@ -36,32 +36,41 @@ namespace ShiftOS.WinForms.Applications { if (note.Read == false) { - showNoNotes = false; - var headerLabel = new Label(); - headerLabel.Tag = "header2"; - ControlManager.SetupControl(headerLabel); - headerLabel.Text = ParseNotification(note); - headerLabel.Width = fllist.Width - 4; - fllist.Controls.Add(headerLabel); - headerLabel.Show(); - - var markButton = new Button(); - ControlManager.SetupControl(markButton); - markButton.Text = "Mark as read"; - markButton.Click += (o, a) => + try { - NotificationDaemon.MarkRead(new List<Notification>(NotificationDaemon.GetAllFromFile()).IndexOf(note)); - SetupUI(); - }; - fllist.Controls.Add(markButton); - markButton.Show(); - - var dataLabel = new Label(); - dataLabel.Text = ParseNotificationData(note); - dataLabel.MaximumSize = new Size(fllist.Width - 4, 0); - dataLabel.AutoSize = true; - fllist.Controls.Add(dataLabel); - dataLabel.Show(); + showNoNotes = false; + var headerLabel = new Label(); + headerLabel.Tag = "header2"; + ControlManager.SetupControl(headerLabel); + headerLabel.Text = ParseNotification(note); + headerLabel.Width = fllist.Width - 4; + fllist.Controls.Add(headerLabel); + headerLabel.Show(); + + var markButton = new Button(); + ControlManager.SetupControl(markButton); + markButton.Text = "Mark as read"; + markButton.AutoSize = true; + markButton.AutoSizeMode = AutoSizeMode.GrowAndShrink; + markButton.Click += (o, a) => + { + NotificationDaemon.MarkRead(new List<Notification>(NotificationDaemon.GetAllFromFile()).IndexOf(note)); + SetupUI(); + }; + fllist.Controls.Add(markButton); + markButton.Show(); + + var dataLabel = new Label(); + dataLabel.Text = ParseNotificationData(note); + dataLabel.MaximumSize = new Size(fllist.Width - 4, 0); + dataLabel.AutoSize = true; + fllist.Controls.Add(dataLabel); + dataLabel.Show(); + } + catch + { + + } } } |
