AboutWindow.cs 2.7 KB

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