Skip to content

Commit

Permalink
(Re)Implement basic functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Naamloos committed May 12, 2022
1 parent 82ceb8e commit f50475a
Show file tree
Hide file tree
Showing 9 changed files with 3,025 additions and 50 deletions.
1 change: 1 addition & 0 deletions src/FlippedTaskbar11/FlippedTaskbar11.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

</Project>
39 changes: 0 additions & 39 deletions src/FlippedTaskbar11/Form1.Designer.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/FlippedTaskbar11/Form1.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/FlippedTaskbar11/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static void Main()
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
Application.Run(new SettingsForm());
}
}
}
82 changes: 82 additions & 0 deletions src/FlippedTaskbar11/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions src/FlippedTaskbar11/Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using FlippedTaskbar11.TaskbarLogics;

namespace FlippedTaskbar11
{
public partial class SettingsForm : Form
{
private TaskbarManager taskbar;

public SettingsForm()
{
InitializeComponent();

taskbar = new TaskbarManager();

trayIcon.ContextMenuStrip = new ContextMenuStrip();
trayIcon.ContextMenuStrip.Items.AddRange(new ToolStripItem[]
{
new ToolStripButton("Show Settings", null, onTrayShow, "Show Settings"),
new ToolStripButton("Exit", null, onTrayExit, "Exit")
});

taskbar.StartTaskbarLoop();
}

private void onTrayIconClick(object sender, MouseEventArgs e)
{
this.WindowState = FormWindowState.Normal;
this.Show();
this.BringToFront();
}

private void onTrayShow(object? sender, EventArgs eventargs)
{
onTrayIconClick(null, null);
}

private void onTrayExit(object? sender, EventArgs eventargs)
{
taskbar.StopTaskbarLoop();
this.Dispose();
Application.Exit();
}

private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
this.Hide();
}
}
}
Loading

0 comments on commit f50475a

Please sign in to comment.