aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Desktop.cs
diff options
context:
space:
mode:
authorJohn T <[email protected]>2017-11-05 18:47:46 -0500
committerJohn T <[email protected]>2017-11-05 18:47:46 -0500
commita10440a45c40652b13e883aec832a0c8ded685e8 (patch)
treeab64311e47f8e59c7c46cd50c94bec424165ecc2 /ShiftOS.Main/ShiftOS/Desktop.cs
parent019da5b9ebf67b758a31dd05c4b17de66fa682f2 (diff)
downloadshiftos-rewind-a10440a45c40652b13e883aec832a0c8ded685e8.tar.gz
shiftos-rewind-a10440a45c40652b13e883aec832a0c8ded685e8.tar.bz2
shiftos-rewind-a10440a45c40652b13e883aec832a0c8ded685e8.zip
Added a half-complete ShiftFS and did some code cleanup
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Desktop.cs')
-rw-r--r--ShiftOS.Main/ShiftOS/Desktop.cs96
1 files changed, 50 insertions, 46 deletions
diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs
index 66392a7..9bfcb0f 100644
--- a/ShiftOS.Main/ShiftOS/Desktop.cs
+++ b/ShiftOS.Main/ShiftOS/Desktop.cs
@@ -1,14 +1,10 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Forms;
+using ShiftOS.Engine.Misc;
using ShiftOS.Engine.WindowManager;
-using ShiftOS.Engine;
+using ShiftOS.Main.Properties;
+using ShiftOS.Main.ShiftOS.Apps;
namespace ShiftOS.Main.ShiftOS
{
@@ -20,56 +16,64 @@ namespace ShiftOS.Main.ShiftOS
timer1.Start();
- this.Closed += (sender, args) =>
- {
- Application.Exit();
- };
+ Closed += (sender, args) => { Application.Exit(); };
#region Disgusting taskbar code
- ShiftWM.Windows.CollectionChanged += (sender, args) =>
+ ShiftWm.Windows.CollectionChanged += (sender, args) =>
{
- args.NewItems?.OfType<ShiftWindow>().ToList().ForEach(window =>
- {
- taskbar.Invoke(new Action(() =>
- {
- taskbar.Items.Add(new ToolStripButton
- {
- Text = window.Title.Text,
- Image = window.Icon.ToBitmap(),
- Tag = window.Id
- });
- }));
- });
-
- args.OldItems?.OfType<ShiftWindow>().ToList().ForEach(window =>
- {
- taskbar.Invoke(new Action(() =>
- {
- var tbRemovalList = taskbar.Items.OfType<ToolStripItem>().Where(i => (uint) i.Tag == window.Id);
+ args.NewItems?.OfType<ShiftWindow>()
+ .ToList()
+ .ForEach(
+ window =>
+ {
+ taskbar.Invoke(
+ new Action(
+ () =>
+ {
+ taskbar.Items.Add(
+ new ToolStripButton
+ {
+ Text = window.Title.Text,
+ Image = window.Icon.ToBitmap(),
+ Tag = window.Id
+ });
+ }));
+ });
- tbRemovalList.ToList().ForEach(p => taskbar.Items.Remove(p));
- }));
- });
+ args.OldItems?.OfType<ShiftWindow>()
+ .ToList()
+ .ForEach(
+ window =>
+ {
+ taskbar.Invoke(
+ new Action(
+ () =>
+ {
+ var tbRemovalList = taskbar.Items.OfType<ToolStripItem>().Where(i => (uint) i.Tag == window.Id);
+
+ tbRemovalList.ToList().ForEach(p => taskbar.Items.Remove(p));
+ }));
+ });
};
#endregion
}
- private void timer1_Tick(object sender, EventArgs e) =>
+ void timer1_Tick(object sender, EventArgs e) =>
taskbarClock.Text = $"{DateTime.Now:t}";
- private void terminalToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Apps.Terminal trm = new Apps.Terminal();
+ void terminalToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var trm = new Terminal();
- ShiftWM.Init(trm, "Terminal", null, false, true);
- }
+ ShiftWm.Init(trm, "Terminal", null);
+ }
- private void textPadToolStripMenuItem_Click(object sender, EventArgs e)
- {
- var tp = new Apps.TextPad();
- ShiftWM.Init(tp, "TextPad", Properties.Resources.iconTextPad.ToIcon());
- }
- }
-}
+ void textPadToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var tp = new TextPad();
+ ShiftWm.Init(tp, "TextPad", Resources.iconTextPad.ToIcon());
+ }
+ }
+} \ No newline at end of file