AboutWindow.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using Gtk;
  2. using System;
  3. using System.Diagnostics;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6. using GUI = Gtk.Builder.ObjectAttribute;
  7. namespace Ryujinx.Ui
  8. {
  9. public class AboutWindow : Window
  10. {
  11. #pragma warning disable CS0649
  12. #pragma warning disable IDE0044
  13. [GUI] Label _versionText;
  14. [GUI] Image _ryujinxLogo;
  15. [GUI] Image _patreonLogo;
  16. [GUI] Image _gitHubLogo;
  17. [GUI] Image _discordLogo;
  18. [GUI] Image _twitterLogo;
  19. #pragma warning restore CS0649
  20. #pragma warning restore IDE0044
  21. public AboutWindow() : this(new Builder("Ryujinx.Ui.AboutWindow.glade")) { }
  22. private AboutWindow(Builder builder) : base(builder.GetObject("_aboutWin").Handle)
  23. {
  24. builder.Autoconnect(this);
  25. this.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
  26. _ryujinxLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png" , 100, 100);
  27. _patreonLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.PatreonLogo.png", 30 , 30 );
  28. _gitHubLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.GitHubLogo.png" , 30 , 30 );
  29. _discordLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.DiscordLogo.png", 30 , 30 );
  30. _twitterLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.TwitterLogo.png", 30 , 30 );
  31. _versionText.Text = Program.Version;
  32. }
  33. //Events
  34. private void RyujinxButton_Pressed(object sender, ButtonPressEventArgs args)
  35. {
  36. UrlHelper.OpenUrl("https://ryujinx.org");
  37. }
  38. private void PatreonButton_Pressed(object sender, ButtonPressEventArgs args)
  39. {
  40. UrlHelper.OpenUrl("https://www.patreon.com/ryujinx");
  41. }
  42. private void GitHubButton_Pressed(object sender, ButtonPressEventArgs args)
  43. {
  44. UrlHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx");
  45. }
  46. private void DiscordButton_Pressed(object sender, ButtonPressEventArgs args)
  47. {
  48. UrlHelper.OpenUrl("https://discordapp.com/invite/N2FmfVc");
  49. }
  50. private void TwitterButton_Pressed(object sender, ButtonPressEventArgs args)
  51. {
  52. UrlHelper.OpenUrl("https://twitter.com/RyujinxEmu");
  53. }
  54. private void ContributorsButton_Pressed(object sender, ButtonPressEventArgs args)
  55. {
  56. UrlHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx/graphs/contributors?type=a");
  57. }
  58. private void CloseToggle_Activated(object sender, EventArgs args)
  59. {
  60. Dispose();
  61. }
  62. }
  63. }