AboutWindow.Designer.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. using Gtk;
  2. using Pango;
  3. using System.Reflection;
  4. namespace Ryujinx.Ui.Windows
  5. {
  6. public partial class AboutWindow : Window
  7. {
  8. private Box _mainBox;
  9. private Box _leftBox;
  10. private Box _logoBox;
  11. private Image _ryujinxLogo;
  12. private Box _logoTextBox;
  13. private Label _ryujinxLabel;
  14. private Label _ryujinxPhoneticLabel;
  15. private EventBox _ryujinxLink;
  16. private Label _ryujinxLinkLabel;
  17. private Label _versionLabel;
  18. private Label _disclaimerLabel;
  19. private EventBox _amiiboApiLink;
  20. private Label _amiiboApiLinkLabel;
  21. private Box _socialBox;
  22. private EventBox _patreonEventBox;
  23. private Box _patreonBox;
  24. private Image _patreonLogo;
  25. private Label _patreonLabel;
  26. private EventBox _githubEventBox;
  27. private Box _githubBox;
  28. private Image _githubLogo;
  29. private Label _githubLabel;
  30. private Box _discordBox;
  31. private EventBox _discordEventBox;
  32. private Image _discordLogo;
  33. private Label _discordLabel;
  34. private EventBox _twitterEventBox;
  35. private Box _twitterBox;
  36. private Image _twitterLogo;
  37. private Label _twitterLabel;
  38. private Separator _separator;
  39. private Box _rightBox;
  40. private Label _aboutLabel;
  41. private Label _aboutDescriptionLabel;
  42. private Label _createdByLabel;
  43. private TextView _createdByText;
  44. private EventBox _contributorsEventBox;
  45. private Label _contributorsLinkLabel;
  46. private Label _patreonNamesLabel;
  47. private ScrolledWindow _patreonNamesScrolled;
  48. private TextView _patreonNamesText;
  49. private void InitializeComponent()
  50. {
  51. #pragma warning disable CS0612
  52. //
  53. // AboutWindow
  54. //
  55. CanFocus = false;
  56. Resizable = false;
  57. Modal = true;
  58. WindowPosition = WindowPosition.Center;
  59. DefaultWidth = 800;
  60. DefaultHeight = 450;
  61. TypeHint = Gdk.WindowTypeHint.Dialog;
  62. //
  63. // _mainBox
  64. //
  65. _mainBox = new Box(Orientation.Horizontal, 0);
  66. //
  67. // _leftBox
  68. //
  69. _leftBox = new Box(Orientation.Vertical, 0)
  70. {
  71. Margin = 15,
  72. MarginLeft = 30,
  73. MarginRight = 0
  74. };
  75. //
  76. // _logoBox
  77. //
  78. _logoBox = new Box(Orientation.Horizontal, 0);
  79. //
  80. // _ryujinxLogo
  81. //
  82. _ryujinxLogo = new Image(new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_Ryujinx.png", 100, 100))
  83. {
  84. Margin = 10,
  85. MarginLeft = 15
  86. };
  87. //
  88. // _logoTextBox
  89. //
  90. _logoTextBox = new Box(Orientation.Vertical, 0);
  91. //
  92. // _ryujinxLabel
  93. //
  94. _ryujinxLabel = new Label("Ryujinx")
  95. {
  96. MarginTop = 15,
  97. Justify = Justification.Center,
  98. Attributes = new AttrList()
  99. };
  100. _ryujinxLabel.Attributes.Insert(new Pango.AttrScale(2.7f));
  101. //
  102. // _ryujinxPhoneticLabel
  103. //
  104. _ryujinxPhoneticLabel = new Label("(REE-YOU-JI-NX)")
  105. {
  106. Justify = Justification.Center
  107. };
  108. //
  109. // _ryujinxLink
  110. //
  111. _ryujinxLink = new EventBox()
  112. {
  113. Margin = 5
  114. };
  115. _ryujinxLink.ButtonPressEvent += RyujinxButton_Pressed;
  116. //
  117. // _ryujinxLinkLabel
  118. //
  119. _ryujinxLinkLabel = new Label("www.ryujinx.org")
  120. {
  121. TooltipText = "Click to open the Ryujinx website in your default browser.",
  122. Justify = Justification.Center,
  123. Attributes = new AttrList()
  124. };
  125. _ryujinxLinkLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));
  126. //
  127. // _versionLabel
  128. //
  129. _versionLabel = new Label(Program.Version)
  130. {
  131. Expand = true,
  132. Justify = Justification.Center,
  133. Margin = 5
  134. };
  135. //
  136. // _disclaimerLabel
  137. //
  138. _disclaimerLabel = new Label("Ryujinx is not affiliated with Nintendo™,\nor any of its partners, in any way.")
  139. {
  140. Expand = true,
  141. Justify = Justification.Center,
  142. Margin = 5,
  143. Attributes = new AttrList()
  144. };
  145. _disclaimerLabel.Attributes.Insert(new Pango.AttrScale(0.8f));
  146. //
  147. // _amiiboApiLink
  148. //
  149. _amiiboApiLink = new EventBox()
  150. {
  151. Margin = 5
  152. };
  153. _amiiboApiLink.ButtonPressEvent += AmiiboApiButton_Pressed;
  154. //
  155. // _amiiboApiLinkLabel
  156. //
  157. _amiiboApiLinkLabel = new Label("AmiiboAPI (www.amiiboapi.com) is used\nin our Amiibo emulation.")
  158. {
  159. TooltipText = "Click to open the AmiiboAPI website in your default browser.",
  160. Justify = Justification.Center,
  161. Attributes = new AttrList()
  162. };
  163. _amiiboApiLinkLabel.Attributes.Insert(new Pango.AttrScale(0.9f));
  164. //
  165. // _socialBox
  166. //
  167. _socialBox = new Box(Orientation.Horizontal, 0)
  168. {
  169. Margin = 25,
  170. MarginBottom = 10
  171. };
  172. //
  173. // _patreonEventBox
  174. //
  175. _patreonEventBox = new EventBox()
  176. {
  177. TooltipText = "Click to open the Ryujinx Patreon page in your default browser."
  178. };
  179. _patreonEventBox.ButtonPressEvent += PatreonButton_Pressed;
  180. //
  181. // _patreonBox
  182. //
  183. _patreonBox = new Box(Orientation.Vertical, 0);
  184. //
  185. // _patreonLogo
  186. //
  187. _patreonLogo = new Image(new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_Patreon.png", 30, 30))
  188. {
  189. Margin = 10
  190. };
  191. //
  192. // _patreonLabel
  193. //
  194. _patreonLabel = new Label("Patreon")
  195. {
  196. Justify = Justification.Center
  197. };
  198. //
  199. // _githubEventBox
  200. //
  201. _githubEventBox = new EventBox()
  202. {
  203. TooltipText = "Click to open the Ryujinx GitHub page in your default browser."
  204. };
  205. _githubEventBox.ButtonPressEvent += GitHubButton_Pressed;
  206. //
  207. // _githubBox
  208. //
  209. _githubBox = new Box(Orientation.Vertical, 0);
  210. //
  211. // _githubLogo
  212. //
  213. _githubLogo = new Image(new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_GitHub.png", 30, 30))
  214. {
  215. Margin = 10
  216. };
  217. //
  218. // _githubLabel
  219. //
  220. _githubLabel = new Label("GitHub")
  221. {
  222. Justify = Justification.Center
  223. };
  224. //
  225. // _discordBox
  226. //
  227. _discordBox = new Box(Orientation.Vertical, 0);
  228. //
  229. // _discordEventBox
  230. //
  231. _discordEventBox = new EventBox()
  232. {
  233. TooltipText = "Click to open an invite to the Ryujinx Discord server in your default browser."
  234. };
  235. _discordEventBox.ButtonPressEvent += DiscordButton_Pressed;
  236. //
  237. // _discordLogo
  238. //
  239. _discordLogo = new Image(new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_Discord.png", 30, 30))
  240. {
  241. Margin = 10
  242. };
  243. //
  244. // _discordLabel
  245. //
  246. _discordLabel = new Label("Discord")
  247. {
  248. Justify = Justification.Center
  249. };
  250. //
  251. // _twitterEventBox
  252. //
  253. _twitterEventBox = new EventBox()
  254. {
  255. TooltipText = "Click to open the Ryujinx Twitter page in your default browser."
  256. };
  257. _twitterEventBox.ButtonPressEvent += TwitterButton_Pressed;
  258. //
  259. // _twitterBox
  260. //
  261. _twitterBox = new Box(Orientation.Vertical, 0);
  262. //
  263. // _twitterLogo
  264. //
  265. _twitterLogo = new Image(new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_Twitter.png", 30, 30))
  266. {
  267. Margin = 10
  268. };
  269. //
  270. // _twitterLabel
  271. //
  272. _twitterLabel = new Label("Twitter")
  273. {
  274. Justify = Justification.Center
  275. };
  276. //
  277. // _separator
  278. //
  279. _separator = new Separator(Orientation.Vertical)
  280. {
  281. Margin = 15
  282. };
  283. //
  284. // _rightBox
  285. //
  286. _rightBox = new Box(Orientation.Vertical, 0)
  287. {
  288. Margin = 15,
  289. MarginTop = 40
  290. };
  291. //
  292. // _aboutLabel
  293. //
  294. _aboutLabel = new Label("About :")
  295. {
  296. Halign = Align.Start,
  297. Attributes = new AttrList()
  298. };
  299. _aboutLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
  300. _aboutLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));
  301. //
  302. // _aboutDescriptionLabel
  303. //
  304. _aboutDescriptionLabel = new Label("Ryujinx is an emulator for the Nintendo Switch™.\n" +
  305. "Please support us on Patreon.\n" +
  306. "Get all the latest news on our Twitter or Discord.\n" +
  307. "Developers interested in contributing can find out more on our GitHub or Discord.")
  308. {
  309. Margin = 15,
  310. Halign = Align.Start
  311. };
  312. //
  313. // _createdByLabel
  314. //
  315. _createdByLabel = new Label("Maintained by :")
  316. {
  317. Halign = Align.Start,
  318. Attributes = new AttrList()
  319. };
  320. _createdByLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
  321. _createdByLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));
  322. //
  323. // _createdByText
  324. //
  325. _createdByText = new TextView()
  326. {
  327. WrapMode = Gtk.WrapMode.Word,
  328. Editable = false,
  329. CursorVisible = false,
  330. Margin = 15,
  331. MarginRight = 30
  332. };
  333. _createdByText.Buffer.Text = "gdkchan, Ac_K, Thog, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, Xpl0itR, GoffyDude, »jD« and more...";
  334. //
  335. // _contributorsEventBox
  336. //
  337. _contributorsEventBox = new EventBox();
  338. _contributorsEventBox.ButtonPressEvent += ContributorsButton_Pressed;
  339. //
  340. // _contributorsLinkLabel
  341. //
  342. _contributorsLinkLabel = new Label("See All Contributors...")
  343. {
  344. TooltipText = "Click to open the Contributors page in your default browser.",
  345. MarginRight = 30,
  346. Halign = Align.End,
  347. Attributes = new AttrList()
  348. };
  349. _contributorsLinkLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));
  350. //
  351. // _patreonNamesLabel
  352. //
  353. _patreonNamesLabel = new Label("Supported on Patreon by :")
  354. {
  355. Halign = Align.Start,
  356. Attributes = new AttrList()
  357. };
  358. _patreonNamesLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
  359. _patreonNamesLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));
  360. //
  361. // _patreonNamesScrolled
  362. //
  363. _patreonNamesScrolled = new ScrolledWindow()
  364. {
  365. Margin = 15,
  366. MarginRight = 30,
  367. Expand = true,
  368. ShadowType = ShadowType.In
  369. };
  370. _patreonNamesScrolled.SetPolicy(PolicyType.Never, PolicyType.Automatic);
  371. //
  372. // _patreonNamesText
  373. //
  374. _patreonNamesText = new TextView()
  375. {
  376. WrapMode = Gtk.WrapMode.Word
  377. };
  378. _patreonNamesText.Buffer.Text = "Loading...";
  379. _patreonNamesText.SetProperty("editable", new GLib.Value(false));
  380. #pragma warning restore CS0612
  381. ShowComponent();
  382. }
  383. private void ShowComponent()
  384. {
  385. _logoBox.Add(_ryujinxLogo);
  386. _ryujinxLink.Add(_ryujinxLinkLabel);
  387. _logoTextBox.Add(_ryujinxLabel);
  388. _logoTextBox.Add(_ryujinxPhoneticLabel);
  389. _logoTextBox.Add(_ryujinxLink);
  390. _logoBox.Add(_logoTextBox);
  391. _amiiboApiLink.Add(_amiiboApiLinkLabel);
  392. _patreonBox.Add(_patreonLogo);
  393. _patreonBox.Add(_patreonLabel);
  394. _patreonEventBox.Add(_patreonBox);
  395. _githubBox.Add(_githubLogo);
  396. _githubBox.Add(_githubLabel);
  397. _githubEventBox.Add(_githubBox);
  398. _discordBox.Add(_discordLogo);
  399. _discordBox.Add(_discordLabel);
  400. _discordEventBox.Add(_discordBox);
  401. _twitterBox.Add(_twitterLogo);
  402. _twitterBox.Add(_twitterLabel);
  403. _twitterEventBox.Add(_twitterBox);
  404. _socialBox.Add(_patreonEventBox);
  405. _socialBox.Add(_githubEventBox);
  406. _socialBox.Add(_discordEventBox);
  407. _socialBox.Add(_twitterEventBox);
  408. _leftBox.Add(_logoBox);
  409. _leftBox.Add(_versionLabel);
  410. _leftBox.Add(_disclaimerLabel);
  411. _leftBox.Add(_amiiboApiLink);
  412. _leftBox.Add(_socialBox);
  413. _contributorsEventBox.Add(_contributorsLinkLabel);
  414. _patreonNamesScrolled.Add(_patreonNamesText);
  415. _rightBox.Add(_aboutLabel);
  416. _rightBox.Add(_aboutDescriptionLabel);
  417. _rightBox.Add(_createdByLabel);
  418. _rightBox.Add(_createdByText);
  419. _rightBox.Add(_contributorsEventBox);
  420. _rightBox.Add(_patreonNamesLabel);
  421. _rightBox.Add(_patreonNamesScrolled);
  422. _mainBox.Add(_leftBox);
  423. _mainBox.Add(_separator);
  424. _mainBox.Add(_rightBox);
  425. Add(_mainBox);
  426. ShowAll();
  427. }
  428. }
  429. }