aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx/Ui/Windows/AboutWindow.Designer.cs
blob: fa1a0657824cee81e068960d6533fa47442981de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
using Gtk;
using Pango;
using Ryujinx.Ui.Common.Configuration;
using System.Reflection;

namespace Ryujinx.Ui.Windows
{
    public partial class AboutWindow : Window
    {
        private Box            _mainBox;
        private Box            _leftBox;
        private Box            _logoBox;
        private Image          _ryujinxLogo;
        private Box            _logoTextBox;
        private Label          _ryujinxLabel;
        private Label          _ryujinxPhoneticLabel;
        private EventBox       _ryujinxLink;
        private Label          _ryujinxLinkLabel;
        private Label          _versionLabel;
        private Label          _disclaimerLabel;
        private EventBox       _amiiboApiLink;
        private Label          _amiiboApiLinkLabel;
        private Box            _socialBox;
        private EventBox       _patreonEventBox;
        private Box            _patreonBox;
        private Image          _patreonLogo;
        private Label          _patreonLabel;
        private EventBox       _githubEventBox;
        private Box            _githubBox;
        private Image          _githubLogo;
        private Label          _githubLabel;
        private Box            _discordBox;
        private EventBox       _discordEventBox;
        private Image          _discordLogo;
        private Label          _discordLabel;
        private EventBox       _twitterEventBox;
        private Box            _twitterBox;
        private Image          _twitterLogo;
        private Label          _twitterLabel;
        private Separator      _separator;
        private Box            _rightBox;
        private Label          _aboutLabel;
        private Label          _aboutDescriptionLabel;
        private Label          _createdByLabel;
        private TextView       _createdByText;
        private EventBox       _contributorsEventBox;
        private Label          _contributorsLinkLabel;
        private Label          _patreonNamesLabel;
        private ScrolledWindow _patreonNamesScrolled;
        private TextView       _patreonNamesText;

        private void InitializeComponent()
        {

#pragma warning disable CS0612

            //
            // AboutWindow
            //
            CanFocus       = false;
            Resizable      = false;
            Modal          = true;
            WindowPosition = WindowPosition.Center;
            DefaultWidth   = 800;
            DefaultHeight  = 450;
            TypeHint       = Gdk.WindowTypeHint.Dialog;

            //
            // _mainBox
            //
            _mainBox = new Box(Orientation.Horizontal, 0);

            //
            // _leftBox
            //
            _leftBox = new Box(Orientation.Vertical, 0)
            {
                Margin      = 15,
                MarginLeft  = 30,
                MarginRight = 0
            };

            //
            // _logoBox
            //
            _logoBox = new Box(Orientation.Horizontal, 0);

            //
            // _ryujinxLogo
            //
            _ryujinxLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png", 100, 100))
            {
                Margin     = 10,
                MarginLeft = 15
            };

            //
            // _logoTextBox
            //
            _logoTextBox = new Box(Orientation.Vertical, 0);

            //
            // _ryujinxLabel
            //
            _ryujinxLabel = new Label("Ryujinx")
            {
                MarginTop  = 15,
                Justify    = Justification.Center,
                Attributes = new AttrList()
            };
            _ryujinxLabel.Attributes.Insert(new Pango.AttrScale(2.7f));

            //
            // _ryujinxPhoneticLabel
            //
            _ryujinxPhoneticLabel = new Label("(REE-YOU-JINX)")
            {
                Justify = Justification.Center
            };

            //
            // _ryujinxLink
            //
            _ryujinxLink = new EventBox()
            {
                Margin = 5
            };
            _ryujinxLink.ButtonPressEvent += RyujinxButton_Pressed;

            //
            // _ryujinxLinkLabel
            //
            _ryujinxLinkLabel = new Label("www.ryujinx.org")
            {
                TooltipText = "Click to open the Ryujinx website in your default browser.",
                Justify     = Justification.Center,
                Attributes  = new AttrList()
            };
            _ryujinxLinkLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));

            //
            // _versionLabel
            //
            _versionLabel = new Label(Program.Version)
            {
                Expand  = true,
                Justify = Justification.Center,
                Margin  = 5
            };

            //
            // _disclaimerLabel
            //
            _disclaimerLabel = new Label("Ryujinx is not affiliated with Nintendo™,\nor any of its partners, in any way.")
            {
                Expand     = true,
                Justify    = Justification.Center,
                Margin     = 5,
                Attributes = new AttrList()
            };
            _disclaimerLabel.Attributes.Insert(new Pango.AttrScale(0.8f));

            //
            // _amiiboApiLink
            //
            _amiiboApiLink = new EventBox()
            {
                Margin = 5
            };
            _amiiboApiLink.ButtonPressEvent += AmiiboApiButton_Pressed;

            //
            // _amiiboApiLinkLabel
            //
            _amiiboApiLinkLabel = new Label("AmiiboAPI (www.amiiboapi.com) is used\nin our Amiibo emulation.")
            {
                TooltipText = "Click to open the AmiiboAPI website in your default browser.",
                Justify     = Justification.Center,
                Attributes  = new AttrList()
            };
            _amiiboApiLinkLabel.Attributes.Insert(new Pango.AttrScale(0.9f));

            //
            // _socialBox
            //
            _socialBox = new Box(Orientation.Horizontal, 0)
            {
                Margin       = 25,
                MarginBottom = 10
            };

            //
            // _patreonEventBox
            //
            _patreonEventBox = new EventBox()
            {
                TooltipText = "Click to open the Ryujinx Patreon page in your default browser."
            };
            _patreonEventBox.ButtonPressEvent += PatreonButton_Pressed;

            //
            // _patreonBox
            //
            _patreonBox = new Box(Orientation.Vertical, 0);

            //
            // _patreonLogo
            //
            _patreonLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Patreon_Light.png", 30, 30))
            {
                Margin = 10
            };

            //
            // _patreonLabel
            //
            _patreonLabel = new Label("Patreon")
            {
                Justify = Justification.Center
            };

            //
            // _githubEventBox
            //
            _githubEventBox = new EventBox()
            {
                TooltipText = "Click to open the Ryujinx GitHub page in your default browser."
            };
            _githubEventBox.ButtonPressEvent += GitHubButton_Pressed;

            //
            // _githubBox
            //
            _githubBox = new Box(Orientation.Vertical, 0);

            //
            // _githubLogo
            //
            _githubLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_GitHub_Light.png", 30, 30))
            {
                Margin = 10
            };

            //
            // _githubLabel
            //
            _githubLabel = new Label("GitHub")
            {
                Justify = Justification.Center
            };

            //
            // _discordBox
            //
            _discordBox = new Box(Orientation.Vertical, 0);

            //
            // _discordEventBox
            //
            _discordEventBox = new EventBox()
            {
                TooltipText = "Click to open an invite to the Ryujinx Discord server in your default browser."
            };
            _discordEventBox.ButtonPressEvent += DiscordButton_Pressed;

            //
            // _discordLogo
            //
            _discordLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Discord_Light.png", 30, 30))
            {
                Margin = 10
            };

            //
            // _discordLabel
            //
            _discordLabel = new Label("Discord")
            {
                Justify = Justification.Center
            };

            //
            // _twitterEventBox
            //
            _twitterEventBox = new EventBox()
            {
                TooltipText = "Click to open the Ryujinx Twitter page in your default browser."
            };
            _twitterEventBox.ButtonPressEvent += TwitterButton_Pressed;

            //
            // _twitterBox
            //
            _twitterBox = new Box(Orientation.Vertical, 0);

            //
            // _twitterLogo
            //
            _twitterLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Twitter_Light.png", 30, 30))
            {
                Margin = 10
            };

            //
            // _twitterLabel
            //
            _twitterLabel = new Label("Twitter")
            {
                Justify = Justification.Center
            };

            //
            // _separator
            //
            _separator = new Separator(Orientation.Vertical)
            {
                Margin = 15
            };

            //
            // _rightBox
            //
            _rightBox = new Box(Orientation.Vertical, 0)
            {
                Margin    = 15,
                MarginTop = 40
            };

            //
            // _aboutLabel
            //
            _aboutLabel = new Label("About :")
            {
                Halign     = Align.Start,
                Attributes = new AttrList()
            };
            _aboutLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
            _aboutLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));

            //
            // _aboutDescriptionLabel
            //
            _aboutDescriptionLabel = new Label("Ryujinx is an emulator for the Nintendo Switch™.\n" +
                                               "Please support us on Patreon.\n" +
                                               "Get all the latest news on our Twitter or Discord.\n" +
                                               "Developers interested in contributing can find out more on our GitHub or Discord.")
            {
                Margin = 15,
                Halign = Align.Start
            };

            //
            // _createdByLabel
            //
            _createdByLabel = new Label("Maintained by :")
            {
                Halign     = Align.Start,
                Attributes = new AttrList()
            };
            _createdByLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
            _createdByLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));

            //
            // _createdByText
            //
            _createdByText = new TextView()
            {
                WrapMode      = Gtk.WrapMode.Word,
                Editable      = false,
                CursorVisible = false,
                Margin        = 15,
                MarginRight   = 30
            };
            _createdByText.Buffer.Text = "gdkchan, Ac_K, Thog, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, Xpl0itR, GoffyDude, »jD« and more...";

            //
            // _contributorsEventBox
            //
            _contributorsEventBox = new EventBox();
            _contributorsEventBox.ButtonPressEvent += ContributorsButton_Pressed;

            //
            // _contributorsLinkLabel
            //
            _contributorsLinkLabel = new Label("See All Contributors...")
            {
                TooltipText = "Click to open the Contributors page in your default browser.",
                MarginRight = 30,
                Halign      = Align.End,
                Attributes  = new AttrList()
            };
            _contributorsLinkLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));

            //
            // _patreonNamesLabel
            //
            _patreonNamesLabel = new Label("Supported on Patreon by :")
            {
                Halign     = Align.Start,
                Attributes = new AttrList()
            };
            _patreonNamesLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
            _patreonNamesLabel.Attributes.Insert(new Pango.AttrUnderline(Underline.Single));

            //
            // _patreonNamesScrolled
            //
            _patreonNamesScrolled = new ScrolledWindow()
            {
                Margin      = 15,
                MarginRight = 30,
                Expand      = true,
                ShadowType  = ShadowType.In
            };
            _patreonNamesScrolled.SetPolicy(PolicyType.Never, PolicyType.Automatic);

            //
            // _patreonNamesText
            //
            _patreonNamesText = new TextView()
            {
                WrapMode = Gtk.WrapMode.Word
            };
            _patreonNamesText.Buffer.Text = "Loading...";
            _patreonNamesText.SetProperty("editable", new GLib.Value(false));

#pragma warning restore CS0612

            ShowComponent();
        }

        private void ShowComponent()
        {
            _logoBox.Add(_ryujinxLogo);

            _ryujinxLink.Add(_ryujinxLinkLabel);

            _logoTextBox.Add(_ryujinxLabel);
            _logoTextBox.Add(_ryujinxPhoneticLabel);
            _logoTextBox.Add(_ryujinxLink);

            _logoBox.Add(_logoTextBox);

            _amiiboApiLink.Add(_amiiboApiLinkLabel);

            _patreonBox.Add(_patreonLogo);
            _patreonBox.Add(_patreonLabel);
            _patreonEventBox.Add(_patreonBox);

            _githubBox.Add(_githubLogo);
            _githubBox.Add(_githubLabel);
            _githubEventBox.Add(_githubBox);

            _discordBox.Add(_discordLogo);
            _discordBox.Add(_discordLabel);
            _discordEventBox.Add(_discordBox);

            _twitterBox.Add(_twitterLogo);
            _twitterBox.Add(_twitterLabel);
            _twitterEventBox.Add(_twitterBox);

            _socialBox.Add(_patreonEventBox);
            _socialBox.Add(_githubEventBox);
            _socialBox.Add(_discordEventBox);
            _socialBox.Add(_twitterEventBox);

            _leftBox.Add(_logoBox);
            _leftBox.Add(_versionLabel);
            _leftBox.Add(_disclaimerLabel);
            _leftBox.Add(_amiiboApiLink);
            _leftBox.Add(_socialBox);

            _contributorsEventBox.Add(_contributorsLinkLabel);
            _patreonNamesScrolled.Add(_patreonNamesText);

            _rightBox.Add(_aboutLabel);
            _rightBox.Add(_aboutDescriptionLabel);
            _rightBox.Add(_createdByLabel);
            _rightBox.Add(_createdByText);
            _rightBox.Add(_contributorsEventBox);
            _rightBox.Add(_patreonNamesLabel);
            _rightBox.Add(_patreonNamesScrolled);

            _mainBox.Add(_leftBox);
            _mainBox.Add(_separator);
            _mainBox.Add(_rightBox);

            Add(_mainBox);

            ShowAll();
        }
    }
}