Skip to content

Commit

Permalink
About: Add link to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelKlaer committed May 2, 2023
1 parent 4c833e2 commit df6a62d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
34 changes: 27 additions & 7 deletions Minesweeper/About.Designer.cs

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

18 changes: 18 additions & 0 deletions Minesweeper/About.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel;
using System.Diagnostics;
using Minesweeper.Controllers;
using Minesweeper.Utils.Helpers;

Expand Down Expand Up @@ -35,6 +36,7 @@ private void SettingsChanged(object? sender, PropertyChangedEventArgs e)
ForeColor = UtilsClass.BlackOrWhite(BackColor);

copyrightLabel.ForeColor = UtilsClass.ChangeColorBrightness2(ForeColor, 0.2f);
githubLabel.ForeColor = UtilsClass.ChangeColorBrightness2(ForeColor, 0.2f);
}

/// <summary>
Expand All @@ -47,4 +49,20 @@ private void LanguageChanged(object? sender, EventArgs e)
iconLabel.Text = LanguageController.CurrentLanguageResource.AppEmoji;
copyrightLabel.Text = LanguageController.CurrentLanguageResource.AppCopyright;
}

/// <summary>
/// Event that gets called when GithubLabel is clicked.
/// </summary>
private void GithubLabelClick(object sender, EventArgs e)
{
// Create a new shell process
ProcessStartInfo psInfo = new()
{
FileName = "https://github.com/ManuelKlaer/windows-forms-minesweeper",
UseShellExecute = true
};

// Start the shell process to open the url
Process.Start(psInfo);
}
}

0 comments on commit df6a62d

Please sign in to comment.