AboutWindow.Designer.cs 15 KB

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