Merge branch 'seerge:main' into asus-mouse-support

This commit is contained in:
IceStormNG
2023-10-05 18:23:47 +02:00
committed by GitHub
4 changed files with 18 additions and 7 deletions

View File

@@ -3,6 +3,8 @@ name: Release
on:
release:
types: [ published ]
workflow_dispatch:
permissions:
contents: write
@@ -20,9 +22,18 @@ jobs:
- name: Publish
run: |
dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained
powershell Compress-Archive app/bin/x64/Release/net7.0-windows/win-x64/publish/* GHelper.zip
powershell Compress-Archive app/bin/x64/Release/net7.0-windows/win-x64/publish/* GHelper-${{ github.sha }}.zip
- name: Upload
if: github.event_name != 'workflow_dispatch'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ github.ref_name }} GHelper.zip
- name: Artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v3
with:
name: GHelper-release-${{ github.sha }}
path: GHelper-*.zip

View File

@@ -213,13 +213,13 @@ namespace GHelper
SetAutoModes(true);
}
public static void SettingsToggle(string action = "", bool checkForFocus = true)
public static void SettingsToggle(string action = "", bool checkForFocus = true, bool trayClick = false)
{
if (settingsForm.Visible)
{
// If helper window is not on top, this just focuses on the app again
// Pressing the ghelper button again will hide the app
if (checkForFocus && !settingsForm.HasAnyFocus())
if (checkForFocus && !settingsForm.HasAnyFocus(trayClick))
{
settingsForm.ShowAll();
}
@@ -275,7 +275,7 @@ namespace GHelper
static void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
SettingsToggle();
SettingsToggle(trayClick: true);
}

View File

@@ -253,7 +253,7 @@
<value>Stan baterii</value>
</data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
<value>Jednorazowo naładuj do 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Aktualizacje BIOS i sterowników</value>

View File

@@ -882,14 +882,14 @@ namespace GHelper
/// Check if any of fans, keyboard, update, or itself has focus
/// </summary>
/// <returns>Focus state</returns>
public bool HasAnyFocus()
public bool HasAnyFocus(bool lostFocusCheck = false)
{
return (fansForm != null && fansForm.ContainsFocus) ||
(extraForm != null && extraForm.ContainsFocus) ||
(updatesForm != null && updatesForm.ContainsFocus) ||
(matrixForm != null && matrixForm.ContainsFocus) ||
this.ContainsFocus ||
Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastLostFocus) < 300;
(lostFocusCheck && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastLostFocus) < 300);
}
private void SettingsForm_FormClosing(object? sender, FormClosingEventArgs e)