aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-02-25 10:07:28 -0500
committerlempamo <[email protected]>2017-02-25 10:07:28 -0500
commit046560fe991f439c8cc45e8e355bf9f801e514ac (patch)
treee8c14c7cfbc192d2e0cf60e3faef32d24b86ba0c /ShiftOS.WinForms
parent271c973c3f1de0afd96a4ad3d0e0ed43b5e1b4f8 (diff)
parent413a7da898716d43711dcfe99791b329bb6d866b (diff)
downloadshiftos_thereturn-046560fe991f439c8cc45e8e355bf9f801e514ac.tar.gz
shiftos_thereturn-046560fe991f439c8cc45e8e355bf9f801e514ac.tar.bz2
shiftos_thereturn-046560fe991f439c8cc45e8e355bf9f801e514ac.zip
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/Applications/Notifications.Designer.cs1
-rw-r--r--ShiftOS.WinForms/Applications/Notifications.cs59
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs12
3 files changed, 47 insertions, 25 deletions
diff --git a/ShiftOS.WinForms/Applications/Notifications.Designer.cs b/ShiftOS.WinForms/Applications/Notifications.Designer.cs
index d9a8388..74fd5b7 100644
--- a/ShiftOS.WinForms/Applications/Notifications.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Notifications.Designer.cs
@@ -47,6 +47,7 @@
// fllist
//
this.fllist.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.fllist.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.fllist.Location = new System.Drawing.Point(0, 33);
this.fllist.Name = "fllist";
this.fllist.Size = new System.Drawing.Size(437, 487);
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
+ {
+
+ }
}
}
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index ded68ba..957c793 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -60,6 +60,14 @@ namespace ShiftOS.WinForms
{
InitializeComponent();
this.TopMost = false;
+
+ NotificationDaemon.NotificationMade += (note) =>
+ {
+ //Soon this will pop a balloon note.
+ btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")";
+
+ };
+
this.LocationChanged += (o, a) =>
{
if (this.Left != 0)
@@ -80,6 +88,10 @@ namespace ShiftOS.WinForms
{
if(this.Visible == true)
this.Invoke(new Action(() => SetupDesktop()));
+ this.Invoke(new Action(() =>
+ {
+ btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")";
+ }));
};
Shiftorium.Installed += () =>
{