aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Desktop.cs
diff options
context:
space:
mode:
authorJohn T <[email protected]>2017-11-11 08:53:55 -0500
committerJohn T <[email protected]>2017-11-11 08:53:55 -0500
commit97722fbe9d474adffbba0b92e9727c48a8205234 (patch)
tree65dfe45bbfd194ddb534cc80107ab8e6d80cf5bc /ShiftOS.Main/ShiftOS/Desktop.cs
parenta10440a45c40652b13e883aec832a0c8ded685e8 (diff)
downloadshiftos-rewind-97722fbe9d474adffbba0b92e9727c48a8205234.tar.gz
shiftos-rewind-97722fbe9d474adffbba0b92e9727c48a8205234.tar.bz2
shiftos-rewind-97722fbe9d474adffbba0b92e9727c48a8205234.zip
Only 1/4 broken ShiftFS and WIP File Skimmer
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Desktop.cs')
-rw-r--r--ShiftOS.Main/ShiftOS/Desktop.cs66
1 files changed, 31 insertions, 35 deletions
diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs
index 9bfcb0f..95e4d26 100644
--- a/ShiftOS.Main/ShiftOS/Desktop.cs
+++ b/ShiftOS.Main/ShiftOS/Desktop.cs
@@ -20,41 +20,32 @@ namespace ShiftOS.Main.ShiftOS
#region Disgusting taskbar code
- ShiftWm.Windows.CollectionChanged += (sender, args) =>
+ ShiftWM.Windows.ItemAdded += (sender, e) =>
{
- 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
- });
- }));
- });
+ taskbar.Invoke(
+ new Action(
+ () =>
+ {
+ taskbar.Items.Add(
+ new ToolStripButton
+ {
+ Text = e.Item.Title.Text,
+ Image = e.Item.Icon.ToBitmap(),
+ Tag = e.Item.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);
+ ShiftWM.Windows.ItemRemoved += (sender, e) =>
+ {
+ taskbar.Invoke(
+ new Action(
+ () =>
+ {
+ var tbRemovalList = taskbar.Items.OfType<ToolStripItem>().Where(i => (uint) i.Tag == e.Item.Id);
- tbRemovalList.ToList().ForEach(p => taskbar.Items.Remove(p));
- }));
- });
+ tbRemovalList.ToList().ForEach(p => taskbar.Items.Remove(p));
+ }));
};
#endregion
@@ -66,14 +57,19 @@ namespace ShiftOS.Main.ShiftOS
void terminalToolStripMenuItem_Click(object sender, EventArgs e)
{
var trm = new Terminal();
-
- ShiftWm.Init(trm, "Terminal", null);
+ ShiftWM.Init(trm, "Terminal", null);
}
void textPadToolStripMenuItem_Click(object sender, EventArgs e)
{
var tp = new TextPad();
- ShiftWm.Init(tp, "TextPad", Resources.iconTextPad.ToIcon());
+ ShiftWM.Init(tp, "TextPad", Resources.iconTextPad);
+ }
+
+ void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var fs = new FileSkimmer();
+ ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer);
}
}
} \ No newline at end of file