Skip to content

Commit

Permalink
Version 3.10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaskohl committed Feb 26, 2021
1 parent d8b5566 commit b511e02
Show file tree
Hide file tree
Showing 28 changed files with 1,666 additions and 183 deletions.
16 changes: 16 additions & 0 deletions CapsLockIndicatorV3/CapsLockIndicatorV3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
</Compile>
<Compile Include="DropDownLocale.cs" />
<Compile Include="ExtensionMethods.cs" />
<Compile Include="FirstRunDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FirstRunDialog.Designer.cs">
<DependentUpon>FirstRunDialog.cs</DependentUpon>
</Compile>
<Compile Include="HelpWindow.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -114,6 +120,12 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="MColorPicker.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MFontPicker.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Native.cs" />
<Compile Include="NumberInputDialog.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -157,6 +169,9 @@
<EmbeddedResource Include="DownloadDialog.resx">
<DependentUpon>DownloadDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FirstRunDialog.resx">
<DependentUpon>FirstRunDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="HelpWindow.resx">
<DependentUpon>HelpWindow.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -193,6 +208,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="CLIv3_Icon.ico" />
<None Include="Resources\logo_dark.Image.png" />
<None Include="Resources\defaultSettings.txt" />
<None Include="Resources\CLIv3_Scroll_On.ico" />
<None Include="Resources\CLIv3_Scroll_Off.ico" />
Expand Down
1 change: 0 additions & 1 deletion CapsLockIndicatorV3/DownloadDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 39 additions & 3 deletions CapsLockIndicatorV3/DownloadDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Windows.Forms;
Expand All @@ -27,10 +29,41 @@ protected override void WndProc(ref Message message)
public DownloadDialog()
{
InitializeComponent();
}

if (SettingsManager.Get<bool>("beta_enableDarkMode"))
{
HandleCreated += DownloadDialog_HandleCreated;

statusLabel.ForeColor =
infoLabel.ForeColor =
Color.White;

BackColor = Color.FromArgb(255, 32, 32, 32);
ForeColor = Color.White;

ControlScheduleSetDarkMode(downloadProgress);
ControlScheduleSetDarkMode(restartButton);
ControlScheduleSetDarkMode(closeButton);
ControlScheduleSetDarkMode(cancelButton);
}
}

private void DownloadDialog_HandleCreated(object sender, EventArgs e)
{
Native.UseImmersiveDarkModeColors(Handle, true);
}

private void ControlScheduleSetDarkMode(Control control)
{
control.HandleCreated += (sender, e) =>
{
Native.ControlSetDarkMode(control, true);
};
}

public void Download(string url)
{
{
#if !DEBUG
Uri uri = new Uri(url);
string filename = Path.GetFileName(uri.LocalPath);
string currentPath = Path.GetDirectoryName(Application.ExecutablePath);
Expand All @@ -45,6 +78,7 @@ public void Download(string url)
Client.DownloadFileAsync(new Uri(url), path);

newPath = path;
#endif
}

private void DownloadProgressCallback(object sender, DownloadProgressChangedEventArgs e)
Expand Down Expand Up @@ -100,11 +134,13 @@ private void restartButton_Click(object sender, EventArgs e)
rk.SetValue("CapsLock Indicator", newPath);
}

MainForm mainForm = (MainForm) Application.OpenForms["mainForm"];
MainForm mainForm = Application.OpenForms.OfType<MainForm>().First();

mainForm.askCancel = false;
Program.ReleaseMutex();

Thread.Sleep(100);

Process.Start(newPath);
Application.Exit();
}
Expand Down
231 changes: 231 additions & 0 deletions CapsLockIndicatorV3/FirstRunDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b511e02

Please sign in to comment.