|
1 |
| -using QuickLibrary; |
2 |
| -using System; |
3 |
| -using System.Collections.Generic; |
4 |
| -using System.Diagnostics; |
5 |
| -using System.Reflection; |
6 |
| -using System.Windows.Forms; |
7 |
| - |
8 |
| -namespace quick_picture_viewer |
9 |
| -{ |
10 |
| - partial class AboutForm : QlibFixedForm |
11 |
| - { |
12 |
| - public AboutForm() |
13 |
| - { |
14 |
| - InitializeComponent(); |
15 |
| - SetDraggableControls(new List<Control>() { logoPictureBox, productLabel, versionLabel, copyrightLabel }); |
16 |
| - |
17 |
| - closeBtn.DarkMode = false; |
18 |
| - |
19 |
| - string fullVer = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
20 |
| - int lastDotIndex = fullVer.LastIndexOf('.'); |
21 |
| - versionLabel.Text = String.Format("v{0}", fullVer.Substring(0, lastDotIndex)); |
22 |
| - |
23 |
| - if (IntPtr.Size == 4) versionLabel.Text += " (x32)"; |
24 |
| - else if (IntPtr.Size == 8) versionLabel.Text += " (x64)"; |
25 |
| - |
26 |
| - if (ThemeMan.isWindows10()) makeDefaultBtn.Enabled = true; |
27 |
| - } |
28 |
| - |
29 |
| - protected override void OnHandleCreated(EventArgs e) |
30 |
| - { |
31 |
| - ThemeMan.ApplyDarkTitlebar(Handle, DarkMode); |
32 |
| - base.OnHandleCreated(e); |
33 |
| - } |
34 |
| - |
35 |
| - private void closeBtn_Click(object sender, EventArgs e) |
36 |
| - { |
37 |
| - Close(); |
38 |
| - } |
39 |
| - |
40 |
| - private void AboutForm_Load(object sender, EventArgs e) |
41 |
| - { |
42 |
| - InitLanguage(); |
43 |
| - } |
44 |
| - |
45 |
| - private void InitLanguage() |
46 |
| - { |
47 |
| - Text = LangMan.Get("about"); |
48 |
| - updatesBtn.Text = " " + LangMan.Get("check-for-app-updates"); |
49 |
| - descTextBox.Text = LangMan.Get("app-description"); |
50 |
| - makeDefaultBtn.Text = LangMan.Get("set-as-default-image-viewer"); |
51 |
| - infoTooltip.SetToolTip(closeBtn, NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCLOSE) + " | Alt+F4"); |
52 |
| - } |
53 |
| - |
54 |
| - private void makeDefaultBtn_Click(object sender, EventArgs e) |
55 |
| - { |
56 |
| - Process.Start("ms-settings:defaultapps"); |
57 |
| - } |
58 |
| - |
59 |
| - private void updatesBtn_Click(object sender, EventArgs e) |
60 |
| - { |
61 |
| - UpdateMan.CheckForUpdates(true, TopMost, Owner.Handle); |
62 |
| - Close(); |
63 |
| - } |
64 |
| - |
65 |
| - private void button1_Click(object sender, EventArgs e) |
66 |
| - { |
67 |
| - Process.Start("https://github.com/ModuleArt/quick-picture-viewer/"); |
68 |
| - } |
69 |
| - |
70 |
| - private void developerBtn_Click(object sender, EventArgs e) |
71 |
| - { |
72 |
| - Process.Start("https://moduleart.github.io"); |
73 |
| - } |
74 |
| - } |
75 |
| -} |
| 1 | +using QuickLibrary; |
| 2 | +using System; |
| 3 | +using System.Collections.Generic; |
| 4 | +using System.Diagnostics; |
| 5 | +using System.Reflection; |
| 6 | +using System.Windows.Forms; |
| 7 | + |
| 8 | +namespace quick_picture_viewer |
| 9 | +{ |
| 10 | + partial class AboutForm : QlibFixedForm |
| 11 | + { |
| 12 | + public AboutForm() |
| 13 | + { |
| 14 | + InitializeComponent(); |
| 15 | + SetDraggableControls(new List<Control>() { logoPictureBox, productLabel, versionLabel, copyrightLabel }); |
| 16 | + |
| 17 | + closeBtn.DarkMode = false; |
| 18 | + |
| 19 | + string fullVer = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
| 20 | + int lastDotIndex = fullVer.LastIndexOf('.'); |
| 21 | + versionLabel.Text = String.Format("v{0}", fullVer.Substring(0, lastDotIndex)); |
| 22 | + |
| 23 | + if (IntPtr.Size == 4) versionLabel.Text += " (x32)"; |
| 24 | + else if (IntPtr.Size == 8) versionLabel.Text += " (x64)"; |
| 25 | + |
| 26 | + if (ThemeMan.isWindows10()) makeDefaultBtn.Enabled = true; |
| 27 | + } |
| 28 | + |
| 29 | + protected override void OnHandleCreated(EventArgs e) |
| 30 | + { |
| 31 | + ThemeMan.ApplyDarkTitlebar(Handle, DarkMode); |
| 32 | + base.OnHandleCreated(e); |
| 33 | + } |
| 34 | + |
| 35 | + private void closeBtn_Click(object sender, EventArgs e) |
| 36 | + { |
| 37 | + Close(); |
| 38 | + } |
| 39 | + |
| 40 | + private void AboutForm_Load(object sender, EventArgs e) |
| 41 | + { |
| 42 | + InitLanguage(); |
| 43 | + } |
| 44 | + |
| 45 | + private void InitLanguage() |
| 46 | + { |
| 47 | + Text = LangMan.Get("about"); |
| 48 | + updatesBtn.Text = " " + LangMan.Get("check-for-app-updates"); |
| 49 | + descTextBox.Text = LangMan.Get("app-description"); |
| 50 | + makeDefaultBtn.Text = LangMan.Get("set-as-default-image-viewer"); |
| 51 | + infoTooltip.SetToolTip(closeBtn, NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCLOSE) + " | Alt+F4"); |
| 52 | + } |
| 53 | + |
| 54 | + private void makeDefaultBtn_Click(object sender, EventArgs e) |
| 55 | + { |
| 56 | + Process.Start("ms-settings:defaultapps"); |
| 57 | + } |
| 58 | + |
| 59 | + private void updatesBtn_Click(object sender, EventArgs e) |
| 60 | + { |
| 61 | + UpdateMan.CheckForUpdates(true, TopMost, Owner.Handle); |
| 62 | + Close(); |
| 63 | + } |
| 64 | + |
| 65 | + private void button1_Click(object sender, EventArgs e) |
| 66 | + { |
| 67 | + Process.Start("https://github.com/ModuleArt/quick-picture-viewer/"); |
| 68 | + } |
| 69 | + |
| 70 | + private void developerBtn_Click(object sender, EventArgs e) |
| 71 | + { |
| 72 | + Process.Start("https://moduleart.github.io"); |
| 73 | + } |
| 74 | + } |
| 75 | +} |
0 commit comments