Skip to content

Commit

Permalink
Version 3.13.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaskohl committed Aug 17, 2021
1 parent 0e659b4 commit f8c760c
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 110 deletions.
138 changes: 66 additions & 72 deletions CapsLockIndicatorV3/MainForm.Designer.cs

Large diffs are not rendered by default.

63 changes: 32 additions & 31 deletions CapsLockIndicatorV3/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ public MainForm()
// Initialize component
InitializeComponent();

Opacity = 0;
ShowInTaskbar = false;
Visible = false;

// Load "resources.resx" into a ResourceManager to access its resources
resources = new ResourceManager("CapsLockIndicatorV3.resources", Assembly.GetExecutingAssembly());
Expand Down Expand Up @@ -120,19 +119,7 @@ public MainForm()

// Check if application is in startup
startonlogonCheckBox.Checked = Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "CapsLock Indicator", null) != null;

// Hides the window on startup if enabled
if (SettingsManager.Get<bool>("hideOnStartup"))
{
hideOnStartupCheckBox.Checked = true;
hideWindowTimer.Start();
}
else
{
Opacity = 1;
ShowInTaskbar = true;
}

hideOnStartupCheckBox.Checked = SettingsManager.Get<bool>("hideOnStartup");
checkForUpdatedCheckBox.Checked = SettingsManager.Get<bool>("checkForUpdates");

AddCultures();
Expand Down Expand Up @@ -240,10 +227,26 @@ public MainForm()

if (oldVersionVer < Versions.SettingsToTabs)
tutorialTimer.Start();
tutorialTimer.Start();

tabControl1.SelectedIndexChanged += TabControl1_SelectedIndexChanged;

if (!SettingsManager.Get<bool>("hideOnStartup"))
Visible = true;
}

//bool allowShow = false;
//protected override void OnVisibleChanged(EventArgs e)
//{
// base.OnVisibleChanged(e);

// if (!allowShow && SettingsManager.Get<bool>("hideOnStartup"))
// {
// Visible = false;
// allowShow = true;
// }
//}

private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
//MessageBox.Show(tabControl1.SelectedTab.Text);
Expand All @@ -259,11 +262,12 @@ private void tutorialTimer_Tick(object sender, EventArgs e)
tutorialToolTip.Active = true;
// Hack to fix incorrect step/tip placement on first invokation
// See: https://stackoverflow.com/a/8716963
tutorialToolTip.Show(string.Empty, tabControl1, pt, 1);
tutorialToolTip.Show(
strings.settingsChangedToolTip,
tabControl1,
pt, 6000);
//tutorialToolTip.Show(string.Empty, tabControl1, pt, 1);
//tutorialToolTip.Show(
// strings.settingsChangedToolTip,
// tabControl1,
// pt, 6000);
MessageBox.Show(Location.ToString() + "\r\n" + Opacity.ToString());
}

private Point GetRectCenter(Rectangle rectangle)
Expand Down Expand Up @@ -918,7 +922,7 @@ private void HideForm()
//generalIcon.ShowBalloonTip(100);
Hide();
isHidden = true;
Opacity = 1;
//Opacity = 1;
}

void GeneralIconMouseDoubleClick(object sender, MouseEventArgs e)
Expand Down Expand Up @@ -989,21 +993,16 @@ private void hideOnStartupCheckBox_CheckedChanged(object sender, EventArgs e)
SettingsManager.Save();
}


// This timer is required for some reason
private void hideWindowTimer_Tick(object sender, EventArgs e)
{
hideWindowTimer.Stop();
hideWindow.PerformClick();
}

private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing && !shouldClose)
{
e.Cancel = true;
HideForm();
return;
}

Application.Exit();
}

private void lnkLabel1_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -1282,12 +1281,14 @@ private void lnkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
private void DarkModeCheckBox_CheckedChanged(object sender, EventArgs e)
{
var f = DarkModeChangingForm.Show(this, darkModeCheckBox.Checked);
Opacity = 0;
//Opacity = 0;
Hide();
Enabled = false;
Application.DoEvents();
DarkModeProvider.SetDarkModeEnabled(darkModeCheckBox.Checked);
Enabled = true;
Opacity = 1;
//Opacity = 1;
Show();
f.Close();
}

Expand Down
3 changes: 0 additions & 3 deletions CapsLockIndicatorV3/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@
rEHgAKxB8AOsQQ==
</value>
</data>
<metadata name="hideWindowTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>915, 17</value>
</metadata>
<metadata name="contextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>351, 56</value>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion CapsLockIndicatorV3/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private static void Main(string[] args)
{
MainForm = new MainForm();

Application.Run(MainForm);
Application.Run();
}

// Release the mutex
Expand Down
4 changes: 2 additions & 2 deletions CapsLockIndicatorV3/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("3.13.0.0")]
[assembly: AssemblyFileVersion("3.13.0.0")]
[assembly: AssemblyVersion("3.13.1.0")]
[assembly: AssemblyFileVersion("3.13.1.0")]
[assembly: Guid ("6f54c357-0542-4d7d-9225-338bc3cd7834")]
2 changes: 1 addition & 1 deletion CapsLockIndicatorV3/Resources/defaultSettings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ f:indFont=Segoe UI; 12pt
i:indDisplayTime=500
i:indOpacity=100
i:bdSize=4
s:versionNo=3.13.0.0
s:versionNo=3.13.1.0
s:overlayPosition=BottomRight
s:customMessageCapsOn=
s:customMessageCapsOff=
Expand Down

0 comments on commit f8c760c

Please sign in to comment.