mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
UI tweaks
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Data;
|
||||
using System.Diagnostics;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
|
||||
using System.Security.Policy;
|
||||
using HidSharp.Utility;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
@@ -57,7 +58,7 @@ namespace GHelper
|
||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
||||
|
||||
static int[] deviceIds = { 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
||||
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
||||
|
||||
private static int mode = 0;
|
||||
private static int speed = 1;
|
||||
@@ -197,6 +198,7 @@ namespace GHelper
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
||||
}
|
||||
|
||||
|
||||
@@ -223,6 +225,8 @@ namespace GHelper
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
||||
|
||||
if (Program.config.ContainsModel("TUF"))
|
||||
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
|
||||
|
||||
|
||||
@@ -16,7 +16,23 @@
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.48</AssemblyVersion>
|
||||
<AssemblyVersion>0.49</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
2
app/Settings.Designer.cs
generated
2
app/Settings.Designer.cs
generated
@@ -826,7 +826,7 @@ namespace GHelper
|
||||
buttonMiniled.Secondary = false;
|
||||
buttonMiniled.Size = new Size(185, 72);
|
||||
buttonMiniled.TabIndex = 3;
|
||||
buttonMiniled.Text = "Miniled";
|
||||
buttonMiniled.Text = "Multizone";
|
||||
buttonMiniled.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// pictureScreen
|
||||
|
||||
@@ -185,13 +185,13 @@ namespace GHelper
|
||||
|
||||
private static void TrayIcon_MouseMove(object? sender, MouseEventArgs e)
|
||||
{
|
||||
RefreshSensors();
|
||||
Program.settingsForm.RefreshSensors();
|
||||
}
|
||||
|
||||
|
||||
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
||||
{
|
||||
RefreshSensors();
|
||||
Program.settingsForm.RefreshSensors();
|
||||
}
|
||||
|
||||
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
||||
@@ -795,7 +795,7 @@ namespace GHelper
|
||||
}
|
||||
|
||||
|
||||
private static void RefreshSensors(bool force = false)
|
||||
private void RefreshSensors(bool force = false)
|
||||
{
|
||||
|
||||
if (!force && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastRefresh) < 2000) return;
|
||||
@@ -820,18 +820,19 @@ namespace GHelper
|
||||
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
Program.settingsForm.labelCPUFan.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan;
|
||||
Program.settingsForm.labelGPUFan.Text = "GPU" + gpuTemp + HardwareMonitor.gpuFan;
|
||||
labelCPUFan.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan;
|
||||
labelGPUFan.Text = "GPU" + gpuTemp + HardwareMonitor.gpuFan;
|
||||
if (HardwareMonitor.midFan is not null)
|
||||
Program.settingsForm.labelMidFan.Text = "Mid" + HardwareMonitor.midFan;
|
||||
|
||||
Program.settingsForm.labelBattery.Text = battery;
|
||||
|
||||
Program.trayIcon.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan + "\n"
|
||||
+ "GPU" + gpuTemp + HardwareMonitor.gpuFan +
|
||||
((battery.Length > 0) ? ("\n" + battery) : "");
|
||||
labelMidFan.Text = "Mid" + HardwareMonitor.midFan;
|
||||
|
||||
labelBattery.Text = battery;
|
||||
});
|
||||
|
||||
|
||||
Program.trayIcon.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan + "\n"
|
||||
+ "GPU" + gpuTemp + HardwareMonitor.gpuFan +
|
||||
((battery.Length > 0) ? ("\n" + battery) : "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -858,6 +859,8 @@ namespace GHelper
|
||||
int limit_total = Program.config.getConfigPerf("limit_total");
|
||||
int limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
||||
|
||||
string limitLabel = null;
|
||||
|
||||
if (limit_total > ASUSWmi.MaxTotal) return;
|
||||
if (limit_total < ASUSWmi.MinTotal) return;
|
||||
|
||||
@@ -865,10 +868,21 @@ namespace GHelper
|
||||
if (limit_cpu < ASUSWmi.MinCPU) return;
|
||||
|
||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0)
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total, "PowerLimit A");
|
||||
limitLabel = limit_total + "W";
|
||||
}
|
||||
|
||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0)
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu, "PowerLimit B");
|
||||
limitLabel = limit_cpu + "W";
|
||||
}
|
||||
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
labelPerf.Text = "Performance Mode+ " + limitLabel;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -1007,10 +1021,10 @@ namespace GHelper
|
||||
|
||||
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||
Aura.ApplyBrightness(3);
|
||||
//Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Up);
|
||||
//Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Up);
|
||||
else
|
||||
Aura.ApplyBrightness(0);
|
||||
//Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Down);
|
||||
//Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Down);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user