mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9053764930 | ||
|
|
64871e5554 | ||
|
|
b1c778b30d | ||
|
|
6932bb1889 | ||
|
|
c90a342ce8 | ||
|
|
f223ca4a33 | ||
|
|
023607da4b | ||
|
|
264631ab77 | ||
|
|
1bd5d79983 | ||
|
|
83b184a061 | ||
|
|
9ff572b8f6 | ||
|
|
cdb633be04 | ||
|
|
7cb9b1f64f | ||
|
|
06be8c726e | ||
|
|
265c6ce417 | ||
|
|
add852ce5d | ||
|
|
d4a5164b16 | ||
|
|
14618ee19e | ||
|
|
0b3a75e373 | ||
|
|
64e390a61f | ||
|
|
1cd808de07 | ||
|
|
d82f1c8d70 | ||
|
|
9189cf0a46 | ||
|
|
3a7c4278a0 | ||
|
|
7065ba8661 | ||
|
|
1bce4a4b51 | ||
|
|
468f9c4034 | ||
|
|
4d347df45c | ||
|
|
d7f1d1d5fd | ||
|
|
6800ae38dd | ||
|
|
9b2b96fbf0 | ||
|
|
04b3a15d8f | ||
|
|
aae0570340 | ||
|
|
b142d566da | ||
|
|
a9115d0dff | ||
|
|
e3a3e81245 |
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -25,14 +25,7 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
|
|
||||||
**Desktop (please complete the following information):**
|
**Desktop (please complete the following information):**
|
||||||
- OS: [e.g. iOS]
|
- OS: [e.g. iOS]
|
||||||
- Browser [e.g. chrome, safari]
|
- Laptop model
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class ASUSWmi
|
|||||||
|
|
||||||
public const uint CPU_Fan = 0x00110013;
|
public const uint CPU_Fan = 0x00110013;
|
||||||
public const uint GPU_Fan = 0x00110014;
|
public const uint GPU_Fan = 0x00110014;
|
||||||
|
public const uint Mid_Fan = 0x00110031;
|
||||||
|
|
||||||
public const uint PerformanceMode = 0x00120075; // Thermal Control
|
public const uint PerformanceMode = 0x00120075; // Thermal Control
|
||||||
|
|
||||||
@@ -20,9 +21,11 @@ public class ASUSWmi
|
|||||||
|
|
||||||
public const uint BatteryLimit = 0x00120057;
|
public const uint BatteryLimit = 0x00120057;
|
||||||
public const uint ScreenOverdrive = 0x00050019;
|
public const uint ScreenOverdrive = 0x00050019;
|
||||||
|
public const uint ScreenMiniled = 0x0005001E;
|
||||||
|
|
||||||
public const uint DevsCPUFanCurve = 0x00110024;
|
public const uint DevsCPUFanCurve = 0x00110024;
|
||||||
public const uint DevsGPUFanCurve = 0x00110025;
|
public const uint DevsGPUFanCurve = 0x00110025;
|
||||||
|
public const uint DevsMidFanCurve = 0x00110032;
|
||||||
|
|
||||||
public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 and CPU PPT on 2021
|
public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 and CPU PPT on 2021
|
||||||
public const int PPT_EDCA1 = 0x001200A1; // CPU EDC
|
public const int PPT_EDCA1 = 0x001200A1; // CPU EDC
|
||||||
@@ -184,12 +187,25 @@ public class ASUSWmi
|
|||||||
if (curve.Length != 16) return;
|
if (curve.Length != 16) return;
|
||||||
if (curve.All(singleByte => singleByte == 0)) return;
|
if (curve.All(singleByte => singleByte == 0)) return;
|
||||||
|
|
||||||
Logger.WriteLine("Fans" + ((device == 1) ? "GPU" : "CPU") + " " + BitConverter.ToString(curve));
|
string name;
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
DeviceSet(DevsGPUFanCurve, curve);
|
{
|
||||||
else
|
case 1:
|
||||||
DeviceSet(DevsCPUFanCurve, curve);
|
DeviceSet(DevsGPUFanCurve, curve);
|
||||||
|
name = "GPU";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
DeviceSet(DevsMidFanCurve, curve);
|
||||||
|
name = "Mid";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
DeviceSet(DevsCPUFanCurve, curve);
|
||||||
|
name = "CPU";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.WriteLine("Fans" + name + " " + BitConverter.ToString(curve));
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetFanCurve(int device, int mode = 0)
|
public byte[] GetFanCurve(int device, int mode = 0)
|
||||||
@@ -204,10 +220,15 @@ public class ASUSWmi
|
|||||||
default: fan_mode = 0; break;
|
default: fan_mode = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
{
|
||||||
else
|
case 1:
|
||||||
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
||||||
|
case 2:
|
||||||
|
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
||||||
|
default:
|
||||||
|
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
// Source thanks to https://github.com/vddCore/Starlight with some adjustments from me
|
// Source thanks to https://github.com/vddCore/Starlight with some adjustments from me
|
||||||
|
|
||||||
using Starlight.Communication;
|
using Starlight.Communication;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Text;
|
|
||||||
using System.Management;
|
using System.Management;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace Starlight.AnimeMatrix
|
namespace Starlight.AnimeMatrix
|
||||||
{
|
{
|
||||||
@@ -68,19 +67,17 @@ namespace Starlight.AnimeMatrix
|
|||||||
|
|
||||||
public class AnimeMatrixDevice : Device
|
public class AnimeMatrixDevice : Device
|
||||||
{
|
{
|
||||||
private const int UpdatePageLength = 0x0278;
|
int UpdatePageLength = 490;
|
||||||
|
int LedCount = 1450;
|
||||||
|
|
||||||
public int LedCount => 1450;
|
byte[] _displayBuffer;
|
||||||
|
List<byte[]> frames = new List<byte[]>();
|
||||||
|
|
||||||
private byte[] _displayBuffer = new byte[UpdatePageLength * 3];
|
public int MaxRows = 61;
|
||||||
private List<byte[]> frames = new List<byte[]>();
|
public int FullRows = 11;
|
||||||
|
public int FullEvenRows = -1;
|
||||||
private int pages = 3;
|
|
||||||
|
|
||||||
public int MaxColumns = 34;
|
public int MaxColumns = 34;
|
||||||
public int MaxRows = 61;
|
|
||||||
|
|
||||||
public int FullRows = 11;
|
|
||||||
|
|
||||||
private int frameIndex = 0;
|
private int frameIndex = 0;
|
||||||
|
|
||||||
@@ -88,15 +85,20 @@ namespace Starlight.AnimeMatrix
|
|||||||
: base(0x0B05, 0x193B, 640)
|
: base(0x0B05, 0x193B, 640)
|
||||||
{
|
{
|
||||||
string model = GetModel();
|
string model = GetModel();
|
||||||
Debug.WriteLine(model);
|
if (model.Contains("401"))
|
||||||
if (model is not null && model.Contains("401"))
|
|
||||||
{
|
{
|
||||||
pages = 2;
|
|
||||||
|
|
||||||
FullRows = 6;
|
|
||||||
MaxColumns = 33;
|
MaxColumns = 33;
|
||||||
|
|
||||||
|
FullRows = 7;
|
||||||
|
FullEvenRows = 1;
|
||||||
|
|
||||||
MaxRows = 55;
|
MaxRows = 55;
|
||||||
|
LedCount = 1214;
|
||||||
|
UpdatePageLength = 410;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_displayBuffer = new byte[LedCount];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -119,7 +121,6 @@ namespace Starlight.AnimeMatrix
|
|||||||
|
|
||||||
public void PresentNextFrame()
|
public void PresentNextFrame()
|
||||||
{
|
{
|
||||||
//Debug.WriteLine(frameIndex);
|
|
||||||
if (frameIndex >= frames.Count) frameIndex = 0;
|
if (frameIndex >= frames.Count) frameIndex = 0;
|
||||||
_displayBuffer = frames[frameIndex];
|
_displayBuffer = frames[frameIndex];
|
||||||
Present();
|
Present();
|
||||||
@@ -143,27 +144,25 @@ namespace Starlight.AnimeMatrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int EmptyColumns(int row)
|
public int XStart(int row)
|
||||||
{
|
{
|
||||||
return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0);
|
return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0);
|
||||||
}
|
}
|
||||||
public int Columns(int row)
|
|
||||||
|
public int XEnd(int row)
|
||||||
{
|
{
|
||||||
EnsureRowInRange(row);
|
if (row <= FullEvenRows && row % 2 == 0) return MaxColumns - 1;
|
||||||
return MaxColumns - EmptyColumns(row);
|
return MaxColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int RowToLinearAddress(int row)
|
public int RowToLinearAddress(int row)
|
||||||
{
|
{
|
||||||
EnsureRowInRange(row);
|
EnsureRowInRange(row);
|
||||||
|
|
||||||
var ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (row > 0)
|
for (var i = 0; i < row; i++)
|
||||||
{
|
ret += XEnd(i) - XStart(i);
|
||||||
for (var i = 0; i < row; i++)
|
|
||||||
ret += Columns(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -175,13 +174,13 @@ namespace Starlight.AnimeMatrix
|
|||||||
|
|
||||||
public void SetLedLinear(int address, byte value)
|
public void SetLedLinear(int address, byte value)
|
||||||
{
|
{
|
||||||
EnsureAddressableLed(address);
|
if (!IsAddressableLed(address)) return;
|
||||||
_displayBuffer[address] = value;
|
_displayBuffer[address] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetLedLinearImmediate(int address, byte value)
|
public void SetLedLinearImmediate(int address, byte value)
|
||||||
{
|
{
|
||||||
EnsureAddressableLed(address);
|
if (!IsAddressableLed(address)) return;
|
||||||
_displayBuffer[address] = value;
|
_displayBuffer[address] = value;
|
||||||
|
|
||||||
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
|
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
|
||||||
@@ -196,10 +195,11 @@ namespace Starlight.AnimeMatrix
|
|||||||
public void SetLedPlanar(int x, int y, byte value)
|
public void SetLedPlanar(int x, int y, byte value)
|
||||||
{
|
{
|
||||||
EnsureRowInRange(y);
|
EnsureRowInRange(y);
|
||||||
var start = RowToLinearAddress(y) - EmptyColumns(y);
|
var start = RowToLinearAddress(y) - XStart(y);
|
||||||
|
if (x >= XStart(y) && x < XEnd(y))
|
||||||
if (x > EmptyColumns(y))
|
{
|
||||||
SetLedLinear(start + x, value);
|
SetLedLinear(start + x, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear(bool present = false)
|
public void Clear(bool present = false)
|
||||||
@@ -214,26 +214,23 @@ namespace Starlight.AnimeMatrix
|
|||||||
public void Present()
|
public void Present()
|
||||||
{
|
{
|
||||||
|
|
||||||
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
|
int page = 0;
|
||||||
.AppendData(BitConverter.GetBytes((ushort)(UpdatePageLength * 0 + 1)))
|
int start, end;
|
||||||
.AppendData(BitConverter.GetBytes((ushort)UpdatePageLength))
|
|
||||||
.AppendData(_displayBuffer[(UpdatePageLength * 0)..(UpdatePageLength * 1)])
|
|
||||||
);
|
|
||||||
|
|
||||||
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
|
while (page * UpdatePageLength < LedCount)
|
||||||
.AppendData(BitConverter.GetBytes((ushort)(UpdatePageLength * 1 + 1)))
|
{
|
||||||
.AppendData(BitConverter.GetBytes((ushort)UpdatePageLength))
|
start = page * UpdatePageLength;
|
||||||
.AppendData(_displayBuffer[(UpdatePageLength * 1)..(UpdatePageLength * 2)])
|
end = Math.Min(LedCount, (page + 1) * UpdatePageLength);
|
||||||
);
|
|
||||||
|
|
||||||
if (pages > 2)
|
|
||||||
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
|
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
|
||||||
.AppendData(BitConverter.GetBytes((ushort)(UpdatePageLength * 2 + 1)))
|
.AppendData(BitConverter.GetBytes((ushort)(start + 1)))
|
||||||
.AppendData(BitConverter.GetBytes((ushort)(LedCount - UpdatePageLength * 2)))
|
.AppendData(BitConverter.GetBytes((ushort)(end - start)))
|
||||||
.AppendData(
|
.AppendData(_displayBuffer[start..end])
|
||||||
_displayBuffer[(UpdatePageLength * 2)..(UpdatePageLength * 2 + (LedCount - UpdatePageLength * 2))])
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
page++;
|
||||||
|
}
|
||||||
|
|
||||||
Set(Packet<AnimeMatrixPacket>(0xC0, 0x03));
|
Set(Packet<AnimeMatrixPacket>(0xC0, 0x03));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,6 +267,37 @@ namespace Starlight.AnimeMatrix
|
|||||||
Set(Packet<AnimeMatrixPacket>(0xC5, animation.AsByte));
|
Set(Packet<AnimeMatrixPacket>(0xC5, animation.AsByte));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void PresentText(string text, float fontSize = 8F)
|
||||||
|
{
|
||||||
|
using (Bitmap bmp = new Bitmap(MaxColumns * 3, MaxRows))
|
||||||
|
{
|
||||||
|
using (Graphics g = Graphics.FromImage(bmp))
|
||||||
|
{
|
||||||
|
using (Font font = new Font("Arial", fontSize))
|
||||||
|
{
|
||||||
|
|
||||||
|
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
|
||||||
|
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
|
/*
|
||||||
|
SizeF textSize = g.MeasureString(text, font);
|
||||||
|
g.TranslateTransform(bmp.Width / 2, bmp.Height / 2);
|
||||||
|
g.RotateTransform(33);
|
||||||
|
g.DrawString(text, font, Brushes.White, -textSize.Width/2, -textSize.Height / 2);
|
||||||
|
*/
|
||||||
|
|
||||||
|
g.DrawString(text, font, Brushes.White, 12, -2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GenerateFrame(bmp);
|
||||||
|
Present();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void GenerateFrame(Image image)
|
public void GenerateFrame(Image image)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -277,32 +305,36 @@ namespace Starlight.AnimeMatrix
|
|||||||
int height = MaxRows;
|
int height = MaxRows;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
Bitmap canvas = new Bitmap(width, height);
|
using (Bitmap canvas = new Bitmap(width, height))
|
||||||
|
|
||||||
scale = Math.Min((float)width / (float)image.Width, (float)height / (float)image.Height);
|
|
||||||
|
|
||||||
var graph = Graphics.FromImage(canvas);
|
|
||||||
var scaleWidth = (int)(image.Width * scale);
|
|
||||||
var scaleHeight = (int)(image.Height * scale);
|
|
||||||
|
|
||||||
graph.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
|
|
||||||
graph.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
|
|
||||||
graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
|
||||||
|
|
||||||
graph.DrawImage(image, ((int)width - scaleWidth), ((int)height - scaleHeight) / 2, scaleWidth, scaleHeight);
|
|
||||||
|
|
||||||
Bitmap bmp = new Bitmap(canvas, MaxColumns, MaxRows);
|
|
||||||
|
|
||||||
for (int y = 0; y < bmp.Height; y++)
|
|
||||||
{
|
{
|
||||||
for (int x = 0; x < bmp.Width; x++)
|
scale = Math.Min((float)width / (float)image.Width, (float)height / (float)image.Height);
|
||||||
|
|
||||||
|
using (var graph = Graphics.FromImage(canvas))
|
||||||
{
|
{
|
||||||
var pixel = bmp.GetPixel(x, y);
|
var scaleWidth = (int)(image.Width * scale);
|
||||||
byte color = (byte)(Math.Max((pixel.R + pixel.G + pixel.B) / 3 - 10, 0));
|
var scaleHeight = (int)(image.Height * scale);
|
||||||
SetLedPlanar(x, y, color);
|
|
||||||
|
graph.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
|
||||||
|
graph.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
|
||||||
|
graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
|
graph.DrawImage(image, ((int)width - scaleWidth), 0, scaleWidth, scaleHeight);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Bitmap bmp = new Bitmap(canvas, MaxColumns * 2, MaxRows))
|
||||||
|
{
|
||||||
|
for (int y = 0; y < bmp.Height; y++)
|
||||||
|
for (int x = 0; x < bmp.Width; x++)
|
||||||
|
if (x % 2 == y % 2)
|
||||||
|
{
|
||||||
|
var pixel = bmp.GetPixel(x, y);
|
||||||
|
SetLedPlanar(x / 2, y, (byte)((pixel.R + pixel.G + pixel.B)/3));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnsureRowInRange(int row)
|
private void EnsureRowInRange(int row)
|
||||||
@@ -313,12 +345,9 @@ namespace Starlight.AnimeMatrix
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnsureAddressableLed(int address)
|
private bool IsAddressableLed(int address)
|
||||||
{
|
{
|
||||||
if (address < 0 || address >= LedCount)
|
return (address >= 0 && address < LedCount);
|
||||||
{
|
|
||||||
throw new IndexOutOfRangeException($"Linear LED address must be in range of [0, {LedCount - 1}].");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Text.Json;
|
using System.Management;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
public class AppConfig
|
public class AppConfig
|
||||||
{
|
{
|
||||||
@@ -6,6 +7,8 @@ public class AppConfig
|
|||||||
public string appPath;
|
public string appPath;
|
||||||
string configFile;
|
string configFile;
|
||||||
|
|
||||||
|
string _model;
|
||||||
|
|
||||||
public Dictionary<string, object> config = new Dictionary<string, object>();
|
public Dictionary<string, object> config = new Dictionary<string, object>();
|
||||||
|
|
||||||
public AppConfig()
|
public AppConfig()
|
||||||
@@ -36,6 +39,26 @@ public class AppConfig
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool ContainsModel(string contains)
|
||||||
|
{
|
||||||
|
if (_model is null)
|
||||||
|
{
|
||||||
|
_model = "";
|
||||||
|
using (var searcher = new ManagementObjectSearcher(@"Select * from Win32_ComputerSystem"))
|
||||||
|
{
|
||||||
|
foreach (var process in searcher.Get())
|
||||||
|
{
|
||||||
|
_model = process["Model"].ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (_model is not null && _model.Contains(contains));
|
||||||
|
|
||||||
|
}
|
||||||
private void initConfig()
|
private void initConfig()
|
||||||
{
|
{
|
||||||
config = new Dictionary<string, object>();
|
config = new Dictionary<string, object>();
|
||||||
|
|||||||
183
app/ControlHelper.cs
Normal file
183
app/ControlHelper.cs
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
using CustomControls;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
|
||||||
|
public static class ControlHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
static bool _invert = false;
|
||||||
|
static bool _resize = false;
|
||||||
|
|
||||||
|
static float _scale = 1;
|
||||||
|
|
||||||
|
static Color formBack;
|
||||||
|
static Color backMain;
|
||||||
|
static Color foreMain;
|
||||||
|
static Color foreAccent;
|
||||||
|
static Color borderMain;
|
||||||
|
static Color buttonMain;
|
||||||
|
|
||||||
|
public static void Adjust(RForm container, bool darkTheme = false, bool invert = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (darkTheme)
|
||||||
|
{
|
||||||
|
formBack = Color.FromArgb(255, 35, 35, 35);
|
||||||
|
backMain = Color.FromArgb(255, 50, 50, 50);
|
||||||
|
foreMain = Color.White;
|
||||||
|
foreAccent = Color.FromArgb(255, 100, 100, 100);
|
||||||
|
borderMain = Color.FromArgb(255, 50, 50, 50);
|
||||||
|
buttonMain = Color.FromArgb(255, 80, 80, 80);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
formBack = SystemColors.Control;
|
||||||
|
backMain = SystemColors.ControlLightLight;
|
||||||
|
foreMain = SystemColors.ControlText;
|
||||||
|
foreAccent = Color.LightGray;
|
||||||
|
borderMain = Color.LightGray;
|
||||||
|
buttonMain = Color.FromArgb(255, 230, 230, 230);
|
||||||
|
}
|
||||||
|
|
||||||
|
container.BackColor = formBack;
|
||||||
|
container.ForeColor = foreMain;
|
||||||
|
|
||||||
|
_invert = invert;
|
||||||
|
AdjustControls(container.Controls);
|
||||||
|
_invert = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Resize(RForm container, float baseScale = 2)
|
||||||
|
{
|
||||||
|
_scale = GetDpiScale(container).Value / baseScale;
|
||||||
|
ResizeControls(container.Controls);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ResizeControls(Control.ControlCollection controls)
|
||||||
|
{
|
||||||
|
foreach (Control control in controls)
|
||||||
|
{
|
||||||
|
var button = control as RButton;
|
||||||
|
if (button != null && button.Image is not null)
|
||||||
|
button.Image = ResizeImage(button.Image);
|
||||||
|
|
||||||
|
var pictureBox = control as PictureBox;
|
||||||
|
if (pictureBox != null && pictureBox.BackgroundImage is not null)
|
||||||
|
pictureBox.BackgroundImage = ResizeImage(pictureBox.BackgroundImage);
|
||||||
|
|
||||||
|
ResizeControls(control.Controls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void AdjustControls(Control.ControlCollection controls)
|
||||||
|
{
|
||||||
|
foreach (Control control in controls)
|
||||||
|
{
|
||||||
|
var button = control as RButton;
|
||||||
|
if (button != null)
|
||||||
|
{
|
||||||
|
button.BackColor = button.Secondary ? buttonMain : backMain;
|
||||||
|
button.ForeColor = foreMain;
|
||||||
|
|
||||||
|
button.FlatStyle = FlatStyle.Flat;
|
||||||
|
button.FlatAppearance.BorderColor = borderMain;
|
||||||
|
|
||||||
|
if (button.Image is not null)
|
||||||
|
button.Image = AdjustImage(button.Image);
|
||||||
|
}
|
||||||
|
|
||||||
|
var pictureBox = control as PictureBox;
|
||||||
|
if (pictureBox != null && pictureBox.BackgroundImage is not null)
|
||||||
|
pictureBox.BackgroundImage = AdjustImage(pictureBox.BackgroundImage);
|
||||||
|
|
||||||
|
|
||||||
|
var combo = control as RComboBox;
|
||||||
|
if (combo != null)
|
||||||
|
{
|
||||||
|
combo.BackColor = backMain;
|
||||||
|
combo.ForeColor = foreMain;
|
||||||
|
combo.BorderColor = backMain;
|
||||||
|
combo.ButtonColor = buttonMain;
|
||||||
|
}
|
||||||
|
|
||||||
|
var gb = control as GroupBox;
|
||||||
|
if (gb != null)
|
||||||
|
{
|
||||||
|
gb.ForeColor = foreMain;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var chart = control as Chart;
|
||||||
|
if (chart != null)
|
||||||
|
{
|
||||||
|
chart.BackColor = backMain;
|
||||||
|
chart.ChartAreas[0].BackColor = backMain;
|
||||||
|
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreAccent;
|
||||||
|
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreAccent;
|
||||||
|
|
||||||
|
chart.ChartAreas[0].AxisX.TitleForeColor = foreMain;
|
||||||
|
chart.ChartAreas[0].AxisY.TitleForeColor = foreMain;
|
||||||
|
|
||||||
|
chart.ChartAreas[0].AxisX.LabelStyle.ForeColor = foreMain;
|
||||||
|
chart.ChartAreas[0].AxisY.LabelStyle.ForeColor = foreMain;
|
||||||
|
|
||||||
|
chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = foreMain;
|
||||||
|
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = foreMain;
|
||||||
|
|
||||||
|
chart.ChartAreas[0].AxisX.LineColor = foreAccent;
|
||||||
|
chart.ChartAreas[0].AxisY.LineColor = foreAccent;
|
||||||
|
|
||||||
|
chart.Titles[0].ForeColor = foreMain;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
AdjustControls(control.Controls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Lazy<float> GetDpiScale(Control control)
|
||||||
|
{
|
||||||
|
return new Lazy<float>(() =>
|
||||||
|
{
|
||||||
|
using (var graphics = control.CreateGraphics())
|
||||||
|
return graphics.DpiX / 96.0f;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Image ResizeImage(Image image)
|
||||||
|
{
|
||||||
|
var newSize = new Size((int)(image.Width * _scale), (int)(image.Height * _scale));
|
||||||
|
var pic = new Bitmap(newSize.Width, newSize.Height);
|
||||||
|
|
||||||
|
using (var g = Graphics.FromImage(pic))
|
||||||
|
{
|
||||||
|
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||||
|
g.DrawImage(image, new Rectangle(new Point(), newSize));
|
||||||
|
}
|
||||||
|
return pic;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Image AdjustImage(Image image)
|
||||||
|
{
|
||||||
|
var pic = new Bitmap(image);
|
||||||
|
|
||||||
|
if (_invert)
|
||||||
|
{
|
||||||
|
for (int y = 0; (y <= (pic.Height - 1)); y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; (x <= (pic.Width - 1)); x++)
|
||||||
|
{
|
||||||
|
Color col = pic.GetPixel(x, y);
|
||||||
|
pic.SetPixel(x, y, Color.FromArgb(col.A, (255 - col.R), (255 - col.G), (255 - col.B)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pic;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
349
app/CustomControls.cs
Normal file
349
app/CustomControls.cs
Normal file
@@ -0,0 +1,349 @@
|
|||||||
|
using Microsoft.Win32;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace CustomControls
|
||||||
|
{
|
||||||
|
|
||||||
|
public class RForm : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
protected static Color colorEco = Color.FromArgb(255, 6, 180, 138);
|
||||||
|
protected static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
|
||||||
|
protected static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
|
||||||
|
|
||||||
|
[DllImport("UXTheme.dll", SetLastError = true, EntryPoint = "#138")]
|
||||||
|
public static extern bool CheckSystemDarkModeStatus();
|
||||||
|
|
||||||
|
[DllImport("DwmApi")] //System.Runtime.InteropServices
|
||||||
|
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);
|
||||||
|
|
||||||
|
public bool darkTheme;
|
||||||
|
|
||||||
|
private static bool IsDarkTheme()
|
||||||
|
{
|
||||||
|
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
|
||||||
|
var registryValueObject = key?.GetValue("AppsUseLightTheme");
|
||||||
|
|
||||||
|
if (registryValueObject == null) return false;
|
||||||
|
return (int)registryValueObject <= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitTheme(bool setDPI = true)
|
||||||
|
{
|
||||||
|
bool newDarkTheme = IsDarkTheme();
|
||||||
|
bool changed = (darkTheme != newDarkTheme);
|
||||||
|
darkTheme = newDarkTheme;
|
||||||
|
|
||||||
|
if (setDPI)
|
||||||
|
ControlHelper.Resize(this);
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
|
||||||
|
ControlHelper.Adjust(this, darkTheme, changed);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class RTrackBar : TrackBar
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RComboBox : ComboBox
|
||||||
|
{
|
||||||
|
private Color borderColor = Color.Gray;
|
||||||
|
[DefaultValue(typeof(Color), "Gray")]
|
||||||
|
public Color BorderColor
|
||||||
|
{
|
||||||
|
get { return borderColor; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (borderColor != value)
|
||||||
|
{
|
||||||
|
borderColor = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private Color buttonColor = Color.FromArgb(255,230, 230, 230);
|
||||||
|
[DefaultValue(typeof(Color), "230, 230, 230")]
|
||||||
|
public Color ButtonColor
|
||||||
|
{
|
||||||
|
get { return buttonColor; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (buttonColor != value)
|
||||||
|
{
|
||||||
|
buttonColor = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color arrowColor = Color.Black;
|
||||||
|
[DefaultValue(typeof(Color), "Black")]
|
||||||
|
public Color ArrowColor
|
||||||
|
{
|
||||||
|
get { return arrowColor; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (arrowColor != value)
|
||||||
|
{
|
||||||
|
arrowColor = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void WndProc(ref Message m)
|
||||||
|
{
|
||||||
|
if (m.Msg == WM_PAINT && DropDownStyle != ComboBoxStyle.Simple)
|
||||||
|
{
|
||||||
|
var clientRect = ClientRectangle;
|
||||||
|
var dropDownButtonWidth = SystemInformation.HorizontalScrollBarArrowWidth;
|
||||||
|
var outerBorder = new Rectangle(clientRect.Location,
|
||||||
|
new Size(clientRect.Width - 1, clientRect.Height - 1));
|
||||||
|
var innerBorder = new Rectangle(outerBorder.X + 1, outerBorder.Y + 1,
|
||||||
|
outerBorder.Width - dropDownButtonWidth - 2, outerBorder.Height - 2);
|
||||||
|
var innerInnerBorder = new Rectangle(innerBorder.X + 1, innerBorder.Y + 1,
|
||||||
|
innerBorder.Width - 2, innerBorder.Height - 2);
|
||||||
|
var dropDownRect = new Rectangle(innerBorder.Right + 1, innerBorder.Y,
|
||||||
|
dropDownButtonWidth, innerBorder.Height + 1);
|
||||||
|
if (RightToLeft == RightToLeft.Yes)
|
||||||
|
{
|
||||||
|
innerBorder.X = clientRect.Width - innerBorder.Right;
|
||||||
|
innerInnerBorder.X = clientRect.Width - innerInnerBorder.Right;
|
||||||
|
dropDownRect.X = clientRect.Width - dropDownRect.Right;
|
||||||
|
dropDownRect.Width += 1;
|
||||||
|
}
|
||||||
|
var innerBorderColor = Enabled ? BackColor : SystemColors.Control;
|
||||||
|
var outerBorderColor = Enabled ? BorderColor : SystemColors.ControlDark;
|
||||||
|
var buttonColor = Enabled ? ButtonColor : SystemColors.Control;
|
||||||
|
var middle = new Point(dropDownRect.Left + dropDownRect.Width / 2,
|
||||||
|
dropDownRect.Top + dropDownRect.Height / 2);
|
||||||
|
var arrow = new Point[]
|
||||||
|
{
|
||||||
|
new Point(middle.X - 3, middle.Y - 2),
|
||||||
|
new Point(middle.X + 4, middle.Y - 2),
|
||||||
|
new Point(middle.X, middle.Y + 2)
|
||||||
|
};
|
||||||
|
var ps = new PAINTSTRUCT();
|
||||||
|
bool shoulEndPaint = false;
|
||||||
|
IntPtr dc;
|
||||||
|
if (m.WParam == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
dc = BeginPaint(Handle, ref ps);
|
||||||
|
m.WParam = dc;
|
||||||
|
shoulEndPaint = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dc = m.WParam;
|
||||||
|
}
|
||||||
|
var rgn = CreateRectRgn(innerInnerBorder.Left, innerInnerBorder.Top,
|
||||||
|
innerInnerBorder.Right, innerInnerBorder.Bottom);
|
||||||
|
SelectClipRgn(dc, rgn);
|
||||||
|
DefWndProc(ref m);
|
||||||
|
DeleteObject(rgn);
|
||||||
|
rgn = CreateRectRgn(clientRect.Left, clientRect.Top,
|
||||||
|
clientRect.Right, clientRect.Bottom);
|
||||||
|
SelectClipRgn(dc, rgn);
|
||||||
|
using (var g = Graphics.FromHdc(dc))
|
||||||
|
{
|
||||||
|
using (var b = new SolidBrush(buttonColor))
|
||||||
|
{
|
||||||
|
g.FillRectangle(b, dropDownRect);
|
||||||
|
}
|
||||||
|
using (var b = new SolidBrush(arrowColor))
|
||||||
|
{
|
||||||
|
g.FillPolygon(b, arrow);
|
||||||
|
}
|
||||||
|
using (var p = new Pen(innerBorderColor))
|
||||||
|
{
|
||||||
|
g.DrawRectangle(p, innerBorder);
|
||||||
|
g.DrawRectangle(p, innerInnerBorder);
|
||||||
|
}
|
||||||
|
using (var p = new Pen(outerBorderColor))
|
||||||
|
{
|
||||||
|
g.DrawRectangle(p, outerBorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (shoulEndPaint)
|
||||||
|
EndPaint(Handle, ref ps);
|
||||||
|
DeleteObject(rgn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
base.WndProc(ref m);
|
||||||
|
}
|
||||||
|
|
||||||
|
private const int WM_PAINT = 0xF;
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct RECT
|
||||||
|
{
|
||||||
|
public int L, T, R, B;
|
||||||
|
}
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct PAINTSTRUCT
|
||||||
|
{
|
||||||
|
public IntPtr hdc;
|
||||||
|
public bool fErase;
|
||||||
|
public int rcPaint_left;
|
||||||
|
public int rcPaint_top;
|
||||||
|
public int rcPaint_right;
|
||||||
|
public int rcPaint_bottom;
|
||||||
|
public bool fRestore;
|
||||||
|
public bool fIncUpdate;
|
||||||
|
public int reserved1;
|
||||||
|
public int reserved2;
|
||||||
|
public int reserved3;
|
||||||
|
public int reserved4;
|
||||||
|
public int reserved5;
|
||||||
|
public int reserved6;
|
||||||
|
public int reserved7;
|
||||||
|
public int reserved8;
|
||||||
|
}
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern IntPtr BeginPaint(IntPtr hWnd,
|
||||||
|
[In, Out] ref PAINTSTRUCT lpPaint);
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT lpPaint);
|
||||||
|
|
||||||
|
[DllImport("gdi32.dll")]
|
||||||
|
public static extern int SelectClipRgn(IntPtr hDC, IntPtr hRgn);
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
public static extern int GetUpdateRgn(IntPtr hwnd, IntPtr hrgn, bool fErase);
|
||||||
|
public enum RegionFlags
|
||||||
|
{
|
||||||
|
ERROR = 0,
|
||||||
|
NULLREGION = 1,
|
||||||
|
SIMPLEREGION = 2,
|
||||||
|
COMPLEXREGION = 3,
|
||||||
|
}
|
||||||
|
[DllImport("gdi32.dll")]
|
||||||
|
internal static extern bool DeleteObject(IntPtr hObject);
|
||||||
|
|
||||||
|
[DllImport("gdi32.dll")]
|
||||||
|
private static extern IntPtr CreateRectRgn(int x1, int y1, int x2, int y2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RButton : Button
|
||||||
|
{
|
||||||
|
//Fields
|
||||||
|
private int borderSize = 5;
|
||||||
|
|
||||||
|
private int borderRadius = 5;
|
||||||
|
public int BorderRadius
|
||||||
|
{
|
||||||
|
get { return borderRadius; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
borderRadius = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color borderColor = Color.Transparent;
|
||||||
|
public Color BorderColor
|
||||||
|
{
|
||||||
|
get { return borderColor; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
borderColor = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private bool activated = false;
|
||||||
|
public bool Activated
|
||||||
|
{
|
||||||
|
get { return activated; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (activated != value)
|
||||||
|
this.Invalidate();
|
||||||
|
activated = value;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool secondary = false;
|
||||||
|
public bool Secondary
|
||||||
|
{
|
||||||
|
get { return secondary; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
secondary = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public RButton()
|
||||||
|
{
|
||||||
|
this.FlatStyle = FlatStyle.Flat;
|
||||||
|
this.FlatAppearance.BorderSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private GraphicsPath GetFigurePath(Rectangle rect, int radius)
|
||||||
|
{
|
||||||
|
GraphicsPath path = new GraphicsPath();
|
||||||
|
float curveSize = radius * 2F;
|
||||||
|
|
||||||
|
path.StartFigure();
|
||||||
|
path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
|
||||||
|
path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
|
||||||
|
path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
|
||||||
|
path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
|
||||||
|
path.CloseFigure();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs pevent)
|
||||||
|
{
|
||||||
|
|
||||||
|
base.OnPaint(pevent);
|
||||||
|
|
||||||
|
float ratio = pevent.Graphics.DpiX / 192.0f;
|
||||||
|
int border = (int)(ratio * borderSize);
|
||||||
|
|
||||||
|
Rectangle rectSurface = this.ClientRectangle;
|
||||||
|
Rectangle rectBorder = Rectangle.Inflate(rectSurface, -border, -border);
|
||||||
|
|
||||||
|
Color borderDrawColor = activated ? borderColor : Color.Transparent;
|
||||||
|
|
||||||
|
using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius + border))
|
||||||
|
using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius))
|
||||||
|
using (Pen penSurface = new Pen(this.Parent.BackColor, border))
|
||||||
|
using (Pen penBorder = new Pen(borderDrawColor, border))
|
||||||
|
{
|
||||||
|
penBorder.Alignment = PenAlignment.Outset;
|
||||||
|
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
this.Region = new Region(pathSurface);
|
||||||
|
pevent.Graphics.DrawPath(penSurface, pathSurface);
|
||||||
|
pevent.Graphics.DrawPath(penBorder, pathBorder);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Enabled && ForeColor != SystemColors.ControlText)
|
||||||
|
{
|
||||||
|
var rect = pevent.ClipRectangle;
|
||||||
|
if (Image is not null)
|
||||||
|
{
|
||||||
|
rect.Y += Image.Height;
|
||||||
|
rect.Height -= Image.Height;
|
||||||
|
}
|
||||||
|
TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak;
|
||||||
|
TextRenderer.DrawText(pevent.Graphics, this.Text, this.Font, rect, Color.Gray, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
120
app/CustomControls.resx
Normal file
120
app/CustomControls.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
117
app/Fans.Designer.cs
generated
117
app/Fans.Designer.cs
generated
@@ -1,4 +1,7 @@
|
|||||||
namespace GHelper
|
using CustomControls;
|
||||||
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
|
||||||
|
namespace GHelper
|
||||||
{
|
{
|
||||||
partial class Fans
|
partial class Fans
|
||||||
{
|
{
|
||||||
@@ -28,25 +31,30 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
ChartArea chartArea1 = new ChartArea();
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
Title title1 = new Title();
|
||||||
|
ChartArea chartArea2 = new ChartArea();
|
||||||
|
Title title2 = new Title();
|
||||||
|
ChartArea chartArea3 = new ChartArea();
|
||||||
|
Title title3 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
labelBoost = new Label();
|
labelBoost = new Label();
|
||||||
comboBoost = new ComboBox();
|
comboBoost = new RComboBox();
|
||||||
picturePerf = new PictureBox();
|
picturePerf = new PictureBox();
|
||||||
tableFanCharts = new TableLayoutPanel();
|
tableFanCharts = new TableLayoutPanel();
|
||||||
chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
chartGPU = new Chart();
|
||||||
chartCPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
chartCPU = new Chart();
|
||||||
|
chartMid = new Chart();
|
||||||
labelFans = new Label();
|
labelFans = new Label();
|
||||||
checkAuto = new CheckBox();
|
checkAuto = new CheckBox();
|
||||||
buttonReset = new Button();
|
buttonReset = new RButton();
|
||||||
buttonApply = new Button();
|
buttonApply = new RButton();
|
||||||
panelPower = new Panel();
|
panelPower = new Panel();
|
||||||
pictureBox1 = new PictureBox();
|
pictureBox1 = new PictureBox();
|
||||||
labelPowerLimits = new Label();
|
labelPowerLimits = new Label();
|
||||||
checkApplyPower = new CheckBox();
|
checkApplyPower = new CheckBox();
|
||||||
buttonApplyPower = new Button();
|
buttonApplyPower = new RButton();
|
||||||
panelCPU = new Panel();
|
panelCPU = new Panel();
|
||||||
labelCPU = new Label();
|
labelCPU = new Label();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
@@ -63,6 +71,7 @@
|
|||||||
tableFanCharts.SuspendLayout();
|
tableFanCharts.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
||||||
panelPower.SuspendLayout();
|
panelPower.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
||||||
panelCPU.SuspendLayout();
|
panelCPU.SuspendLayout();
|
||||||
@@ -114,6 +123,7 @@
|
|||||||
// comboBoost
|
// comboBoost
|
||||||
//
|
//
|
||||||
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
comboBoost.BorderColor = Color.White;
|
||||||
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboBoost.FormattingEnabled = true;
|
comboBoost.FormattingEnabled = true;
|
||||||
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
||||||
@@ -141,14 +151,14 @@
|
|||||||
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||||
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
||||||
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
||||||
|
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
||||||
tableFanCharts.Location = new Point(28, 64);
|
tableFanCharts.Location = new Point(28, 64);
|
||||||
tableFanCharts.Margin = new Padding(6);
|
tableFanCharts.Margin = new Padding(6);
|
||||||
tableFanCharts.Name = "tableFanCharts";
|
tableFanCharts.Name = "tableFanCharts";
|
||||||
tableFanCharts.RowCount = 2;
|
tableFanCharts.RowCount = 2;
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
|
|
||||||
tableFanCharts.Size = new Size(764, 992);
|
tableFanCharts.Size = new Size(764, 992);
|
||||||
tableFanCharts.TabIndex = 36;
|
tableFanCharts.TabIndex = 36;
|
||||||
//
|
//
|
||||||
@@ -157,12 +167,14 @@
|
|||||||
chartArea1.Name = "ChartArea1";
|
chartArea1.Name = "ChartArea1";
|
||||||
chartGPU.ChartAreas.Add(chartArea1);
|
chartGPU.ChartAreas.Add(chartArea1);
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
chartGPU.Location = new Point(2, 506);
|
chartGPU.Location = new Point(2, 340);
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
chartGPU.Name = "chartGPU";
|
chartGPU.Name = "chartGPU";
|
||||||
chartGPU.Size = new Size(760, 476);
|
chartGPU.Size = new Size(760, 310);
|
||||||
chartGPU.TabIndex = 17;
|
chartGPU.TabIndex = 17;
|
||||||
chartGPU.Text = "chart1";
|
chartGPU.Text = "chartGPU";
|
||||||
|
title1.Name = "Title1";
|
||||||
|
chartGPU.Titles.Add(title1);
|
||||||
//
|
//
|
||||||
// chartCPU
|
// chartCPU
|
||||||
//
|
//
|
||||||
@@ -172,9 +184,26 @@
|
|||||||
chartCPU.Location = new Point(2, 10);
|
chartCPU.Location = new Point(2, 10);
|
||||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
chartCPU.Name = "chartCPU";
|
chartCPU.Name = "chartCPU";
|
||||||
chartCPU.Size = new Size(760, 476);
|
chartCPU.Size = new Size(760, 310);
|
||||||
chartCPU.TabIndex = 14;
|
chartCPU.TabIndex = 14;
|
||||||
chartCPU.Text = "chartCPU";
|
chartCPU.Text = "chartCPU";
|
||||||
|
title2.Name = "Title1";
|
||||||
|
chartCPU.Titles.Add(title2);
|
||||||
|
//
|
||||||
|
// chartMid
|
||||||
|
//
|
||||||
|
chartArea3.Name = "ChartArea3";
|
||||||
|
chartMid.ChartAreas.Add(chartArea3);
|
||||||
|
chartMid.Dock = DockStyle.Fill;
|
||||||
|
chartMid.Location = new Point(2, 670);
|
||||||
|
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartMid.Name = "chartMid";
|
||||||
|
chartMid.Size = new Size(760, 312);
|
||||||
|
chartMid.TabIndex = 14;
|
||||||
|
chartMid.Text = "chartMid";
|
||||||
|
title3.Name = "Title3";
|
||||||
|
chartMid.Titles.Add(title3);
|
||||||
|
chartMid.Visible = false;
|
||||||
//
|
//
|
||||||
// labelFans
|
// labelFans
|
||||||
//
|
//
|
||||||
@@ -201,25 +230,37 @@
|
|||||||
//
|
//
|
||||||
// buttonReset
|
// buttonReset
|
||||||
//
|
//
|
||||||
|
buttonReset.Activated = false;
|
||||||
buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
buttonReset.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonReset.BorderColor = Color.Transparent;
|
||||||
|
buttonReset.BorderRadius = 2;
|
||||||
|
buttonReset.FlatStyle = FlatStyle.Flat;
|
||||||
buttonReset.Location = new Point(30, 1081);
|
buttonReset.Location = new Point(30, 1081);
|
||||||
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonReset.Name = "buttonReset";
|
buttonReset.Name = "buttonReset";
|
||||||
|
buttonReset.Secondary = true;
|
||||||
buttonReset.Size = new Size(232, 44);
|
buttonReset.Size = new Size(232, 44);
|
||||||
buttonReset.TabIndex = 15;
|
buttonReset.TabIndex = 15;
|
||||||
buttonReset.Text = "Factory Defaults";
|
buttonReset.Text = "Factory Defaults";
|
||||||
buttonReset.UseVisualStyleBackColor = true;
|
buttonReset.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
// buttonApply
|
// buttonApply
|
||||||
//
|
//
|
||||||
|
buttonApply.Activated = false;
|
||||||
buttonApply.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
buttonApply.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
|
buttonApply.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonApply.BorderColor = Color.Transparent;
|
||||||
|
buttonApply.BorderRadius = 2;
|
||||||
|
buttonApply.FlatStyle = FlatStyle.Flat;
|
||||||
buttonApply.Location = new Point(542, 1081);
|
buttonApply.Location = new Point(542, 1081);
|
||||||
buttonApply.Margin = new Padding(4, 2, 4, 2);
|
buttonApply.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonApply.Name = "buttonApply";
|
buttonApply.Name = "buttonApply";
|
||||||
|
buttonApply.Secondary = true;
|
||||||
buttonApply.Size = new Size(248, 44);
|
buttonApply.Size = new Size(248, 44);
|
||||||
buttonApply.TabIndex = 14;
|
buttonApply.TabIndex = 14;
|
||||||
buttonApply.Text = "Apply Fan Curve";
|
buttonApply.Text = "Apply Custom Curve";
|
||||||
buttonApply.UseVisualStyleBackColor = true;
|
buttonApply.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
// panelPower
|
// panelPower
|
||||||
//
|
//
|
||||||
@@ -277,14 +318,20 @@
|
|||||||
//
|
//
|
||||||
// buttonApplyPower
|
// buttonApplyPower
|
||||||
//
|
//
|
||||||
|
buttonApplyPower.Activated = false;
|
||||||
buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
buttonApplyPower.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonApplyPower.BorderColor = Color.Transparent;
|
||||||
|
buttonApplyPower.BorderRadius = 2;
|
||||||
|
buttonApplyPower.FlatStyle = FlatStyle.Flat;
|
||||||
buttonApplyPower.Location = new Point(20, 1081);
|
buttonApplyPower.Location = new Point(20, 1081);
|
||||||
buttonApplyPower.Margin = new Padding(4, 2, 4, 2);
|
buttonApplyPower.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonApplyPower.Name = "buttonApplyPower";
|
buttonApplyPower.Name = "buttonApplyPower";
|
||||||
|
buttonApplyPower.Secondary = true;
|
||||||
buttonApplyPower.Size = new Size(324, 44);
|
buttonApplyPower.Size = new Size(324, 44);
|
||||||
buttonApplyPower.TabIndex = 24;
|
buttonApplyPower.TabIndex = 24;
|
||||||
buttonApplyPower.Text = "Apply Power Limits";
|
buttonApplyPower.Text = "Apply Power Limits";
|
||||||
buttonApplyPower.UseVisualStyleBackColor = true;
|
buttonApplyPower.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
// panelCPU
|
// panelCPU
|
||||||
//
|
//
|
||||||
@@ -299,12 +346,11 @@
|
|||||||
//
|
//
|
||||||
// labelCPU
|
// labelCPU
|
||||||
//
|
//
|
||||||
labelCPU.AutoSize = true;
|
|
||||||
labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelCPU.Location = new Point(44, 40);
|
labelCPU.Location = new Point(13, 40);
|
||||||
labelCPU.Margin = new Padding(4, 0, 4, 0);
|
labelCPU.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelCPU.Name = "labelCPU";
|
labelCPU.Name = "labelCPU";
|
||||||
labelCPU.Size = new Size(61, 32);
|
labelCPU.Size = new Size(120, 32);
|
||||||
labelCPU.TabIndex = 13;
|
labelCPU.TabIndex = 13;
|
||||||
labelCPU.Text = "CPU";
|
labelCPU.Text = "CPU";
|
||||||
labelCPU.TextAlign = ContentAlignment.MiddleCenter;
|
labelCPU.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
@@ -346,25 +392,24 @@
|
|||||||
//
|
//
|
||||||
// labelTotal
|
// labelTotal
|
||||||
//
|
//
|
||||||
labelTotal.AutoSize = true;
|
|
||||||
labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelTotal.Location = new Point(46, 40);
|
labelTotal.Location = new Point(16, 40);
|
||||||
labelTotal.Margin = new Padding(4, 0, 4, 0);
|
labelTotal.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelTotal.Name = "labelTotal";
|
labelTotal.Name = "labelTotal";
|
||||||
labelTotal.Size = new Size(70, 32);
|
labelTotal.Size = new Size(122, 32);
|
||||||
labelTotal.TabIndex = 12;
|
labelTotal.TabIndex = 12;
|
||||||
labelTotal.Text = "Total";
|
labelTotal.Text = "Platform";
|
||||||
labelTotal.TextAlign = ContentAlignment.MiddleCenter;
|
labelTotal.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
label1.AutoSize = true;
|
label1.AutoSize = true;
|
||||||
label1.Location = new Point(48, 8);
|
label1.Location = new Point(26, 8);
|
||||||
label1.Margin = new Padding(4, 0, 4, 0);
|
label1.Margin = new Padding(4, 0, 4, 0);
|
||||||
label1.Name = "label1";
|
label1.Name = "label1";
|
||||||
label1.Size = new Size(65, 32);
|
label1.Size = new Size(104, 32);
|
||||||
label1.TabIndex = 11;
|
label1.TabIndex = 11;
|
||||||
label1.Text = "Total";
|
label1.Text = "Platform";
|
||||||
label1.TextAlign = ContentAlignment.MiddleCenter;
|
label1.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
//
|
//
|
||||||
// trackTotal
|
// trackTotal
|
||||||
@@ -440,6 +485,7 @@
|
|||||||
tableFanCharts.ResumeLayout(false);
|
tableFanCharts.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
||||||
panelPower.ResumeLayout(false);
|
panelPower.ResumeLayout(false);
|
||||||
panelPower.PerformLayout();
|
panelPower.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||||
@@ -456,11 +502,11 @@
|
|||||||
#endregion
|
#endregion
|
||||||
private Panel panelFans;
|
private Panel panelFans;
|
||||||
private CheckBox checkAuto;
|
private CheckBox checkAuto;
|
||||||
private Button buttonReset;
|
private RButton buttonReset;
|
||||||
private Button buttonApply;
|
private RButton buttonApply;
|
||||||
private Panel panelPower;
|
private Panel panelPower;
|
||||||
private CheckBox checkApplyPower;
|
private CheckBox checkApplyPower;
|
||||||
private Button buttonApplyPower;
|
private RButton buttonApplyPower;
|
||||||
private Panel panelCPU;
|
private Panel panelCPU;
|
||||||
private Label labelCPU;
|
private Label labelCPU;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
@@ -476,10 +522,11 @@
|
|||||||
private TableLayoutPanel tableFanCharts;
|
private TableLayoutPanel tableFanCharts;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
|
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
|
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
|
||||||
|
private System.Windows.Forms.DataVisualization.Charting.Chart chartMid;
|
||||||
private Label labelFans;
|
private Label labelFans;
|
||||||
private PictureBox picturePerf;
|
private PictureBox picturePerf;
|
||||||
private PictureBox pictureBox1;
|
private PictureBox pictureBox1;
|
||||||
private ComboBox comboBoost;
|
private RComboBox comboBoost;
|
||||||
private Label labelBoost;
|
private Label labelBoost;
|
||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
}
|
}
|
||||||
|
|||||||
71
app/Fans.cs
71
app/Fans.cs
@@ -1,24 +1,24 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.Metrics;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Drawing.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Forms.DataVisualization.Charting;
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
using CustomControls;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
public partial class Fans : Form
|
public partial class Fans : RForm
|
||||||
{
|
{
|
||||||
|
|
||||||
DataPoint curPoint = null;
|
DataPoint curPoint = null;
|
||||||
Series seriesCPU;
|
Series seriesCPU;
|
||||||
Series seriesGPU;
|
Series seriesGPU;
|
||||||
|
Series seriesMid;
|
||||||
|
|
||||||
|
static int MinRPM, MaxRPM;
|
||||||
|
|
||||||
static string ChartPercToRPM(int percentage, string unit = "")
|
static string ChartPercToRPM(int percentage, string unit = "")
|
||||||
{
|
{
|
||||||
if (percentage == 0) return "OFF";
|
if (percentage == 0) return "OFF";
|
||||||
return (1800 + 200 * Math.Floor(percentage * 0.2)).ToString() + unit;
|
|
||||||
|
return (200 * Math.Round((float)(MinRPM + (MaxRPM - MinRPM) * percentage * 0.01) / 200)).ToString() + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetChart(Chart chart, int device)
|
void SetChart(Chart chart, int device)
|
||||||
@@ -28,19 +28,15 @@ namespace GHelper
|
|||||||
|
|
||||||
if (device == 1)
|
if (device == 1)
|
||||||
title = "GPU Fan Profile";
|
title = "GPU Fan Profile";
|
||||||
|
else if (device == 2)
|
||||||
|
title = "Middle Fan Profile";
|
||||||
else
|
else
|
||||||
title = "CPU Fan Profile";
|
title = "CPU Fan Profile";
|
||||||
|
|
||||||
if (Program.settingsForm.perfName.Length > 0)
|
if (Program.settingsForm.perfName.Length > 0)
|
||||||
labelFans.Text = "Fan Profiles: " + Program.settingsForm.perfName;
|
labelFans.Text = "Fan Profiles: " + Program.settingsForm.perfName;
|
||||||
|
|
||||||
if (chart.Titles.Count > 0)
|
chart.Titles[0].Text = title;
|
||||||
chart.Titles[0].Text = title;
|
|
||||||
else
|
|
||||||
chart.Titles.Add(title);
|
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
|
|
||||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
|
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisX.Minimum = 10;
|
chart.ChartAreas[0].AxisX.Minimum = 10;
|
||||||
chart.ChartAreas[0].AxisX.Maximum = 100;
|
chart.ChartAreas[0].AxisX.Maximum = 100;
|
||||||
@@ -84,6 +80,18 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InitTheme();
|
||||||
|
|
||||||
|
MinRPM = 1800;
|
||||||
|
|
||||||
|
if (Program.config.ContainsModel("401"))
|
||||||
|
MaxRPM = 7200;
|
||||||
|
else if (Program.config.ContainsModel("503"))
|
||||||
|
MaxRPM = 6800;
|
||||||
|
else
|
||||||
|
MaxRPM = 5800;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
labelTip.Visible = false;
|
labelTip.Visible = false;
|
||||||
labelTip.BackColor = Color.Transparent;
|
labelTip.BackColor = Color.Transparent;
|
||||||
@@ -92,9 +100,11 @@ namespace GHelper
|
|||||||
|
|
||||||
seriesCPU = chartCPU.Series.Add("CPU");
|
seriesCPU = chartCPU.Series.Add("CPU");
|
||||||
seriesGPU = chartGPU.Series.Add("GPU");
|
seriesGPU = chartGPU.Series.Add("GPU");
|
||||||
|
seriesMid = chartMid.Series.Add("Mid");
|
||||||
|
|
||||||
seriesCPU.Color = Color.Blue;
|
seriesCPU.Color = colorStandard;
|
||||||
seriesGPU.Color = Color.Red;
|
seriesGPU.Color = colorTurbo;
|
||||||
|
seriesMid.Color = colorEco;
|
||||||
|
|
||||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||||
@@ -102,6 +112,9 @@ namespace GHelper
|
|||||||
chartGPU.MouseMove += ChartCPU_MouseMove;
|
chartGPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartGPU.MouseUp += ChartCPU_MouseUp;
|
chartGPU.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
|
chartMid.MouseMove += ChartCPU_MouseMove;
|
||||||
|
chartMid.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
buttonReset.Click += ButtonReset_Click;
|
buttonReset.Click += ButtonReset_Click;
|
||||||
buttonApply.Click += ButtonApply_Click;
|
buttonApply.Click += ButtonApply_Click;
|
||||||
|
|
||||||
@@ -245,12 +258,12 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
if (applied)
|
if (applied)
|
||||||
{
|
{
|
||||||
labelApplied.ForeColor = Color.Blue;
|
labelApplied.ForeColor = colorStandard;
|
||||||
labelApplied.Text = "Applied";
|
labelApplied.Text = "Applied";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
labelApplied.ForeColor = Color.Red;
|
labelApplied.ForeColor = colorTurbo;
|
||||||
labelApplied.Text = "Not Applied";
|
labelApplied.Text = "Not Applied";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -259,6 +272,22 @@ namespace GHelper
|
|||||||
public void InitFans()
|
public void InitFans()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
byte[] curve = Program.wmi.GetFanCurve(2);
|
||||||
|
|
||||||
|
if (curve.All(singleByte => singleByte == 0))
|
||||||
|
{
|
||||||
|
Program.config.setConfig("mid_fan", 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Program.config.setConfig("mid_fan", 1);
|
||||||
|
chartMid.Visible = true;
|
||||||
|
SetChart(chartMid, 2);
|
||||||
|
LoadProfile(seriesMid, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SetChart(chartCPU, 0);
|
SetChart(chartCPU, 0);
|
||||||
SetChart(chartGPU, 1);
|
SetChart(chartGPU, 1);
|
||||||
|
|
||||||
@@ -323,6 +352,8 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
ApplyProfile(seriesCPU, 0);
|
ApplyProfile(seriesCPU, 0);
|
||||||
ApplyProfile(seriesGPU, 1);
|
ApplyProfile(seriesGPU, 1);
|
||||||
|
if (Program.config.getConfig("mid_fan") == 1)
|
||||||
|
ApplyProfile(seriesMid, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonReset_Click(object? sender, EventArgs e)
|
private void ButtonReset_Click(object? sender, EventArgs e)
|
||||||
@@ -330,6 +361,8 @@ namespace GHelper
|
|||||||
|
|
||||||
LoadProfile(seriesCPU, 0, 1);
|
LoadProfile(seriesCPU, 0, 1);
|
||||||
LoadProfile(seriesGPU, 1, 1);
|
LoadProfile(seriesGPU, 1, 1);
|
||||||
|
if (Program.config.getConfig("mid_fan") == 1)
|
||||||
|
LoadProfile(seriesMid, 2, 1);
|
||||||
|
|
||||||
checkAuto.Checked = false;
|
checkAuto.Checked = false;
|
||||||
checkApplyPower.Checked = false;
|
checkApplyPower.Checked = false;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.31</AssemblyVersion>
|
<AssemblyVersion>0.37</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -51,15 +51,6 @@
|
|||||||
<PackageReference Include="WinForms.DataVisualization" Version="1.7.0" />
|
<PackageReference Include="WinForms.DataVisualization" Version="1.7.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.Management.Infrastructure">
|
|
||||||
<HintPath>..\..\.nuget\packages\microsoft.management.infrastructure\2.0.0\ref\net451\Microsoft.Management.Infrastructure.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Management.Infrastructure.Native">
|
|
||||||
<HintPath>..\..\.nuget\packages\microsoft.management.infrastructure.runtime.win\2.0.0\runtimes\win10-x64\lib\netstandard1.6\Microsoft.Management.Infrastructure.Native.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Resources\eco.ico">
|
<Content Include="Resources\eco.ico">
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||||
|
|||||||
@@ -58,29 +58,34 @@ public static class HardwareMonitor
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void RecreateGpuTemperatureProvider() {
|
public static void RecreateGpuTemperatureProvider() {
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
GpuTemperatureProvider?.Dispose();
|
GpuTemperatureProvider?.Dispose();
|
||||||
|
|
||||||
// Detect valid GPU temperature provider.
|
// Detect valid GPU temperature provider.
|
||||||
// We start with NVIDIA because there's always at least an integrated AMD GPU
|
// We start with NVIDIA because there's always at least an integrated AMD GPU
|
||||||
IGpuTemperatureProvider gpuTemperatureProvider = new NvidiaGpuTemperatureProvider();
|
IGpuTemperatureProvider gpuTemperatureProvider = new NvidiaGpuTemperatureProvider();
|
||||||
if (gpuTemperatureProvider.IsValid) {
|
if (gpuTemperatureProvider.IsValid)
|
||||||
|
{
|
||||||
GpuTemperatureProvider = gpuTemperatureProvider;
|
GpuTemperatureProvider = gpuTemperatureProvider;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpuTemperatureProvider.Dispose();
|
gpuTemperatureProvider.Dispose();
|
||||||
gpuTemperatureProvider = new AmdGpuTemperatureProvider();
|
gpuTemperatureProvider = new AmdGpuTemperatureProvider();
|
||||||
if (gpuTemperatureProvider.IsValid) {
|
if (gpuTemperatureProvider.IsValid)
|
||||||
|
{
|
||||||
GpuTemperatureProvider = gpuTemperatureProvider;
|
GpuTemperatureProvider = gpuTemperatureProvider;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpuTemperatureProvider.Dispose();
|
gpuTemperatureProvider.Dispose();
|
||||||
|
|
||||||
GpuTemperatureProvider = null;
|
GpuTemperatureProvider = null;
|
||||||
} finally {
|
|
||||||
Logger.WriteLine($"GpuTemperatureProvider: {GpuTemperatureProvider?.GetType().Name}");
|
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(ex.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
using System.Drawing.Drawing2D;
|
|
||||||
|
|
||||||
public static class HighDpiHelper
|
|
||||||
{
|
|
||||||
public static void AdjustControlImagesDpiScale(Control container, float baseScale = 2)
|
|
||||||
{
|
|
||||||
var dpiScale = GetDpiScale(container).Value;
|
|
||||||
AdjustControlImagesDpiScale(container.Controls, dpiScale / baseScale);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AdjustButtonDpiScale(ButtonBase button, float dpiScale)
|
|
||||||
{
|
|
||||||
var image = button.Image;
|
|
||||||
|
|
||||||
if (image == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
button.Image = ScaleImage(image, dpiScale);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void AdjustControlImagesDpiScale(Control.ControlCollection controls, float dpiScale)
|
|
||||||
{
|
|
||||||
foreach (Control control in controls)
|
|
||||||
{
|
|
||||||
var button = control as ButtonBase;
|
|
||||||
if (button != null)
|
|
||||||
AdjustButtonDpiScale(button, dpiScale);
|
|
||||||
|
|
||||||
AdjustControlImagesDpiScale(control.Controls, dpiScale);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Lazy<float> GetDpiScale(Control control)
|
|
||||||
{
|
|
||||||
return new Lazy<float>(() =>
|
|
||||||
{
|
|
||||||
using (var graphics = control.CreateGraphics())
|
|
||||||
return graphics.DpiX / 96.0f;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Image ScaleImage(Image image, float dpiScale)
|
|
||||||
{
|
|
||||||
var newSize = ScaleSize(image.Size, dpiScale);
|
|
||||||
var newBitmap = new Bitmap(newSize.Width, newSize.Height);
|
|
||||||
|
|
||||||
using (var g = Graphics.FromImage(newBitmap))
|
|
||||||
{
|
|
||||||
// According to this blog post http://blogs.msdn.com/b/visualstudio/archive/2014/03/19/improving-high-dpi-support-for-visual-studio-2013.aspx
|
|
||||||
// NearestNeighbor is more adapted for 200% and 200%+ DPI
|
|
||||||
|
|
||||||
var interpolationMode = InterpolationMode.HighQualityBicubic;
|
|
||||||
if (dpiScale >= 2.0f)
|
|
||||||
interpolationMode = InterpolationMode.NearestNeighbor;
|
|
||||||
|
|
||||||
g.InterpolationMode = interpolationMode;
|
|
||||||
g.DrawImage(image, new Rectangle(new Point(), newSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
return newBitmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Size ScaleSize(Size size, float scale)
|
|
||||||
{
|
|
||||||
return new Size((int)(size.Width * scale), (int)(size.Height * scale));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
16
app/Keyboard.Designer.cs
generated
16
app/Keyboard.Designer.cs
generated
@@ -1,4 +1,6 @@
|
|||||||
namespace GHelper
|
using CustomControls;
|
||||||
|
|
||||||
|
namespace GHelper
|
||||||
{
|
{
|
||||||
partial class Keyboard
|
partial class Keyboard
|
||||||
{
|
{
|
||||||
@@ -31,12 +33,12 @@
|
|||||||
groupBox1 = new GroupBox();
|
groupBox1 = new GroupBox();
|
||||||
textM4 = new TextBox();
|
textM4 = new TextBox();
|
||||||
textM3 = new TextBox();
|
textM3 = new TextBox();
|
||||||
comboM4 = new ComboBox();
|
comboM4 = new RComboBox();
|
||||||
labelM4 = new Label();
|
labelM4 = new Label();
|
||||||
comboM3 = new ComboBox();
|
comboM3 = new RComboBox();
|
||||||
labelM3 = new Label();
|
labelM3 = new Label();
|
||||||
textFNF4 = new TextBox();
|
textFNF4 = new TextBox();
|
||||||
comboFNF4 = new ComboBox();
|
comboFNF4 = new RComboBox();
|
||||||
labelFNF4 = new Label();
|
labelFNF4 = new Label();
|
||||||
groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@@ -161,13 +163,13 @@
|
|||||||
|
|
||||||
private GroupBox groupBox1;
|
private GroupBox groupBox1;
|
||||||
private Label labelM3;
|
private Label labelM3;
|
||||||
private ComboBox comboM3;
|
private RComboBox comboM3;
|
||||||
private ComboBox comboM4;
|
private RComboBox comboM4;
|
||||||
private Label labelM4;
|
private Label labelM4;
|
||||||
private TextBox textM4;
|
private TextBox textM4;
|
||||||
private TextBox textM3;
|
private TextBox textM3;
|
||||||
private TextBox textFNF4;
|
private TextBox textFNF4;
|
||||||
private ComboBox comboFNF4;
|
private RComboBox comboFNF4;
|
||||||
private Label labelFNF4;
|
private Label labelFNF4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
namespace GHelper
|
using CustomControls;
|
||||||
|
|
||||||
|
namespace GHelper
|
||||||
{
|
{
|
||||||
public partial class Keyboard : Form
|
public partial class Keyboard : RForm
|
||||||
{
|
{
|
||||||
|
|
||||||
Dictionary<string, string> customActions = new Dictionary<string, string>
|
Dictionary<string, string> customActions = new Dictionary<string, string>
|
||||||
@@ -51,6 +53,7 @@
|
|||||||
public Keyboard()
|
public Keyboard()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InitTheme();
|
||||||
|
|
||||||
SetKeyCombo(comboM3, textM3, "m3");
|
SetKeyCombo(comboM3, textM3, "m3");
|
||||||
SetKeyCombo(comboM4, textM4, "m4");
|
SetKeyCombo(comboM4, textM4, "m4");
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace GHelper
|
|||||||
private static IntPtr ds;
|
private static IntPtr ds;
|
||||||
|
|
||||||
private static long lastAuto;
|
private static long lastAuto;
|
||||||
|
private static long lastTheme;
|
||||||
|
|
||||||
// The main entry point for the application
|
// The main entry point for the application
|
||||||
public static void Main()
|
public static void Main()
|
||||||
@@ -48,11 +49,16 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
|
|
||||||
|
SystemEvents.UserPreferenceChanged += new
|
||||||
|
UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
|
||||||
|
|
||||||
ds = settingsForm.Handle;
|
ds = settingsForm.Handle;
|
||||||
|
|
||||||
trayIcon.MouseClick += TrayIcon_MouseClick; ;
|
trayIcon.MouseClick += TrayIcon_MouseClick;
|
||||||
|
|
||||||
|
|
||||||
wmi.SubscribeToEvents(WatcherEventArrived);
|
wmi.SubscribeToEvents(WatcherEventArrived);
|
||||||
|
|
||||||
@@ -72,16 +78,47 @@ namespace GHelper
|
|||||||
// Subscribing for system power change events
|
// Subscribing for system power change events
|
||||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||||
|
|
||||||
|
settingsForm.SetVersionLabel("Version: " + Assembly.GetExecutingAssembly().GetName().Version);
|
||||||
CheckForUpdates();
|
CheckForUpdates();
|
||||||
|
|
||||||
|
|
||||||
|
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\'))
|
||||||
|
{
|
||||||
|
SettingsToggle();
|
||||||
|
}
|
||||||
|
|
||||||
Application.Run();
|
Application.Run();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async void CheckForUpdates()
|
|
||||||
|
static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
var assembly = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTheme) < 2000) return;
|
||||||
settingsForm.SetVersionLabel("Version: " + assembly);
|
lastTheme = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
|
switch (e.Category)
|
||||||
|
{
|
||||||
|
case UserPreferenceCategory.General:
|
||||||
|
Debug.WriteLine("Theme Changed");
|
||||||
|
Thread.Sleep(500);
|
||||||
|
settingsForm.InitTheme(false);
|
||||||
|
|
||||||
|
if (settingsForm.fans is not null && settingsForm.fans.Text != "")
|
||||||
|
settingsForm.fans.InitTheme(false);
|
||||||
|
|
||||||
|
if (settingsForm.keyb is not null && settingsForm.keyb.Text != "")
|
||||||
|
settingsForm.keyb.InitTheme(false);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static async void CheckForUpdates()
|
||||||
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -94,28 +131,30 @@ namespace GHelper
|
|||||||
var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString();
|
var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString();
|
||||||
|
|
||||||
var gitVersion = new Version(tag);
|
var gitVersion = new Version(tag);
|
||||||
var appVersion = new Version(assembly);
|
var appVersion = new Version(Assembly.GetExecutingAssembly().GetName().Version.ToString());
|
||||||
|
if (gitVersion.CompareTo(appVersion) > 0)
|
||||||
var result = gitVersion.CompareTo(appVersion);
|
|
||||||
if (result > 0)
|
|
||||||
{
|
{
|
||||||
settingsForm.SetVersionLabel("Download Update: " + tag, url);
|
settingsForm.BeginInvoke(delegate
|
||||||
|
{
|
||||||
|
settingsForm.SetVersionLabel("Download Update: " + tag, url);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("Failed to get update");
|
Logger.WriteLine("Failed to check for updates:"+ ex.Message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void SetAutoModes()
|
public static void SetAutoModes(bool wait = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 1000) return;
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 2000) return;
|
||||||
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
PowerLineStatus isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
PowerLineStatus isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
@@ -126,6 +165,9 @@ namespace GHelper
|
|||||||
|
|
||||||
settingsForm.AutoPerformance(isPlugged);
|
settingsForm.AutoPerformance(isPlugged);
|
||||||
|
|
||||||
|
// waiting a bit before turning off dGPU
|
||||||
|
// if (wait && isPlugged != PowerLineStatus.Online) Thread.Sleep(3000);
|
||||||
|
|
||||||
bool switched = settingsForm.AutoGPUMode(isPlugged);
|
bool switched = settingsForm.AutoGPUMode(isPlugged);
|
||||||
if (!switched) settingsForm.AutoScreen(isPlugged);
|
if (!switched) settingsForm.AutoScreen(isPlugged);
|
||||||
|
|
||||||
@@ -135,7 +177,7 @@ namespace GHelper
|
|||||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("Windows - Power Mode Changed");
|
Logger.WriteLine("Windows - Power Mode Changed");
|
||||||
SetAutoModes();
|
SetAutoModes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
using System.ComponentModel;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Drawing2D;
|
|
||||||
|
|
||||||
namespace CustomControls
|
|
||||||
{
|
|
||||||
public class RoundedButton : Button
|
|
||||||
{
|
|
||||||
//Fields
|
|
||||||
private int borderSize = 5;
|
|
||||||
private int borderRadius = 5;
|
|
||||||
private bool activated = false;
|
|
||||||
private Color borderColor = Color.Transparent;
|
|
||||||
|
|
||||||
public Color BorderColor
|
|
||||||
{
|
|
||||||
get { return borderColor; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
borderColor = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public bool Activated
|
|
||||||
{
|
|
||||||
get { return activated; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (activated != value)
|
|
||||||
this.Invalidate();
|
|
||||||
activated = value;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public RoundedButton()
|
|
||||||
{
|
|
||||||
this.FlatStyle = FlatStyle.Flat;
|
|
||||||
this.FlatAppearance.BorderSize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GraphicsPath GetFigurePath(Rectangle rect, int radius)
|
|
||||||
{
|
|
||||||
GraphicsPath path = new GraphicsPath();
|
|
||||||
float curveSize = radius * 2F;
|
|
||||||
|
|
||||||
path.StartFigure();
|
|
||||||
path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
|
|
||||||
path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
|
|
||||||
path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
|
|
||||||
path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
|
|
||||||
path.CloseFigure();
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected override void OnPaint(PaintEventArgs pevent)
|
|
||||||
{
|
|
||||||
base.OnPaint(pevent);
|
|
||||||
|
|
||||||
float ratio = pevent.Graphics.DpiX / 192.0f;
|
|
||||||
int border = (int)(ratio * borderSize);
|
|
||||||
|
|
||||||
Rectangle rectSurface = this.ClientRectangle;
|
|
||||||
Rectangle rectBorder = Rectangle.Inflate(rectSurface, -border, -border);
|
|
||||||
|
|
||||||
Color borderDrawColor = activated ? borderColor : Color.Transparent;
|
|
||||||
|
|
||||||
using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius+ border))
|
|
||||||
using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius))
|
|
||||||
using (Pen penSurface = new Pen(this.Parent.BackColor, border))
|
|
||||||
using (Pen penBorder = new Pen(borderDrawColor, border))
|
|
||||||
{
|
|
||||||
penBorder.Alignment = PenAlignment.Outset;
|
|
||||||
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
|
||||||
this.Region = new Region(pathSurface);
|
|
||||||
pevent.Graphics.DrawPath(penSurface, pathSurface);
|
|
||||||
pevent.Graphics.DrawPath(penBorder, pathBorder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
282
app/Settings.Designer.cs
generated
282
app/Settings.Designer.cs
generated
@@ -34,9 +34,9 @@ namespace GHelper
|
|||||||
panelMatrix = new Panel();
|
panelMatrix = new Panel();
|
||||||
checkMatrix = new CheckBox();
|
checkMatrix = new CheckBox();
|
||||||
tableLayoutMatrix = new TableLayoutPanel();
|
tableLayoutMatrix = new TableLayoutPanel();
|
||||||
comboMatrix = new ComboBox();
|
comboMatrix = new RComboBox();
|
||||||
buttonMatrix = new Button();
|
buttonMatrix = new RButton();
|
||||||
comboMatrixRunning = new ComboBox();
|
comboMatrixRunning = new RComboBox();
|
||||||
pictureMatrix = new PictureBox();
|
pictureMatrix = new PictureBox();
|
||||||
labelMatrix = new Label();
|
labelMatrix = new Label();
|
||||||
panelBattery = new Panel();
|
panelBattery = new Panel();
|
||||||
@@ -46,43 +46,45 @@ namespace GHelper
|
|||||||
labelBatteryTitle = new Label();
|
labelBatteryTitle = new Label();
|
||||||
trackBattery = new TrackBar();
|
trackBattery = new TrackBar();
|
||||||
panelFooter = new Panel();
|
panelFooter = new Panel();
|
||||||
buttonQuit = new Button();
|
buttonQuit = new RButton();
|
||||||
checkStartup = new CheckBox();
|
checkStartup = new CheckBox();
|
||||||
panelPerformance = new Panel();
|
panelPerformance = new Panel();
|
||||||
picturePerf = new PictureBox();
|
picturePerf = new PictureBox();
|
||||||
labelPerf = new Label();
|
labelPerf = new Label();
|
||||||
labelCPUFan = new Label();
|
labelCPUFan = new Label();
|
||||||
tablePerf = new TableLayoutPanel();
|
tablePerf = new TableLayoutPanel();
|
||||||
buttonSilent = new RoundedButton();
|
buttonSilent = new RButton();
|
||||||
buttonBalanced = new RoundedButton();
|
buttonBalanced = new RButton();
|
||||||
buttonTurbo = new RoundedButton();
|
buttonTurbo = new RButton();
|
||||||
buttonFans = new Button();
|
buttonFans = new RButton();
|
||||||
panelGPU = new Panel();
|
panelGPU = new Panel();
|
||||||
labelTipGPU = new Label();
|
labelTipGPU = new Label();
|
||||||
pictureGPU = new PictureBox();
|
pictureGPU = new PictureBox();
|
||||||
labelGPU = new Label();
|
labelGPU = new Label();
|
||||||
labelGPUFan = new Label();
|
labelGPUFan = new Label();
|
||||||
tableGPU = new TableLayoutPanel();
|
tableGPU = new TableLayoutPanel();
|
||||||
buttonEco = new RoundedButton();
|
buttonEco = new RButton();
|
||||||
buttonStandard = new RoundedButton();
|
buttonStandard = new RButton();
|
||||||
buttonOptimized = new RoundedButton();
|
buttonOptimized = new RButton();
|
||||||
buttonUltimate = new RoundedButton();
|
buttonUltimate = new RButton();
|
||||||
panelScreen = new Panel();
|
panelScreen = new Panel();
|
||||||
|
labelMidFan = new Label();
|
||||||
labelTipScreen = new Label();
|
labelTipScreen = new Label();
|
||||||
tableScreen = new TableLayoutPanel();
|
tableScreen = new TableLayoutPanel();
|
||||||
buttonScreenAuto = new RoundedButton();
|
buttonScreenAuto = new RButton();
|
||||||
button60Hz = new RoundedButton();
|
button60Hz = new RButton();
|
||||||
button120Hz = new RoundedButton();
|
button120Hz = new RButton();
|
||||||
|
buttonMiniled = new RButton();
|
||||||
pictureScreen = new PictureBox();
|
pictureScreen = new PictureBox();
|
||||||
labelSreen = new Label();
|
labelSreen = new Label();
|
||||||
panelKeyboard = new Panel();
|
panelKeyboard = new Panel();
|
||||||
tableLayoutKeyboard = new TableLayoutPanel();
|
tableLayoutKeyboard = new TableLayoutPanel();
|
||||||
buttonKeyboard = new Button();
|
buttonKeyboard = new RButton();
|
||||||
comboKeyboard = new ComboBox();
|
comboKeyboard = new RComboBox();
|
||||||
panelColor = new Panel();
|
panelColor = new Panel();
|
||||||
pictureColor2 = new PictureBox();
|
pictureColor2 = new PictureBox();
|
||||||
pictureColor = new PictureBox();
|
pictureColor = new PictureBox();
|
||||||
buttonKeyboardColor = new Button();
|
buttonKeyboardColor = new RButton();
|
||||||
pictureKeyboard = new PictureBox();
|
pictureKeyboard = new PictureBox();
|
||||||
labelKeyboard = new Label();
|
labelKeyboard = new Label();
|
||||||
panelMatrix.SuspendLayout();
|
panelMatrix.SuspendLayout();
|
||||||
@@ -122,7 +124,7 @@ namespace GHelper
|
|||||||
panelMatrix.Margin = new Padding(8);
|
panelMatrix.Margin = new Padding(8);
|
||||||
panelMatrix.Name = "panelMatrix";
|
panelMatrix.Name = "panelMatrix";
|
||||||
panelMatrix.Padding = new Padding(0, 0, 0, 12);
|
panelMatrix.Padding = new Padding(0, 0, 0, 12);
|
||||||
panelMatrix.Size = new Size(816, 168);
|
panelMatrix.Size = new Size(810, 168);
|
||||||
panelMatrix.TabIndex = 33;
|
panelMatrix.TabIndex = 33;
|
||||||
//
|
//
|
||||||
// checkMatrix
|
// checkMatrix
|
||||||
@@ -155,11 +157,13 @@ namespace GHelper
|
|||||||
tableLayoutMatrix.Name = "tableLayoutMatrix";
|
tableLayoutMatrix.Name = "tableLayoutMatrix";
|
||||||
tableLayoutMatrix.RowCount = 1;
|
tableLayoutMatrix.RowCount = 1;
|
||||||
tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||||
tableLayoutMatrix.Size = new Size(780, 60);
|
tableLayoutMatrix.Size = new Size(772, 60);
|
||||||
tableLayoutMatrix.TabIndex = 43;
|
tableLayoutMatrix.TabIndex = 43;
|
||||||
//
|
//
|
||||||
// comboMatrix
|
// comboMatrix
|
||||||
//
|
//
|
||||||
|
comboMatrix.BorderColor = Color.White;
|
||||||
|
comboMatrix.ButtonColor = SystemColors.ControlLight;
|
||||||
comboMatrix.Dock = DockStyle.Top;
|
comboMatrix.Dock = DockStyle.Top;
|
||||||
comboMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
comboMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
comboMatrix.FormattingEnabled = true;
|
comboMatrix.FormattingEnabled = true;
|
||||||
@@ -168,34 +172,41 @@ namespace GHelper
|
|||||||
comboMatrix.Location = new Point(4, 10);
|
comboMatrix.Location = new Point(4, 10);
|
||||||
comboMatrix.Margin = new Padding(4, 10, 4, 8);
|
comboMatrix.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboMatrix.Name = "comboMatrix";
|
comboMatrix.Name = "comboMatrix";
|
||||||
comboMatrix.Size = new Size(187, 40);
|
comboMatrix.Size = new Size(185, 40);
|
||||||
comboMatrix.TabIndex = 41;
|
comboMatrix.TabIndex = 41;
|
||||||
comboMatrix.TabStop = false;
|
comboMatrix.TabStop = false;
|
||||||
//
|
//
|
||||||
// buttonMatrix
|
// buttonMatrix
|
||||||
//
|
//
|
||||||
buttonMatrix.BackColor = SystemColors.ButtonFace;
|
buttonMatrix.Activated = false;
|
||||||
|
buttonMatrix.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonMatrix.BorderColor = Color.Transparent;
|
||||||
|
buttonMatrix.BorderRadius = 2;
|
||||||
buttonMatrix.Dock = DockStyle.Top;
|
buttonMatrix.Dock = DockStyle.Top;
|
||||||
buttonMatrix.FlatAppearance.BorderSize = 0;
|
buttonMatrix.FlatAppearance.BorderSize = 0;
|
||||||
buttonMatrix.Location = new Point(394, 8);
|
buttonMatrix.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonMatrix.Location = new Point(390, 8);
|
||||||
buttonMatrix.Margin = new Padding(4, 8, 4, 8);
|
buttonMatrix.Margin = new Padding(4, 8, 4, 8);
|
||||||
buttonMatrix.Name = "buttonMatrix";
|
buttonMatrix.Name = "buttonMatrix";
|
||||||
buttonMatrix.Size = new Size(187, 44);
|
buttonMatrix.Secondary = true;
|
||||||
|
buttonMatrix.Size = new Size(185, 44);
|
||||||
buttonMatrix.TabIndex = 43;
|
buttonMatrix.TabIndex = 43;
|
||||||
buttonMatrix.Text = "Picture / Gif";
|
buttonMatrix.Text = "Picture / Gif";
|
||||||
buttonMatrix.UseVisualStyleBackColor = false;
|
buttonMatrix.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
// comboMatrixRunning
|
// comboMatrixRunning
|
||||||
//
|
//
|
||||||
|
comboMatrixRunning.BorderColor = Color.White;
|
||||||
|
comboMatrixRunning.ButtonColor = SystemColors.ControlLight;
|
||||||
comboMatrixRunning.Dock = DockStyle.Top;
|
comboMatrixRunning.Dock = DockStyle.Top;
|
||||||
comboMatrixRunning.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
comboMatrixRunning.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
comboMatrixRunning.FormattingEnabled = true;
|
comboMatrixRunning.FormattingEnabled = true;
|
||||||
comboMatrixRunning.ItemHeight = 32;
|
comboMatrixRunning.ItemHeight = 32;
|
||||||
comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture" });
|
comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture", "Clock" });
|
||||||
comboMatrixRunning.Location = new Point(199, 10);
|
comboMatrixRunning.Location = new Point(197, 10);
|
||||||
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
|
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboMatrixRunning.Name = "comboMatrixRunning";
|
comboMatrixRunning.Name = "comboMatrixRunning";
|
||||||
comboMatrixRunning.Size = new Size(187, 40);
|
comboMatrixRunning.Size = new Size(185, 40);
|
||||||
comboMatrixRunning.TabIndex = 42;
|
comboMatrixRunning.TabIndex = 42;
|
||||||
comboMatrixRunning.TabStop = false;
|
comboMatrixRunning.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -235,7 +246,7 @@ namespace GHelper
|
|||||||
panelBattery.Margin = new Padding(8);
|
panelBattery.Margin = new Padding(8);
|
||||||
panelBattery.Name = "panelBattery";
|
panelBattery.Name = "panelBattery";
|
||||||
panelBattery.Padding = new Padding(0, 0, 0, 12);
|
panelBattery.Padding = new Padding(0, 0, 0, 12);
|
||||||
panelBattery.Size = new Size(816, 158);
|
panelBattery.Size = new Size(810, 158);
|
||||||
panelBattery.TabIndex = 34;
|
panelBattery.TabIndex = 34;
|
||||||
//
|
//
|
||||||
// labelVersion
|
// labelVersion
|
||||||
@@ -253,7 +264,7 @@ namespace GHelper
|
|||||||
// labelBattery
|
// labelBattery
|
||||||
//
|
//
|
||||||
labelBattery.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelBattery.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelBattery.Location = new Point(428, 9);
|
labelBattery.Location = new Point(422, 9);
|
||||||
labelBattery.Margin = new Padding(8, 0, 8, 0);
|
labelBattery.Margin = new Padding(8, 0, 8, 0);
|
||||||
labelBattery.Name = "labelBattery";
|
labelBattery.Name = "labelBattery";
|
||||||
labelBattery.Size = new Size(364, 44);
|
labelBattery.Size = new Size(364, 44);
|
||||||
@@ -291,7 +302,7 @@ namespace GHelper
|
|||||||
trackBattery.Maximum = 100;
|
trackBattery.Maximum = 100;
|
||||||
trackBattery.Minimum = 50;
|
trackBattery.Minimum = 50;
|
||||||
trackBattery.Name = "trackBattery";
|
trackBattery.Name = "trackBattery";
|
||||||
trackBattery.Size = new Size(772, 90);
|
trackBattery.Size = new Size(766, 90);
|
||||||
trackBattery.SmallChange = 5;
|
trackBattery.SmallChange = 5;
|
||||||
trackBattery.TabIndex = 33;
|
trackBattery.TabIndex = 33;
|
||||||
trackBattery.TickFrequency = 10;
|
trackBattery.TickFrequency = 10;
|
||||||
@@ -309,17 +320,22 @@ namespace GHelper
|
|||||||
panelFooter.Margin = new Padding(8);
|
panelFooter.Margin = new Padding(8);
|
||||||
panelFooter.Name = "panelFooter";
|
panelFooter.Name = "panelFooter";
|
||||||
panelFooter.Padding = new Padding(0, 0, 0, 10);
|
panelFooter.Padding = new Padding(0, 0, 0, 10);
|
||||||
panelFooter.Size = new Size(816, 74);
|
panelFooter.Size = new Size(810, 74);
|
||||||
panelFooter.TabIndex = 35;
|
panelFooter.TabIndex = 35;
|
||||||
//
|
//
|
||||||
// buttonQuit
|
// buttonQuit
|
||||||
//
|
//
|
||||||
|
buttonQuit.Activated = false;
|
||||||
buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
buttonQuit.BackColor = SystemColors.ButtonFace;
|
buttonQuit.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
buttonQuit.Location = new Point(584, 16);
|
buttonQuit.BorderColor = Color.Transparent;
|
||||||
|
buttonQuit.BorderRadius = 2;
|
||||||
|
buttonQuit.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonQuit.Location = new Point(599, 16);
|
||||||
buttonQuit.Margin = new Padding(8, 4, 8, 4);
|
buttonQuit.Margin = new Padding(8, 4, 8, 4);
|
||||||
buttonQuit.Name = "buttonQuit";
|
buttonQuit.Name = "buttonQuit";
|
||||||
buttonQuit.Size = new Size(208, 44);
|
buttonQuit.Secondary = true;
|
||||||
|
buttonQuit.Size = new Size(185, 44);
|
||||||
buttonQuit.TabIndex = 18;
|
buttonQuit.TabIndex = 18;
|
||||||
buttonQuit.Text = "Quit";
|
buttonQuit.Text = "Quit";
|
||||||
buttonQuit.UseVisualStyleBackColor = false;
|
buttonQuit.UseVisualStyleBackColor = false;
|
||||||
@@ -348,7 +364,7 @@ namespace GHelper
|
|||||||
panelPerformance.Margin = new Padding(0);
|
panelPerformance.Margin = new Padding(0);
|
||||||
panelPerformance.Name = "panelPerformance";
|
panelPerformance.Name = "panelPerformance";
|
||||||
panelPerformance.Padding = new Padding(0, 0, 0, 12);
|
panelPerformance.Padding = new Padding(0, 0, 0, 12);
|
||||||
panelPerformance.Size = new Size(816, 200);
|
panelPerformance.Size = new Size(810, 200);
|
||||||
panelPerformance.TabIndex = 36;
|
panelPerformance.TabIndex = 36;
|
||||||
//
|
//
|
||||||
// picturePerf
|
// picturePerf
|
||||||
@@ -377,10 +393,11 @@ namespace GHelper
|
|||||||
// labelCPUFan
|
// labelCPUFan
|
||||||
//
|
//
|
||||||
labelCPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelCPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelCPUFan.Location = new Point(456, 16);
|
labelCPUFan.Cursor = Cursors.Hand;
|
||||||
|
labelCPUFan.Location = new Point(384, 15);
|
||||||
labelCPUFan.Margin = new Padding(8, 0, 8, 0);
|
labelCPUFan.Margin = new Padding(8, 0, 8, 0);
|
||||||
labelCPUFan.Name = "labelCPUFan";
|
labelCPUFan.Name = "labelCPUFan";
|
||||||
labelCPUFan.Size = new Size(336, 36);
|
labelCPUFan.Size = new Size(400, 36);
|
||||||
labelCPUFan.TabIndex = 30;
|
labelCPUFan.TabIndex = 30;
|
||||||
labelCPUFan.Text = " ";
|
labelCPUFan.Text = " ";
|
||||||
labelCPUFan.TextAlign = ContentAlignment.TopRight;
|
labelCPUFan.TextAlign = ContentAlignment.TopRight;
|
||||||
@@ -404,7 +421,7 @@ namespace GHelper
|
|||||||
tablePerf.Name = "tablePerf";
|
tablePerf.Name = "tablePerf";
|
||||||
tablePerf.RowCount = 1;
|
tablePerf.RowCount = 1;
|
||||||
tablePerf.RowStyles.Add(new RowStyle(SizeType.Absolute, 128F));
|
tablePerf.RowStyles.Add(new RowStyle(SizeType.Absolute, 128F));
|
||||||
tablePerf.Size = new Size(780, 128);
|
tablePerf.Size = new Size(772, 128);
|
||||||
tablePerf.TabIndex = 29;
|
tablePerf.TabIndex = 29;
|
||||||
//
|
//
|
||||||
// buttonSilent
|
// buttonSilent
|
||||||
@@ -413,6 +430,7 @@ namespace GHelper
|
|||||||
buttonSilent.BackColor = SystemColors.ControlLightLight;
|
buttonSilent.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonSilent.BackgroundImageLayout = ImageLayout.None;
|
buttonSilent.BackgroundImageLayout = ImageLayout.None;
|
||||||
buttonSilent.BorderColor = Color.Transparent;
|
buttonSilent.BorderColor = Color.Transparent;
|
||||||
|
buttonSilent.BorderRadius = 5;
|
||||||
buttonSilent.CausesValidation = false;
|
buttonSilent.CausesValidation = false;
|
||||||
buttonSilent.Dock = DockStyle.Fill;
|
buttonSilent.Dock = DockStyle.Fill;
|
||||||
buttonSilent.FlatAppearance.BorderSize = 0;
|
buttonSilent.FlatAppearance.BorderSize = 0;
|
||||||
@@ -423,7 +441,8 @@ namespace GHelper
|
|||||||
buttonSilent.Location = new Point(4, 4);
|
buttonSilent.Location = new Point(4, 4);
|
||||||
buttonSilent.Margin = new Padding(4);
|
buttonSilent.Margin = new Padding(4);
|
||||||
buttonSilent.Name = "buttonSilent";
|
buttonSilent.Name = "buttonSilent";
|
||||||
buttonSilent.Size = new Size(187, 120);
|
buttonSilent.Secondary = false;
|
||||||
|
buttonSilent.Size = new Size(185, 120);
|
||||||
buttonSilent.TabIndex = 0;
|
buttonSilent.TabIndex = 0;
|
||||||
buttonSilent.Text = "Silent";
|
buttonSilent.Text = "Silent";
|
||||||
buttonSilent.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonSilent.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -434,16 +453,18 @@ namespace GHelper
|
|||||||
buttonBalanced.Activated = false;
|
buttonBalanced.Activated = false;
|
||||||
buttonBalanced.BackColor = SystemColors.ControlLightLight;
|
buttonBalanced.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonBalanced.BorderColor = Color.Transparent;
|
buttonBalanced.BorderColor = Color.Transparent;
|
||||||
|
buttonBalanced.BorderRadius = 5;
|
||||||
buttonBalanced.Dock = DockStyle.Fill;
|
buttonBalanced.Dock = DockStyle.Fill;
|
||||||
buttonBalanced.FlatAppearance.BorderSize = 0;
|
buttonBalanced.FlatAppearance.BorderSize = 0;
|
||||||
buttonBalanced.FlatStyle = FlatStyle.Flat;
|
buttonBalanced.FlatStyle = FlatStyle.Flat;
|
||||||
buttonBalanced.ForeColor = SystemColors.ControlText;
|
buttonBalanced.ForeColor = SystemColors.ControlText;
|
||||||
buttonBalanced.Image = Properties.Resources.icons8_fiat_500_48;
|
buttonBalanced.Image = Properties.Resources.icons8_fiat_500_48;
|
||||||
buttonBalanced.ImageAlign = ContentAlignment.BottomCenter;
|
buttonBalanced.ImageAlign = ContentAlignment.BottomCenter;
|
||||||
buttonBalanced.Location = new Point(199, 4);
|
buttonBalanced.Location = new Point(197, 4);
|
||||||
buttonBalanced.Margin = new Padding(4);
|
buttonBalanced.Margin = new Padding(4);
|
||||||
buttonBalanced.Name = "buttonBalanced";
|
buttonBalanced.Name = "buttonBalanced";
|
||||||
buttonBalanced.Size = new Size(187, 120);
|
buttonBalanced.Secondary = false;
|
||||||
|
buttonBalanced.Size = new Size(185, 120);
|
||||||
buttonBalanced.TabIndex = 1;
|
buttonBalanced.TabIndex = 1;
|
||||||
buttonBalanced.Text = "Balanced";
|
buttonBalanced.Text = "Balanced";
|
||||||
buttonBalanced.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonBalanced.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -454,16 +475,18 @@ namespace GHelper
|
|||||||
buttonTurbo.Activated = false;
|
buttonTurbo.Activated = false;
|
||||||
buttonTurbo.BackColor = SystemColors.ControlLightLight;
|
buttonTurbo.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonTurbo.BorderColor = Color.Transparent;
|
buttonTurbo.BorderColor = Color.Transparent;
|
||||||
|
buttonTurbo.BorderRadius = 5;
|
||||||
buttonTurbo.Dock = DockStyle.Fill;
|
buttonTurbo.Dock = DockStyle.Fill;
|
||||||
buttonTurbo.FlatAppearance.BorderSize = 0;
|
buttonTurbo.FlatAppearance.BorderSize = 0;
|
||||||
buttonTurbo.FlatStyle = FlatStyle.Flat;
|
buttonTurbo.FlatStyle = FlatStyle.Flat;
|
||||||
buttonTurbo.ForeColor = SystemColors.ControlText;
|
buttonTurbo.ForeColor = SystemColors.ControlText;
|
||||||
buttonTurbo.Image = Properties.Resources.icons8_rocket_48;
|
buttonTurbo.Image = Properties.Resources.icons8_rocket_48;
|
||||||
buttonTurbo.ImageAlign = ContentAlignment.BottomCenter;
|
buttonTurbo.ImageAlign = ContentAlignment.BottomCenter;
|
||||||
buttonTurbo.Location = new Point(394, 4);
|
buttonTurbo.Location = new Point(390, 4);
|
||||||
buttonTurbo.Margin = new Padding(4);
|
buttonTurbo.Margin = new Padding(4);
|
||||||
buttonTurbo.Name = "buttonTurbo";
|
buttonTurbo.Name = "buttonTurbo";
|
||||||
buttonTurbo.Size = new Size(187, 120);
|
buttonTurbo.Secondary = false;
|
||||||
|
buttonTurbo.Size = new Size(185, 120);
|
||||||
buttonTurbo.TabIndex = 2;
|
buttonTurbo.TabIndex = 2;
|
||||||
buttonTurbo.Text = "Turbo";
|
buttonTurbo.Text = "Turbo";
|
||||||
buttonTurbo.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonTurbo.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -471,15 +494,20 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// buttonFans
|
// buttonFans
|
||||||
//
|
//
|
||||||
buttonFans.BackColor = SystemColors.ButtonFace;
|
buttonFans.Activated = false;
|
||||||
|
buttonFans.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonFans.BorderColor = Color.Transparent;
|
||||||
|
buttonFans.BorderRadius = 5;
|
||||||
buttonFans.Dock = DockStyle.Fill;
|
buttonFans.Dock = DockStyle.Fill;
|
||||||
buttonFans.FlatAppearance.BorderSize = 0;
|
buttonFans.FlatAppearance.BorderSize = 0;
|
||||||
|
buttonFans.FlatStyle = FlatStyle.Flat;
|
||||||
buttonFans.Image = Properties.Resources.icons8_fan_48;
|
buttonFans.Image = Properties.Resources.icons8_fan_48;
|
||||||
buttonFans.ImageAlign = ContentAlignment.BottomCenter;
|
buttonFans.ImageAlign = ContentAlignment.BottomCenter;
|
||||||
buttonFans.Location = new Point(589, 4);
|
buttonFans.Location = new Point(583, 4);
|
||||||
buttonFans.Margin = new Padding(4);
|
buttonFans.Margin = new Padding(4);
|
||||||
buttonFans.Name = "buttonFans";
|
buttonFans.Name = "buttonFans";
|
||||||
buttonFans.Size = new Size(187, 120);
|
buttonFans.Secondary = true;
|
||||||
|
buttonFans.Size = new Size(185, 120);
|
||||||
buttonFans.TabIndex = 35;
|
buttonFans.TabIndex = 35;
|
||||||
buttonFans.Text = "Fans + Power";
|
buttonFans.Text = "Fans + Power";
|
||||||
buttonFans.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonFans.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -499,7 +527,7 @@ namespace GHelper
|
|||||||
panelGPU.Margin = new Padding(8);
|
panelGPU.Margin = new Padding(8);
|
||||||
panelGPU.Name = "panelGPU";
|
panelGPU.Name = "panelGPU";
|
||||||
panelGPU.Padding = new Padding(0, 0, 0, 10);
|
panelGPU.Padding = new Padding(0, 0, 0, 10);
|
||||||
panelGPU.Size = new Size(816, 237);
|
panelGPU.Size = new Size(810, 237);
|
||||||
panelGPU.TabIndex = 37;
|
panelGPU.TabIndex = 37;
|
||||||
//
|
//
|
||||||
// labelTipGPU
|
// labelTipGPU
|
||||||
@@ -516,7 +544,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
pictureGPU.BackgroundImage = (Image)resources.GetObject("pictureGPU.BackgroundImage");
|
pictureGPU.BackgroundImage = (Image)resources.GetObject("pictureGPU.BackgroundImage");
|
||||||
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
|
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
pictureGPU.Location = new Point(24, 20);
|
pictureGPU.Location = new Point(24, 21);
|
||||||
pictureGPU.Margin = new Padding(4);
|
pictureGPU.Margin = new Padding(4);
|
||||||
pictureGPU.Name = "pictureGPU";
|
pictureGPU.Name = "pictureGPU";
|
||||||
pictureGPU.Size = new Size(32, 32);
|
pictureGPU.Size = new Size(32, 32);
|
||||||
@@ -527,7 +555,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
labelGPU.AutoSize = true;
|
labelGPU.AutoSize = true;
|
||||||
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelGPU.Location = new Point(60, 20);
|
labelGPU.Location = new Point(60, 21);
|
||||||
labelGPU.Margin = new Padding(8, 0, 8, 0);
|
labelGPU.Margin = new Padding(8, 0, 8, 0);
|
||||||
labelGPU.Name = "labelGPU";
|
labelGPU.Name = "labelGPU";
|
||||||
labelGPU.Size = new Size(136, 32);
|
labelGPU.Size = new Size(136, 32);
|
||||||
@@ -537,10 +565,10 @@ namespace GHelper
|
|||||||
// labelGPUFan
|
// labelGPUFan
|
||||||
//
|
//
|
||||||
labelGPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelGPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelGPUFan.Location = new Point(244, 12);
|
labelGPUFan.Location = new Point(384, 21);
|
||||||
labelGPUFan.Margin = new Padding(8, 0, 8, 0);
|
labelGPUFan.Margin = new Padding(8, 0, 8, 0);
|
||||||
labelGPUFan.Name = "labelGPUFan";
|
labelGPUFan.Name = "labelGPUFan";
|
||||||
labelGPUFan.Size = new Size(548, 44);
|
labelGPUFan.Size = new Size(400, 34);
|
||||||
labelGPUFan.TabIndex = 17;
|
labelGPUFan.TabIndex = 17;
|
||||||
labelGPUFan.Text = " ";
|
labelGPUFan.Text = " ";
|
||||||
labelGPUFan.TextAlign = ContentAlignment.TopRight;
|
labelGPUFan.TextAlign = ContentAlignment.TopRight;
|
||||||
@@ -564,7 +592,7 @@ namespace GHelper
|
|||||||
tableGPU.Name = "tableGPU";
|
tableGPU.Name = "tableGPU";
|
||||||
tableGPU.RowCount = 1;
|
tableGPU.RowCount = 1;
|
||||||
tableGPU.RowStyles.Add(new RowStyle(SizeType.Absolute, 128F));
|
tableGPU.RowStyles.Add(new RowStyle(SizeType.Absolute, 128F));
|
||||||
tableGPU.Size = new Size(780, 128);
|
tableGPU.Size = new Size(772, 128);
|
||||||
tableGPU.TabIndex = 16;
|
tableGPU.TabIndex = 16;
|
||||||
//
|
//
|
||||||
// buttonEco
|
// buttonEco
|
||||||
@@ -572,6 +600,7 @@ namespace GHelper
|
|||||||
buttonEco.Activated = false;
|
buttonEco.Activated = false;
|
||||||
buttonEco.BackColor = SystemColors.ControlLightLight;
|
buttonEco.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonEco.BorderColor = Color.Transparent;
|
buttonEco.BorderColor = Color.Transparent;
|
||||||
|
buttonEco.BorderRadius = 5;
|
||||||
buttonEco.CausesValidation = false;
|
buttonEco.CausesValidation = false;
|
||||||
buttonEco.Dock = DockStyle.Top;
|
buttonEco.Dock = DockStyle.Top;
|
||||||
buttonEco.FlatAppearance.BorderSize = 0;
|
buttonEco.FlatAppearance.BorderSize = 0;
|
||||||
@@ -582,7 +611,8 @@ namespace GHelper
|
|||||||
buttonEco.Location = new Point(4, 4);
|
buttonEco.Location = new Point(4, 4);
|
||||||
buttonEco.Margin = new Padding(4);
|
buttonEco.Margin = new Padding(4);
|
||||||
buttonEco.Name = "buttonEco";
|
buttonEco.Name = "buttonEco";
|
||||||
buttonEco.Size = new Size(187, 120);
|
buttonEco.Secondary = false;
|
||||||
|
buttonEco.Size = new Size(185, 120);
|
||||||
buttonEco.TabIndex = 0;
|
buttonEco.TabIndex = 0;
|
||||||
buttonEco.Text = "Eco";
|
buttonEco.Text = "Eco";
|
||||||
buttonEco.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonEco.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -593,16 +623,18 @@ namespace GHelper
|
|||||||
buttonStandard.Activated = false;
|
buttonStandard.Activated = false;
|
||||||
buttonStandard.BackColor = SystemColors.ControlLightLight;
|
buttonStandard.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonStandard.BorderColor = Color.Transparent;
|
buttonStandard.BorderColor = Color.Transparent;
|
||||||
|
buttonStandard.BorderRadius = 5;
|
||||||
buttonStandard.Dock = DockStyle.Top;
|
buttonStandard.Dock = DockStyle.Top;
|
||||||
buttonStandard.FlatAppearance.BorderSize = 0;
|
buttonStandard.FlatAppearance.BorderSize = 0;
|
||||||
buttonStandard.FlatStyle = FlatStyle.Flat;
|
buttonStandard.FlatStyle = FlatStyle.Flat;
|
||||||
buttonStandard.ForeColor = SystemColors.ControlText;
|
buttonStandard.ForeColor = SystemColors.ControlText;
|
||||||
buttonStandard.Image = Properties.Resources.icons8_spa_flower_48;
|
buttonStandard.Image = Properties.Resources.icons8_spa_flower_48;
|
||||||
buttonStandard.ImageAlign = ContentAlignment.BottomCenter;
|
buttonStandard.ImageAlign = ContentAlignment.BottomCenter;
|
||||||
buttonStandard.Location = new Point(199, 4);
|
buttonStandard.Location = new Point(197, 4);
|
||||||
buttonStandard.Margin = new Padding(4);
|
buttonStandard.Margin = new Padding(4);
|
||||||
buttonStandard.Name = "buttonStandard";
|
buttonStandard.Name = "buttonStandard";
|
||||||
buttonStandard.Size = new Size(187, 120);
|
buttonStandard.Secondary = false;
|
||||||
|
buttonStandard.Size = new Size(185, 120);
|
||||||
buttonStandard.TabIndex = 1;
|
buttonStandard.TabIndex = 1;
|
||||||
buttonStandard.Text = "Standard";
|
buttonStandard.Text = "Standard";
|
||||||
buttonStandard.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonStandard.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -613,16 +645,18 @@ namespace GHelper
|
|||||||
buttonOptimized.Activated = false;
|
buttonOptimized.Activated = false;
|
||||||
buttonOptimized.BackColor = SystemColors.ControlLightLight;
|
buttonOptimized.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonOptimized.BorderColor = Color.Transparent;
|
buttonOptimized.BorderColor = Color.Transparent;
|
||||||
|
buttonOptimized.BorderRadius = 5;
|
||||||
buttonOptimized.Dock = DockStyle.Top;
|
buttonOptimized.Dock = DockStyle.Top;
|
||||||
buttonOptimized.FlatAppearance.BorderSize = 0;
|
buttonOptimized.FlatAppearance.BorderSize = 0;
|
||||||
buttonOptimized.FlatStyle = FlatStyle.Flat;
|
buttonOptimized.FlatStyle = FlatStyle.Flat;
|
||||||
buttonOptimized.ForeColor = SystemColors.ControlText;
|
buttonOptimized.ForeColor = SystemColors.ControlText;
|
||||||
buttonOptimized.Image = Properties.Resources.icons8_project_management_48__1_;
|
buttonOptimized.Image = Properties.Resources.icons8_project_management_48__1_;
|
||||||
buttonOptimized.ImageAlign = ContentAlignment.BottomCenter;
|
buttonOptimized.ImageAlign = ContentAlignment.BottomCenter;
|
||||||
buttonOptimized.Location = new Point(589, 4);
|
buttonOptimized.Location = new Point(583, 4);
|
||||||
buttonOptimized.Margin = new Padding(4);
|
buttonOptimized.Margin = new Padding(4);
|
||||||
buttonOptimized.Name = "buttonOptimized";
|
buttonOptimized.Name = "buttonOptimized";
|
||||||
buttonOptimized.Size = new Size(187, 120);
|
buttonOptimized.Secondary = false;
|
||||||
|
buttonOptimized.Size = new Size(185, 120);
|
||||||
buttonOptimized.TabIndex = 3;
|
buttonOptimized.TabIndex = 3;
|
||||||
buttonOptimized.Text = "Optimized";
|
buttonOptimized.Text = "Optimized";
|
||||||
buttonOptimized.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonOptimized.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -633,16 +667,18 @@ namespace GHelper
|
|||||||
buttonUltimate.Activated = false;
|
buttonUltimate.Activated = false;
|
||||||
buttonUltimate.BackColor = SystemColors.ControlLightLight;
|
buttonUltimate.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonUltimate.BorderColor = Color.Transparent;
|
buttonUltimate.BorderColor = Color.Transparent;
|
||||||
|
buttonUltimate.BorderRadius = 5;
|
||||||
buttonUltimate.Dock = DockStyle.Top;
|
buttonUltimate.Dock = DockStyle.Top;
|
||||||
buttonUltimate.FlatAppearance.BorderSize = 0;
|
buttonUltimate.FlatAppearance.BorderSize = 0;
|
||||||
buttonUltimate.FlatStyle = FlatStyle.Flat;
|
buttonUltimate.FlatStyle = FlatStyle.Flat;
|
||||||
buttonUltimate.ForeColor = SystemColors.ControlText;
|
buttonUltimate.ForeColor = SystemColors.ControlText;
|
||||||
buttonUltimate.Image = Properties.Resources.icons8_game_controller_48;
|
buttonUltimate.Image = Properties.Resources.icons8_game_controller_48;
|
||||||
buttonUltimate.ImageAlign = ContentAlignment.BottomCenter;
|
buttonUltimate.ImageAlign = ContentAlignment.BottomCenter;
|
||||||
buttonUltimate.Location = new Point(394, 4);
|
buttonUltimate.Location = new Point(390, 4);
|
||||||
buttonUltimate.Margin = new Padding(4);
|
buttonUltimate.Margin = new Padding(4);
|
||||||
buttonUltimate.Name = "buttonUltimate";
|
buttonUltimate.Name = "buttonUltimate";
|
||||||
buttonUltimate.Size = new Size(187, 120);
|
buttonUltimate.Secondary = false;
|
||||||
|
buttonUltimate.Size = new Size(185, 120);
|
||||||
buttonUltimate.TabIndex = 2;
|
buttonUltimate.TabIndex = 2;
|
||||||
buttonUltimate.Text = "Ultimate";
|
buttonUltimate.Text = "Ultimate";
|
||||||
buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText;
|
buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText;
|
||||||
@@ -652,6 +688,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
panelScreen.AutoSize = true;
|
panelScreen.AutoSize = true;
|
||||||
panelScreen.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
panelScreen.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
|
panelScreen.Controls.Add(labelMidFan);
|
||||||
panelScreen.Controls.Add(labelTipScreen);
|
panelScreen.Controls.Add(labelTipScreen);
|
||||||
panelScreen.Controls.Add(tableScreen);
|
panelScreen.Controls.Add(tableScreen);
|
||||||
panelScreen.Controls.Add(pictureScreen);
|
panelScreen.Controls.Add(pictureScreen);
|
||||||
@@ -661,9 +698,20 @@ namespace GHelper
|
|||||||
panelScreen.Margin = new Padding(8);
|
panelScreen.Margin = new Padding(8);
|
||||||
panelScreen.Name = "panelScreen";
|
panelScreen.Name = "panelScreen";
|
||||||
panelScreen.Padding = new Padding(0, 0, 0, 10);
|
panelScreen.Padding = new Padding(0, 0, 0, 10);
|
||||||
panelScreen.Size = new Size(816, 181);
|
panelScreen.Size = new Size(810, 181);
|
||||||
panelScreen.TabIndex = 38;
|
panelScreen.TabIndex = 38;
|
||||||
//
|
//
|
||||||
|
// labelMidFan
|
||||||
|
//
|
||||||
|
labelMidFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
labelMidFan.Location = new Point(488, 13);
|
||||||
|
labelMidFan.Margin = new Padding(8, 0, 8, 0);
|
||||||
|
labelMidFan.Name = "labelMidFan";
|
||||||
|
labelMidFan.Size = new Size(296, 34);
|
||||||
|
labelMidFan.TabIndex = 25;
|
||||||
|
labelMidFan.Text = " ";
|
||||||
|
labelMidFan.TextAlign = ContentAlignment.TopRight;
|
||||||
|
//
|
||||||
// labelTipScreen
|
// labelTipScreen
|
||||||
//
|
//
|
||||||
labelTipScreen.ForeColor = SystemColors.GrayText;
|
labelTipScreen.ForeColor = SystemColors.GrayText;
|
||||||
@@ -686,12 +734,13 @@ namespace GHelper
|
|||||||
tableScreen.Controls.Add(buttonScreenAuto, 0, 0);
|
tableScreen.Controls.Add(buttonScreenAuto, 0, 0);
|
||||||
tableScreen.Controls.Add(button60Hz, 1, 0);
|
tableScreen.Controls.Add(button60Hz, 1, 0);
|
||||||
tableScreen.Controls.Add(button120Hz, 2, 0);
|
tableScreen.Controls.Add(button120Hz, 2, 0);
|
||||||
|
tableScreen.Controls.Add(buttonMiniled, 3, 0);
|
||||||
tableScreen.Location = new Point(16, 51);
|
tableScreen.Location = new Point(16, 51);
|
||||||
tableScreen.Margin = new Padding(8, 4, 8, 4);
|
tableScreen.Margin = new Padding(8, 4, 8, 4);
|
||||||
tableScreen.Name = "tableScreen";
|
tableScreen.Name = "tableScreen";
|
||||||
tableScreen.RowCount = 1;
|
tableScreen.RowCount = 1;
|
||||||
tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 80F));
|
tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 80F));
|
||||||
tableScreen.Size = new Size(780, 80);
|
tableScreen.Size = new Size(772, 80);
|
||||||
tableScreen.TabIndex = 23;
|
tableScreen.TabIndex = 23;
|
||||||
//
|
//
|
||||||
// buttonScreenAuto
|
// buttonScreenAuto
|
||||||
@@ -699,6 +748,7 @@ namespace GHelper
|
|||||||
buttonScreenAuto.Activated = false;
|
buttonScreenAuto.Activated = false;
|
||||||
buttonScreenAuto.BackColor = SystemColors.ControlLightLight;
|
buttonScreenAuto.BackColor = SystemColors.ControlLightLight;
|
||||||
buttonScreenAuto.BorderColor = Color.Transparent;
|
buttonScreenAuto.BorderColor = Color.Transparent;
|
||||||
|
buttonScreenAuto.BorderRadius = 5;
|
||||||
buttonScreenAuto.Dock = DockStyle.Fill;
|
buttonScreenAuto.Dock = DockStyle.Fill;
|
||||||
buttonScreenAuto.FlatAppearance.BorderSize = 0;
|
buttonScreenAuto.FlatAppearance.BorderSize = 0;
|
||||||
buttonScreenAuto.FlatStyle = FlatStyle.Flat;
|
buttonScreenAuto.FlatStyle = FlatStyle.Flat;
|
||||||
@@ -706,7 +756,8 @@ namespace GHelper
|
|||||||
buttonScreenAuto.Location = new Point(4, 4);
|
buttonScreenAuto.Location = new Point(4, 4);
|
||||||
buttonScreenAuto.Margin = new Padding(4);
|
buttonScreenAuto.Margin = new Padding(4);
|
||||||
buttonScreenAuto.Name = "buttonScreenAuto";
|
buttonScreenAuto.Name = "buttonScreenAuto";
|
||||||
buttonScreenAuto.Size = new Size(187, 72);
|
buttonScreenAuto.Secondary = false;
|
||||||
|
buttonScreenAuto.Size = new Size(185, 72);
|
||||||
buttonScreenAuto.TabIndex = 0;
|
buttonScreenAuto.TabIndex = 0;
|
||||||
buttonScreenAuto.Text = "Auto";
|
buttonScreenAuto.Text = "Auto";
|
||||||
buttonScreenAuto.UseVisualStyleBackColor = false;
|
buttonScreenAuto.UseVisualStyleBackColor = false;
|
||||||
@@ -716,15 +767,17 @@ namespace GHelper
|
|||||||
button60Hz.Activated = false;
|
button60Hz.Activated = false;
|
||||||
button60Hz.BackColor = SystemColors.ControlLightLight;
|
button60Hz.BackColor = SystemColors.ControlLightLight;
|
||||||
button60Hz.BorderColor = Color.Transparent;
|
button60Hz.BorderColor = Color.Transparent;
|
||||||
|
button60Hz.BorderRadius = 5;
|
||||||
button60Hz.CausesValidation = false;
|
button60Hz.CausesValidation = false;
|
||||||
button60Hz.Dock = DockStyle.Fill;
|
button60Hz.Dock = DockStyle.Fill;
|
||||||
button60Hz.FlatAppearance.BorderSize = 0;
|
button60Hz.FlatAppearance.BorderSize = 0;
|
||||||
button60Hz.FlatStyle = FlatStyle.Flat;
|
button60Hz.FlatStyle = FlatStyle.Flat;
|
||||||
button60Hz.ForeColor = SystemColors.ControlText;
|
button60Hz.ForeColor = SystemColors.ControlText;
|
||||||
button60Hz.Location = new Point(199, 4);
|
button60Hz.Location = new Point(197, 4);
|
||||||
button60Hz.Margin = new Padding(4);
|
button60Hz.Margin = new Padding(4);
|
||||||
button60Hz.Name = "button60Hz";
|
button60Hz.Name = "button60Hz";
|
||||||
button60Hz.Size = new Size(187, 72);
|
button60Hz.Secondary = false;
|
||||||
|
button60Hz.Size = new Size(185, 72);
|
||||||
button60Hz.TabIndex = 1;
|
button60Hz.TabIndex = 1;
|
||||||
button60Hz.Text = "60Hz";
|
button60Hz.Text = "60Hz";
|
||||||
button60Hz.UseVisualStyleBackColor = false;
|
button60Hz.UseVisualStyleBackColor = false;
|
||||||
@@ -734,18 +787,40 @@ namespace GHelper
|
|||||||
button120Hz.Activated = false;
|
button120Hz.Activated = false;
|
||||||
button120Hz.BackColor = SystemColors.ControlLightLight;
|
button120Hz.BackColor = SystemColors.ControlLightLight;
|
||||||
button120Hz.BorderColor = Color.Transparent;
|
button120Hz.BorderColor = Color.Transparent;
|
||||||
|
button120Hz.BorderRadius = 5;
|
||||||
button120Hz.Dock = DockStyle.Fill;
|
button120Hz.Dock = DockStyle.Fill;
|
||||||
button120Hz.FlatAppearance.BorderSize = 0;
|
button120Hz.FlatAppearance.BorderSize = 0;
|
||||||
button120Hz.FlatStyle = FlatStyle.Flat;
|
button120Hz.FlatStyle = FlatStyle.Flat;
|
||||||
button120Hz.ForeColor = SystemColors.ControlText;
|
button120Hz.ForeColor = SystemColors.ControlText;
|
||||||
button120Hz.Location = new Point(394, 4);
|
button120Hz.Location = new Point(390, 4);
|
||||||
button120Hz.Margin = new Padding(4);
|
button120Hz.Margin = new Padding(4);
|
||||||
button120Hz.Name = "button120Hz";
|
button120Hz.Name = "button120Hz";
|
||||||
button120Hz.Size = new Size(187, 72);
|
button120Hz.Secondary = false;
|
||||||
|
button120Hz.Size = new Size(185, 72);
|
||||||
button120Hz.TabIndex = 2;
|
button120Hz.TabIndex = 2;
|
||||||
button120Hz.Text = "120Hz + OD";
|
button120Hz.Text = "120Hz + OD";
|
||||||
button120Hz.UseVisualStyleBackColor = false;
|
button120Hz.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
|
// buttonMiniled
|
||||||
|
//
|
||||||
|
buttonMiniled.Activated = false;
|
||||||
|
buttonMiniled.BackColor = SystemColors.ControlLightLight;
|
||||||
|
buttonMiniled.BorderColor = Color.Transparent;
|
||||||
|
buttonMiniled.BorderRadius = 5;
|
||||||
|
buttonMiniled.CausesValidation = false;
|
||||||
|
buttonMiniled.Dock = DockStyle.Fill;
|
||||||
|
buttonMiniled.FlatAppearance.BorderSize = 0;
|
||||||
|
buttonMiniled.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonMiniled.ForeColor = SystemColors.ControlText;
|
||||||
|
buttonMiniled.Location = new Point(583, 4);
|
||||||
|
buttonMiniled.Margin = new Padding(4);
|
||||||
|
buttonMiniled.Name = "buttonMiniled";
|
||||||
|
buttonMiniled.Secondary = false;
|
||||||
|
buttonMiniled.Size = new Size(185, 72);
|
||||||
|
buttonMiniled.TabIndex = 3;
|
||||||
|
buttonMiniled.Text = "Miniled";
|
||||||
|
buttonMiniled.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
// pictureScreen
|
// pictureScreen
|
||||||
//
|
//
|
||||||
pictureScreen.BackgroundImage = (Image)resources.GetObject("pictureScreen.BackgroundImage");
|
pictureScreen.BackgroundImage = (Image)resources.GetObject("pictureScreen.BackgroundImage");
|
||||||
@@ -780,7 +855,7 @@ namespace GHelper
|
|||||||
panelKeyboard.Margin = new Padding(8);
|
panelKeyboard.Margin = new Padding(8);
|
||||||
panelKeyboard.Name = "panelKeyboard";
|
panelKeyboard.Name = "panelKeyboard";
|
||||||
panelKeyboard.Padding = new Padding(0, 0, 0, 12);
|
panelKeyboard.Padding = new Padding(0, 0, 0, 12);
|
||||||
panelKeyboard.Size = new Size(816, 130);
|
panelKeyboard.Size = new Size(810, 130);
|
||||||
panelKeyboard.TabIndex = 39;
|
panelKeyboard.TabIndex = 39;
|
||||||
//
|
//
|
||||||
// tableLayoutKeyboard
|
// tableLayoutKeyboard
|
||||||
@@ -801,25 +876,33 @@ namespace GHelper
|
|||||||
tableLayoutKeyboard.Name = "tableLayoutKeyboard";
|
tableLayoutKeyboard.Name = "tableLayoutKeyboard";
|
||||||
tableLayoutKeyboard.RowCount = 1;
|
tableLayoutKeyboard.RowCount = 1;
|
||||||
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||||
tableLayoutKeyboard.Size = new Size(780, 60);
|
tableLayoutKeyboard.Size = new Size(772, 60);
|
||||||
tableLayoutKeyboard.TabIndex = 39;
|
tableLayoutKeyboard.TabIndex = 39;
|
||||||
//
|
//
|
||||||
// buttonKeyboard
|
// buttonKeyboard
|
||||||
//
|
//
|
||||||
buttonKeyboard.BackColor = SystemColors.ButtonFace;
|
buttonKeyboard.Activated = false;
|
||||||
|
buttonKeyboard.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonKeyboard.BorderColor = Color.Transparent;
|
||||||
|
buttonKeyboard.BorderRadius = 2;
|
||||||
buttonKeyboard.Dock = DockStyle.Top;
|
buttonKeyboard.Dock = DockStyle.Top;
|
||||||
buttonKeyboard.FlatAppearance.BorderSize = 0;
|
buttonKeyboard.FlatAppearance.BorderSize = 0;
|
||||||
buttonKeyboard.Location = new Point(394, 8);
|
buttonKeyboard.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonKeyboard.Location = new Point(390, 8);
|
||||||
buttonKeyboard.Margin = new Padding(4, 8, 4, 8);
|
buttonKeyboard.Margin = new Padding(4, 8, 4, 8);
|
||||||
buttonKeyboard.Name = "buttonKeyboard";
|
buttonKeyboard.Name = "buttonKeyboard";
|
||||||
buttonKeyboard.Size = new Size(187, 44);
|
buttonKeyboard.Secondary = true;
|
||||||
|
buttonKeyboard.Size = new Size(185, 44);
|
||||||
buttonKeyboard.TabIndex = 37;
|
buttonKeyboard.TabIndex = 37;
|
||||||
buttonKeyboard.Text = "Extra";
|
buttonKeyboard.Text = "Extra";
|
||||||
buttonKeyboard.UseVisualStyleBackColor = false;
|
buttonKeyboard.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
// comboKeyboard
|
// comboKeyboard
|
||||||
//
|
//
|
||||||
|
comboKeyboard.BorderColor = Color.White;
|
||||||
|
comboKeyboard.ButtonColor = SystemColors.ControlLight;
|
||||||
comboKeyboard.Dock = DockStyle.Top;
|
comboKeyboard.Dock = DockStyle.Top;
|
||||||
|
comboKeyboard.FlatStyle = FlatStyle.Flat;
|
||||||
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
comboKeyboard.FormattingEnabled = true;
|
comboKeyboard.FormattingEnabled = true;
|
||||||
comboKeyboard.ItemHeight = 32;
|
comboKeyboard.ItemHeight = 32;
|
||||||
@@ -827,7 +910,7 @@ namespace GHelper
|
|||||||
comboKeyboard.Location = new Point(4, 10);
|
comboKeyboard.Location = new Point(4, 10);
|
||||||
comboKeyboard.Margin = new Padding(4, 10, 4, 8);
|
comboKeyboard.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboKeyboard.Name = "comboKeyboard";
|
comboKeyboard.Name = "comboKeyboard";
|
||||||
comboKeyboard.Size = new Size(187, 40);
|
comboKeyboard.Size = new Size(185, 40);
|
||||||
comboKeyboard.TabIndex = 35;
|
comboKeyboard.TabIndex = 35;
|
||||||
comboKeyboard.TabStop = false;
|
comboKeyboard.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -838,16 +921,16 @@ namespace GHelper
|
|||||||
panelColor.Controls.Add(pictureColor);
|
panelColor.Controls.Add(pictureColor);
|
||||||
panelColor.Controls.Add(buttonKeyboardColor);
|
panelColor.Controls.Add(buttonKeyboardColor);
|
||||||
panelColor.Dock = DockStyle.Fill;
|
panelColor.Dock = DockStyle.Fill;
|
||||||
panelColor.Location = new Point(199, 8);
|
panelColor.Location = new Point(197, 8);
|
||||||
panelColor.Margin = new Padding(4, 8, 4, 8);
|
panelColor.Margin = new Padding(4, 8, 4, 8);
|
||||||
panelColor.Name = "panelColor";
|
panelColor.Name = "panelColor";
|
||||||
panelColor.Size = new Size(187, 44);
|
panelColor.Size = new Size(185, 44);
|
||||||
panelColor.TabIndex = 36;
|
panelColor.TabIndex = 36;
|
||||||
//
|
//
|
||||||
// pictureColor2
|
// pictureColor2
|
||||||
//
|
//
|
||||||
pictureColor2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
pictureColor2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
pictureColor2.Location = new Point(125, 12);
|
pictureColor2.Location = new Point(123, 12);
|
||||||
pictureColor2.Margin = new Padding(8);
|
pictureColor2.Margin = new Padding(8);
|
||||||
pictureColor2.Name = "pictureColor2";
|
pictureColor2.Name = "pictureColor2";
|
||||||
pictureColor2.Size = new Size(20, 20);
|
pictureColor2.Size = new Size(20, 20);
|
||||||
@@ -857,7 +940,7 @@ namespace GHelper
|
|||||||
// pictureColor
|
// pictureColor
|
||||||
//
|
//
|
||||||
pictureColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
pictureColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
pictureColor.Location = new Point(153, 12);
|
pictureColor.Location = new Point(151, 12);
|
||||||
pictureColor.Margin = new Padding(8);
|
pictureColor.Margin = new Padding(8);
|
||||||
pictureColor.Name = "pictureColor";
|
pictureColor.Name = "pictureColor";
|
||||||
pictureColor.Size = new Size(20, 20);
|
pictureColor.Size = new Size(20, 20);
|
||||||
@@ -866,15 +949,18 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// buttonKeyboardColor
|
// buttonKeyboardColor
|
||||||
//
|
//
|
||||||
|
buttonKeyboardColor.Activated = false;
|
||||||
buttonKeyboardColor.BackColor = SystemColors.ButtonHighlight;
|
buttonKeyboardColor.BackColor = SystemColors.ButtonHighlight;
|
||||||
|
buttonKeyboardColor.BorderColor = Color.Transparent;
|
||||||
|
buttonKeyboardColor.BorderRadius = 2;
|
||||||
buttonKeyboardColor.Dock = DockStyle.Top;
|
buttonKeyboardColor.Dock = DockStyle.Top;
|
||||||
buttonKeyboardColor.FlatAppearance.BorderColor = Color.Red;
|
buttonKeyboardColor.FlatStyle = FlatStyle.Flat;
|
||||||
buttonKeyboardColor.FlatAppearance.BorderSize = 2;
|
|
||||||
buttonKeyboardColor.ForeColor = SystemColors.ControlText;
|
buttonKeyboardColor.ForeColor = SystemColors.ControlText;
|
||||||
buttonKeyboardColor.Location = new Point(0, 0);
|
buttonKeyboardColor.Location = new Point(0, 0);
|
||||||
buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8);
|
buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8);
|
||||||
buttonKeyboardColor.Name = "buttonKeyboardColor";
|
buttonKeyboardColor.Name = "buttonKeyboardColor";
|
||||||
buttonKeyboardColor.Size = new Size(187, 44);
|
buttonKeyboardColor.Secondary = false;
|
||||||
|
buttonKeyboardColor.Size = new Size(185, 44);
|
||||||
buttonKeyboardColor.TabIndex = 39;
|
buttonKeyboardColor.TabIndex = 39;
|
||||||
buttonKeyboardColor.Text = "Color ";
|
buttonKeyboardColor.Text = "Color ";
|
||||||
buttonKeyboardColor.UseVisualStyleBackColor = false;
|
buttonKeyboardColor.UseVisualStyleBackColor = false;
|
||||||
@@ -971,49 +1057,51 @@ namespace GHelper
|
|||||||
private Label labelBatteryTitle;
|
private Label labelBatteryTitle;
|
||||||
private TrackBar trackBattery;
|
private TrackBar trackBattery;
|
||||||
private Panel panelFooter;
|
private Panel panelFooter;
|
||||||
private Button buttonQuit;
|
private RButton buttonQuit;
|
||||||
private CheckBox checkStartup;
|
private CheckBox checkStartup;
|
||||||
private Panel panelPerformance;
|
private Panel panelPerformance;
|
||||||
private PictureBox picturePerf;
|
private PictureBox picturePerf;
|
||||||
private Label labelPerf;
|
private Label labelPerf;
|
||||||
private Label labelCPUFan;
|
private Label labelCPUFan;
|
||||||
private TableLayoutPanel tablePerf;
|
private TableLayoutPanel tablePerf;
|
||||||
private RoundedButton buttonTurbo;
|
private RButton buttonTurbo;
|
||||||
private RoundedButton buttonBalanced;
|
private RButton buttonBalanced;
|
||||||
private RoundedButton buttonSilent;
|
private RButton buttonSilent;
|
||||||
private Panel panelGPU;
|
private Panel panelGPU;
|
||||||
private PictureBox pictureGPU;
|
private PictureBox pictureGPU;
|
||||||
private Label labelGPU;
|
private Label labelGPU;
|
||||||
private Label labelGPUFan;
|
private Label labelGPUFan;
|
||||||
private TableLayoutPanel tableGPU;
|
private TableLayoutPanel tableGPU;
|
||||||
private RoundedButton buttonUltimate;
|
private RButton buttonUltimate;
|
||||||
private RoundedButton buttonStandard;
|
private RButton buttonStandard;
|
||||||
private RoundedButton buttonEco;
|
private RButton buttonEco;
|
||||||
private Panel panelScreen;
|
private Panel panelScreen;
|
||||||
private TableLayoutPanel tableScreen;
|
private TableLayoutPanel tableScreen;
|
||||||
private RoundedButton buttonScreenAuto;
|
private RButton buttonScreenAuto;
|
||||||
private RoundedButton button60Hz;
|
private RButton button60Hz;
|
||||||
private PictureBox pictureScreen;
|
private PictureBox pictureScreen;
|
||||||
private Label labelSreen;
|
private Label labelSreen;
|
||||||
private Panel panelKeyboard;
|
private Panel panelKeyboard;
|
||||||
private PictureBox pictureKeyboard;
|
private PictureBox pictureKeyboard;
|
||||||
private Label labelKeyboard;
|
private Label labelKeyboard;
|
||||||
private TableLayoutPanel tableLayoutMatrix;
|
private TableLayoutPanel tableLayoutMatrix;
|
||||||
private Button buttonMatrix;
|
private RComboBox comboMatrixRunning;
|
||||||
private ComboBox comboMatrixRunning;
|
private RComboBox comboMatrix;
|
||||||
private ComboBox comboMatrix;
|
|
||||||
private TableLayoutPanel tableLayoutKeyboard;
|
private TableLayoutPanel tableLayoutKeyboard;
|
||||||
private Button buttonKeyboard;
|
private RComboBox comboKeyboard;
|
||||||
private ComboBox comboKeyboard;
|
|
||||||
private Panel panelColor;
|
private Panel panelColor;
|
||||||
private PictureBox pictureColor2;
|
private PictureBox pictureColor2;
|
||||||
private PictureBox pictureColor;
|
private PictureBox pictureColor;
|
||||||
private Button buttonKeyboardColor;
|
|
||||||
private CheckBox checkMatrix;
|
private CheckBox checkMatrix;
|
||||||
private RoundedButton button120Hz;
|
private RButton button120Hz;
|
||||||
private Button buttonFans;
|
private RButton buttonOptimized;
|
||||||
private RoundedButton buttonOptimized;
|
|
||||||
private Label labelTipGPU;
|
private Label labelTipGPU;
|
||||||
private Label labelTipScreen;
|
private Label labelTipScreen;
|
||||||
|
private RButton buttonMiniled;
|
||||||
|
private RButton buttonMatrix;
|
||||||
|
private RButton buttonKeyboard;
|
||||||
|
private RButton buttonKeyboardColor;
|
||||||
|
private RButton buttonFans;
|
||||||
|
private Label labelMidFan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
206
app/Settings.cs
206
app/Settings.cs
@@ -1,4 +1,5 @@
|
|||||||
using Starlight.AnimeMatrix;
|
using CustomControls;
|
||||||
|
using Starlight.AnimeMatrix;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
@@ -6,30 +7,28 @@ using System.Timers;
|
|||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
public partial class SettingsForm : Form
|
public partial class SettingsForm : RForm
|
||||||
{
|
{
|
||||||
|
|
||||||
static Color colorEco = Color.FromArgb(255, 6, 180, 138);
|
public static System.Timers.Timer aTimer = default!;
|
||||||
static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
|
public static Point trayPoint;
|
||||||
static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
|
|
||||||
|
|
||||||
static System.Timers.Timer aTimer = default!;
|
|
||||||
static System.Timers.Timer matrixTimer = default!;
|
static System.Timers.Timer matrixTimer = default!;
|
||||||
|
|
||||||
public string versionUrl = "http://github.com/seerge/g-helper/releases";
|
public string versionUrl = "http://github.com/seerge/g-helper/releases";
|
||||||
|
|
||||||
public string perfName = "Balanced";
|
public string perfName = "Balanced";
|
||||||
|
|
||||||
Fans fans;
|
public Fans fans;
|
||||||
Keyboard keyb;
|
public Keyboard keyb;
|
||||||
|
|
||||||
static AnimeMatrixDevice mat;
|
static AnimeMatrixDevice mat;
|
||||||
|
static long lastTip;
|
||||||
|
|
||||||
public SettingsForm()
|
public SettingsForm()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InitTheme();
|
||||||
HighDpiHelper.AdjustControlImagesDpiScale(this, 2);
|
|
||||||
|
|
||||||
FormClosing += SettingsForm_FormClosing;
|
FormClosing += SettingsForm_FormClosing;
|
||||||
|
|
||||||
@@ -45,6 +44,7 @@ namespace GHelper
|
|||||||
button60Hz.BorderColor = SystemColors.ActiveBorder;
|
button60Hz.BorderColor = SystemColors.ActiveBorder;
|
||||||
button120Hz.BorderColor = SystemColors.ActiveBorder;
|
button120Hz.BorderColor = SystemColors.ActiveBorder;
|
||||||
buttonScreenAuto.BorderColor = SystemColors.ActiveBorder;
|
buttonScreenAuto.BorderColor = SystemColors.ActiveBorder;
|
||||||
|
buttonMiniled.BorderColor = colorTurbo;
|
||||||
|
|
||||||
buttonOptimized.Click += ButtonOptimized_Click;
|
buttonOptimized.Click += ButtonOptimized_Click;
|
||||||
buttonSilent.Click += ButtonSilent_Click;
|
buttonSilent.Click += ButtonSilent_Click;
|
||||||
@@ -62,6 +62,7 @@ namespace GHelper
|
|||||||
button60Hz.Click += Button60Hz_Click;
|
button60Hz.Click += Button60Hz_Click;
|
||||||
button120Hz.Click += Button120Hz_Click;
|
button120Hz.Click += Button120Hz_Click;
|
||||||
buttonScreenAuto.Click += ButtonScreenAuto_Click;
|
buttonScreenAuto.Click += ButtonScreenAuto_Click;
|
||||||
|
buttonMiniled.Click += ButtonMiniled_Click;
|
||||||
|
|
||||||
buttonQuit.Click += ButtonQuit_Click;
|
buttonQuit.Click += ButtonQuit_Click;
|
||||||
|
|
||||||
@@ -93,6 +94,7 @@ namespace GHelper
|
|||||||
checkStartup.CheckedChanged += CheckStartup_CheckedChanged;
|
checkStartup.CheckedChanged += CheckStartup_CheckedChanged;
|
||||||
|
|
||||||
labelVersion.Click += LabelVersion_Click;
|
labelVersion.Click += LabelVersion_Click;
|
||||||
|
labelVersion.ForeColor = Color.FromArgb(128, Color.Gray);
|
||||||
|
|
||||||
buttonOptimized.MouseMove += ButtonOptimized_MouseHover;
|
buttonOptimized.MouseMove += ButtonOptimized_MouseHover;
|
||||||
buttonOptimized.MouseLeave += ButtonGPU_MouseLeave;
|
buttonOptimized.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
@@ -115,12 +117,30 @@ namespace GHelper
|
|||||||
button120Hz.MouseMove += Button120Hz_MouseHover;
|
button120Hz.MouseMove += Button120Hz_MouseHover;
|
||||||
button120Hz.MouseLeave += ButtonScreen_MouseLeave;
|
button120Hz.MouseLeave += ButtonScreen_MouseLeave;
|
||||||
|
|
||||||
|
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
|
||||||
|
|
||||||
//buttonStandard.Image = (Image)(new Bitmap(buttonStandard.Image, new Size(16, 16)));
|
//buttonStandard.Image = (Image)(new Bitmap(buttonStandard.Image, new Size(16, 16)));
|
||||||
|
|
||||||
SetTimer();
|
aTimer = new System.Timers.Timer(500);
|
||||||
|
aTimer.Elapsed += OnTimedEvent;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void TrayIcon_MouseMove(object? sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTip) < 2000) return;
|
||||||
|
lastTip = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
RefreshSensors();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
||||||
|
{
|
||||||
|
aTimer.Interval = 2000;
|
||||||
|
if (Program.settingsForm.Visible)
|
||||||
|
RefreshSensors();
|
||||||
|
}
|
||||||
|
|
||||||
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
labelTipScreen.Text = "Max refresh rate + screen overdrive for lower latency";
|
labelTipScreen.Text = "Max refresh rate + screen overdrive for lower latency";
|
||||||
@@ -252,8 +272,9 @@ namespace GHelper
|
|||||||
Program.config.setConfig("matrix_auto", check.Checked ? 1 : 0);
|
Program.config.setConfig("matrix_auto", check.Checked ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void StartMatrixTimer()
|
private static void StartMatrixTimer(int interval = 100)
|
||||||
{
|
{
|
||||||
|
matrixTimer.Interval = interval;
|
||||||
matrixTimer.Enabled = true;
|
matrixTimer.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,14 +286,23 @@ namespace GHelper
|
|||||||
private static void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e)
|
private static void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
if (mat is null) return;
|
if (mat is null) return;
|
||||||
mat.PresentNextFrame();
|
|
||||||
|
switch (Program.config.getConfig("matrix_running"))
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
mat.PresentNextFrame();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
mat.PresentText(DateTime.Now.ToString("H:mm:ss"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMatrixPicture(string fileName)
|
void SetMatrixPicture(string fileName)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (mat is null) return;
|
if (mat is null) return;
|
||||||
|
|
||||||
StopMatrixTimer();
|
StopMatrixTimer();
|
||||||
|
|
||||||
Image image;
|
Image image;
|
||||||
@@ -315,8 +345,6 @@ namespace GHelper
|
|||||||
mat.GenerateFrame(image);
|
mat.GenerateFrame(image);
|
||||||
mat.Present();
|
mat.Present();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -342,6 +370,8 @@ namespace GHelper
|
|||||||
if (fileName is not null)
|
if (fileName is not null)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("matrix_picture", fileName);
|
Program.config.setConfig("matrix_picture", fileName);
|
||||||
|
Program.config.setConfig("matrix_running", 2);
|
||||||
|
|
||||||
SetMatrixPicture(fileName);
|
SetMatrixPicture(fileName);
|
||||||
BeginInvoke(delegate
|
BeginInvoke(delegate
|
||||||
{
|
{
|
||||||
@@ -397,16 +427,22 @@ namespace GHelper
|
|||||||
mat.SetDisplayState(true);
|
mat.SetDisplayState(true);
|
||||||
mat.SetBrightness((BrightnessMode)brightness);
|
mat.SetBrightness((BrightnessMode)brightness);
|
||||||
|
|
||||||
if (running == 2)
|
switch (running)
|
||||||
{
|
{
|
||||||
string fileName = Program.config.getConfigString("matrix_picture");
|
case 2:
|
||||||
SetMatrixPicture(fileName);
|
SetMatrixPicture(Program.config.getConfigString("matrix_picture"));
|
||||||
}
|
break;
|
||||||
else
|
case 3:
|
||||||
{
|
mat.SetBuiltInAnimation(false);
|
||||||
mat.SetBuiltInAnimation(true, animation);
|
StartMatrixTimer(1000);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mat.SetBuiltInAnimation(true, animation);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//mat.SetBrightness((BrightnessMode)brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -532,8 +568,8 @@ namespace GHelper
|
|||||||
int brightness = Program.config.getConfig("matrix_brightness");
|
int brightness = Program.config.getConfig("matrix_brightness");
|
||||||
int running = Program.config.getConfig("matrix_running");
|
int running = Program.config.getConfig("matrix_running");
|
||||||
|
|
||||||
comboMatrix.SelectedIndex = (brightness != -1) ? brightness : 0;
|
comboMatrix.SelectedIndex = (brightness != -1) ? Math.Min(brightness, comboMatrix.Items.Count - 1) : 0;
|
||||||
comboMatrixRunning.SelectedIndex = (running != -1) ? running : 0;
|
comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0;
|
||||||
|
|
||||||
checkMatrix.Checked = (Program.config.getConfig("matrix_auto") == 1);
|
checkMatrix.Checked = (Program.config.getConfig("matrix_auto") == 1);
|
||||||
|
|
||||||
@@ -614,13 +650,17 @@ namespace GHelper
|
|||||||
SetScreen(60, 0);
|
SetScreen(60, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonMiniled_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int miniled = (Program.config.getConfig("miniled") == 1) ? 0 : 1;
|
||||||
|
Program.config.setConfig("miniled", miniled);
|
||||||
|
SetScreen(-1, -1, miniled);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetScreen(int frequency = -1, int overdrive = -1)
|
public void SetScreen(int frequency = -1, int overdrive = -1, int miniled = -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
int currentFrequency = NativeMethods.GetRefreshRate();
|
if (NativeMethods.GetRefreshRate() < 0) // Laptop screen not detected or has unknown refresh rate
|
||||||
|
|
||||||
if (currentFrequency < 0) // Laptop screen not detected or has unknown refresh rate
|
|
||||||
{
|
{
|
||||||
InitScreen();
|
InitScreen();
|
||||||
return;
|
return;
|
||||||
@@ -629,19 +669,25 @@ namespace GHelper
|
|||||||
if (frequency >= 1000)
|
if (frequency >= 1000)
|
||||||
{
|
{
|
||||||
frequency = Program.config.getConfig("max_frequency");
|
frequency = Program.config.getConfig("max_frequency");
|
||||||
if (frequency <= 60)
|
if (frequency <= 60) frequency = 120;
|
||||||
frequency = 120;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frequency <= 0) return;
|
if (frequency > 0)
|
||||||
|
{
|
||||||
|
NativeMethods.SetRefreshRate(frequency);
|
||||||
|
Logger.WriteLine("Screen " + frequency.ToString() + "Hz");
|
||||||
|
}
|
||||||
|
|
||||||
NativeMethods.SetRefreshRate(frequency);
|
|
||||||
if (overdrive >= 0)
|
if (overdrive >= 0)
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
|
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
|
||||||
|
|
||||||
InitScreen();
|
if (miniled >= 0)
|
||||||
|
{
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled);
|
||||||
|
Debug.WriteLine("Miniled " + miniled);
|
||||||
|
}
|
||||||
|
|
||||||
Logger.WriteLine("Screen " + frequency.ToString() + "Hz");
|
InitScreen();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -653,37 +699,19 @@ namespace GHelper
|
|||||||
|
|
||||||
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
||||||
|
|
||||||
int overdrive = 0;
|
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
||||||
try
|
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
||||||
{
|
|
||||||
overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Logger.WriteLine("Screen Overdrive not supported");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frequency < 0)
|
bool screenEnabled = (frequency >= 0);
|
||||||
{
|
|
||||||
button60Hz.Enabled = false;
|
|
||||||
button120Hz.Enabled = false;
|
|
||||||
buttonScreenAuto.Enabled = false;
|
|
||||||
labelSreen.Text = "Laptop Screen: Turned off";
|
|
||||||
button60Hz.BackColor = SystemColors.ControlLight;
|
|
||||||
button120Hz.BackColor = SystemColors.ControlLight;
|
|
||||||
buttonScreenAuto.BackColor = SystemColors.ControlLight;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
button60Hz.Enabled = true;
|
|
||||||
button120Hz.Enabled = true;
|
|
||||||
buttonScreenAuto.Enabled = true;
|
|
||||||
button60Hz.BackColor = SystemColors.ControlLightLight;
|
|
||||||
button120Hz.BackColor = SystemColors.ControlLightLight;
|
|
||||||
buttonScreenAuto.BackColor = SystemColors.ControlLightLight;
|
|
||||||
labelSreen.Text = "Laptop Screen: " + frequency + "Hz" + ((overdrive == 1) ? " + Overdrive" : "");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ButtonEnabled(button60Hz, screenEnabled);
|
||||||
|
ButtonEnabled(button120Hz, screenEnabled);
|
||||||
|
ButtonEnabled(buttonScreenAuto, screenEnabled);
|
||||||
|
ButtonEnabled(buttonMiniled, screenEnabled);
|
||||||
|
|
||||||
|
labelSreen.Text = screenEnabled
|
||||||
|
? "Laptop Screen: " + frequency + "Hz" + ((overdrive == 1) ? " + Overdrive" : "")
|
||||||
|
: "Laptop Screen: Turned off";
|
||||||
|
|
||||||
button60Hz.Activated = false;
|
button60Hz.Activated = false;
|
||||||
button120Hz.Activated = false;
|
button120Hz.Activated = false;
|
||||||
@@ -711,6 +739,16 @@ namespace GHelper
|
|||||||
button120Hz.Text = maxFrequency.ToString() + "Hz + OD";
|
button120Hz.Text = maxFrequency.ToString() + "Hz + OD";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (miniled >= 0)
|
||||||
|
{
|
||||||
|
buttonMiniled.Activated = (miniled == 1);
|
||||||
|
Program.config.setConfig("miniled", miniled);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buttonMiniled.Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
Program.config.setConfig("frequency", frequency);
|
Program.config.setConfig("frequency", frequency);
|
||||||
Program.config.setConfig("overdrive", overdrive);
|
Program.config.setConfig("overdrive", overdrive);
|
||||||
}
|
}
|
||||||
@@ -746,17 +784,11 @@ namespace GHelper
|
|||||||
SetGPUMode(ASUSWmi.GPUModeEco);
|
SetGPUMode(ASUSWmi.GPUModeEco);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetTimer()
|
|
||||||
{
|
|
||||||
aTimer = new System.Timers.Timer(500);
|
|
||||||
aTimer.Elapsed += OnTimedEvent;
|
|
||||||
aTimer.AutoReset = true;
|
|
||||||
aTimer.Enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static string FormatFan(int fan)
|
private static string FormatFan(int fan)
|
||||||
{
|
{
|
||||||
|
if (fan < 0) return null;
|
||||||
|
|
||||||
if (Program.config.getConfig("fan_rpm") == 1)
|
if (Program.config.getConfig("fan_rpm") == 1)
|
||||||
return " Fan: " + (fan * 100).ToString() + "RPM";
|
return " Fan: " + (fan * 100).ToString() + "RPM";
|
||||||
else
|
else
|
||||||
@@ -768,6 +800,7 @@ namespace GHelper
|
|||||||
|
|
||||||
string cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
string cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
||||||
string gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
string gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
||||||
|
string midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
||||||
|
|
||||||
string cpuTemp = "";
|
string cpuTemp = "";
|
||||||
string gpuTemp = "";
|
string gpuTemp = "";
|
||||||
@@ -790,15 +823,14 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
Program.settingsForm.labelCPUFan.Text = "CPU" + cpuTemp + cpuFan;
|
Program.settingsForm.labelCPUFan.Text = "CPU" + cpuTemp + cpuFan;
|
||||||
Program.settingsForm.labelGPUFan.Text = "GPU" + gpuTemp + gpuFan;
|
Program.settingsForm.labelGPUFan.Text = "GPU" + gpuTemp + gpuFan;
|
||||||
|
if (midFan is not null) Program.settingsForm.labelMidFan.Text = "Mid" + midFan;
|
||||||
Program.settingsForm.labelBattery.Text = battery;
|
Program.settingsForm.labelBattery.Text = battery;
|
||||||
|
|
||||||
|
Program.trayIcon.Text = "CPU" + cpuTemp + cpuFan + "\n" + "GPU" + gpuTemp + gpuFan + ((battery.Length > 0) ? ("\n" + battery) : "");
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
|
||||||
{
|
|
||||||
RefreshSensors();
|
|
||||||
aTimer.Interval = 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -851,6 +883,9 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
||||||
Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
||||||
|
|
||||||
|
if (Program.config.getConfig("mid_fan") == 1)
|
||||||
|
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.getConfigPerf("auto_apply_power") == 1)
|
if (Program.config.getConfigPerf("auto_apply_power") == 1)
|
||||||
@@ -992,19 +1027,13 @@ namespace GHelper
|
|||||||
if (!ultimate)
|
if (!ultimate)
|
||||||
{
|
{
|
||||||
tableGPU.Controls.Remove(buttonUltimate);
|
tableGPU.Controls.Remove(buttonUltimate);
|
||||||
|
|
||||||
/*
|
|
||||||
* buttonFans.Image = null;
|
|
||||||
buttonFans.Height = 44;
|
|
||||||
*/
|
|
||||||
|
|
||||||
tablePerf.ColumnCount = 0;
|
tablePerf.ColumnCount = 0;
|
||||||
tableGPU.ColumnCount = 0;
|
tableGPU.ColumnCount = 0;
|
||||||
|
tableScreen.ColumnCount = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tableLayoutKeyboard.ColumnCount = 0;
|
tableLayoutKeyboard.ColumnCount = 0;
|
||||||
tableScreen.ColumnCount = 0;
|
|
||||||
tableLayoutMatrix.ColumnCount = 0;
|
tableLayoutMatrix.ColumnCount = 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -1031,12 +1060,13 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Program.config.setConfig("gpu_mode", GpuMode);
|
||||||
|
|
||||||
ButtonEnabled(buttonOptimized, true);
|
ButtonEnabled(buttonOptimized, true);
|
||||||
ButtonEnabled(buttonEco, true);
|
ButtonEnabled(buttonEco, true);
|
||||||
ButtonEnabled(buttonStandard, true);
|
ButtonEnabled(buttonStandard, true);
|
||||||
ButtonEnabled(buttonUltimate, true);
|
ButtonEnabled(buttonUltimate, true);
|
||||||
|
|
||||||
Program.config.setConfig("gpu_mode", GpuMode);
|
|
||||||
VisualiseGPUMode(GpuMode);
|
VisualiseGPUMode(GpuMode);
|
||||||
|
|
||||||
return GpuMode;
|
return GpuMode;
|
||||||
@@ -1060,7 +1090,7 @@ namespace GHelper
|
|||||||
|
|
||||||
if (eco == 1)
|
if (eco == 1)
|
||||||
{
|
{
|
||||||
string[] tokill = { "EADesktop" };
|
string[] tokill = { "EADesktop", "RadeonSoftware" };
|
||||||
foreach (string kill in tokill)
|
foreach (string kill in tokill)
|
||||||
foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
|
foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
|
||||||
}
|
}
|
||||||
@@ -1204,10 +1234,10 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ButtonEnabled(Button but, bool enabled)
|
public void ButtonEnabled(RButton but, bool enabled)
|
||||||
{
|
{
|
||||||
but.Enabled = enabled;
|
but.Enabled = enabled;
|
||||||
but.BackColor = enabled ? SystemColors.ControlLightLight : SystemColors.ControlLight;
|
but.BackColor = but.Enabled ? Color.FromArgb(255, but.BackColor) : Color.FromArgb(100, but.BackColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetStartupCheck(bool status)
|
public void SetStartupCheck(bool status)
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
# [G-Helper (GHelper)](https://github.com/seerge/g-helper)
|
# [G-Helper (GHelper)](https://github.com/seerge/g-helper)
|
||||||
|
|
||||||
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/releases/) [](https://github.com/seerge/g-helper/blob/master/LICENSE)
|
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/stargazers/)
|
||||||
[](https://GitHub.com/seerge/g-helper/stargazers/)
|
|
||||||
|
|
||||||
## Open source Armory Crate alternative for Asus ROG Zephyrus G14, G15, Flow X13, Flow X16, and other models
|
## Open source Armoury Crate alternative for Asus ROG Zephyrus G14, G15, Flow X13, Flow X16, and other models
|
||||||
|
|
||||||
A small utility that allows you to do almost everything you could do with Armory Crate but without extra bloat and unnecessary services.
|
A small utility that allows you to do almost everything you could do with Armoury Crate but without extra bloat and unnecessary services.
|
||||||
|
|
||||||
### :gift: Main advantages
|
### :gift: Main advantages
|
||||||
|
|
||||||
@@ -15,14 +14,14 @@ A small utility that allows you to do almost everything you could do with Armory
|
|||||||
|
|
||||||
### [:floppy_disk: Download latest release](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
### [:floppy_disk: Download latest release](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||||
|
|
||||||
If you like this app, please star :star: it on Github and spread a word about it!
|
If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### :zap: Main features
|
### :zap: Main features
|
||||||
|
|
||||||
1. Built-in **Performance modes**: Silent - Balanced - Turbo (with default fan curves)
|
1. Built-in **Performance modes**: Silent - Balanced - Turbo (with default fan curves)
|
||||||
2. **GPU modes**: Eco -Standard - Ultimate
|
2. **GPU modes**: Eco - Standard - Ultimate - Optimized
|
||||||
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc depending on the model) with display overdrive (OD)
|
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc depending on the model) with display overdrive (OD)
|
||||||
4. Default and custom fan profiles for every performance mode
|
4. Default and custom fan profiles for every performance mode
|
||||||
5. Power limits (PPT) for every performance mode
|
5. Power limits (PPT) for every performance mode
|
||||||
@@ -36,8 +35,8 @@ If you like this app, please star :star: it on Github and spread a word about it
|
|||||||
|
|
||||||
### :apple: Automatic switching of modes when on battery or plugged in
|
### :apple: Automatic switching of modes when on battery or plugged in
|
||||||
- Performance modes (app remembers last mode used on battery or when plugged)
|
- Performance modes (app remembers last mode used on battery or when plugged)
|
||||||
- GPU modes (eco on battery, stanard when plugged)
|
- Optimized GPU mode - disables dGPU on battery and enables when plugged
|
||||||
- Screen refresh rate (60hz on battery, 120+ hz when plugged)
|
- Auto Screen refresh rate (60hz on battery, 120+ hz when plugged)
|
||||||
|
|
||||||
To keep auto switching and hotkeys working the app needs to stay in running in the tray. It doesn't consume any resources.
|
To keep auto switching and hotkeys working the app needs to stay in running in the tray. It doesn't consume any resources.
|
||||||
|
|
||||||
@@ -54,13 +53,14 @@ PPTs are shown for G14 2022, for other models PPTs will be different as they are
|
|||||||
### :video_game: GPU Modes
|
### :video_game: GPU Modes
|
||||||
|
|
||||||
1. Eco mode : only low power integrated GPU enabled, iGPU drives built in display
|
1. Eco mode : only low power integrated GPU enabled, iGPU drives built in display
|
||||||
2. Standard mode (Windows Hybrid) : iGPU and dGPU enabled, iGPU drives built in display
|
2. Standard mode (MS Hybrid) : iGPU and dGPU enabled, iGPU drives built in display
|
||||||
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display (supported only on G14 2022 model)
|
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display (supported only on G14 2022 model)
|
||||||
|
4. Optimized (formely existed as a checkbox): disables dGPU on battery (Eco) and enables when plugged (Standard)
|
||||||
|
|
||||||
### :question: FAQ
|
### :question: FAQ
|
||||||
|
|
||||||
#### How do I stop Armory Crate install popup appearing every time I press M4 / Rog key?
|
#### How do I stop Armory Crate install popup appearing every time I press M4 / Rog key?
|
||||||
Go to BIOS (F2 on boot), open Advanced Settings (F8) and disable "Armory Control Intrerface"
|
Go to BIOS (F2 on boot), open Advanced Settings and disable "Armory Control Intrerface"
|
||||||
|
|
||||||
#### Why Ultimate GPU mode is not available on my laptop?
|
#### Why Ultimate GPU mode is not available on my laptop?
|
||||||
Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other models from 2022+)
|
Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other models from 2022+)
|
||||||
@@ -68,6 +68,9 @@ Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other mo
|
|||||||
#### App doesn't start / or crashes, what should I do ?
|
#### App doesn't start / or crashes, what should I do ?
|
||||||
Open "Event Viewer" from start menu, go to Windows Logs -> Application and check for recent Errors mentioning G-Helper. If you see one - please post a [new issue](https://github.com/seerge/g-helper/issues) with all details from this error.
|
Open "Event Viewer" from start menu, go to Windows Logs -> Application and check for recent Errors mentioning G-Helper. If you see one - please post a [new issue](https://github.com/seerge/g-helper/issues) with all details from this error.
|
||||||
|
|
||||||
|
#### How do I uninstall G-helper?
|
||||||
|
G-helper is a single exe, and it doesn't install anything in the system. To remove it - you can simply delete exe :) If you have applied any custom fan profiles or PPTs - before removing I would recommend selecting your favorite perfromance mode (for example balanced) and clicking "Factory defaults" under Fans + Power.
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
### How to install
|
### How to install
|
||||||
|
|||||||
BIN
docs/screenshot-dark.png
Normal file
BIN
docs/screenshot-dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 4.2 MiB |
Reference in New Issue
Block a user