AboutWindow.Designer.cs 14 KB

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