Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64e390a61f | ||
|
|
1cd808de07 | ||
|
|
d82f1c8d70 | ||
|
|
9189cf0a46 | ||
|
|
3a7c4278a0 | ||
|
|
7065ba8661 | ||
|
|
1bce4a4b51 | ||
|
|
468f9c4034 | ||
|
|
4d347df45c | ||
|
|
d7f1d1d5fd | ||
|
|
6800ae38dd | ||
|
|
9b2b96fbf0 | ||
|
|
04b3a15d8f | ||
|
|
aae0570340 | ||
|
|
b142d566da | ||
|
|
a9115d0dff | ||
|
|
e3a3e81245 | ||
|
|
c50c1807ca | ||
|
|
5767320437 | ||
|
|
74846097db | ||
|
|
5b89556ed3 |
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.
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ 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;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<System.Windows.Forms.ApplicationConfigurationSection>
|
<System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
<add key="DpiAwareness" value="System" />
|
<add key="DpiAwareness" value="PerMonitorV2" />
|
||||||
</System.Windows.Forms.ApplicationConfigurationSection>
|
</System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
|
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
|
||||||
|
|||||||
@@ -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>();
|
||||||
|
|||||||
150
app/ControlHelper.cs
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
using CustomControls;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
|
||||||
|
public static class ControlHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
static bool _invert = false;
|
||||||
|
static float _scale = 1;
|
||||||
|
|
||||||
|
static Color formBack;
|
||||||
|
static Color backMain;
|
||||||
|
static Color foreMain;
|
||||||
|
static Color borderMain;
|
||||||
|
static Color buttonMain;
|
||||||
|
|
||||||
|
public static void Adjust(RForm container, float baseScale = 2, bool invert = false)
|
||||||
|
{
|
||||||
|
_scale = GetDpiScale(container).Value / baseScale;
|
||||||
|
|
||||||
|
if (container.darkTheme)
|
||||||
|
{
|
||||||
|
formBack = Color.FromArgb(255, 35, 35, 35);
|
||||||
|
backMain = Color.FromArgb(255, 50, 50, 50);
|
||||||
|
foreMain = Color.White;
|
||||||
|
borderMain = Color.FromArgb(255, 50, 50, 50);
|
||||||
|
buttonMain = Color.FromArgb(255, 100, 100, 100);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
formBack = SystemColors.Control;
|
||||||
|
backMain = SystemColors.ControlLightLight;
|
||||||
|
foreMain = SystemColors.ControlText;
|
||||||
|
borderMain = Color.LightGray;
|
||||||
|
buttonMain = SystemColors.ControlLight;
|
||||||
|
}
|
||||||
|
|
||||||
|
container.BackColor = formBack;
|
||||||
|
container.ForeColor = foreMain;
|
||||||
|
|
||||||
|
_invert = invert;
|
||||||
|
AdjustControls(container.Controls);
|
||||||
|
_invert = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void AdjustControls(Control.ControlCollection controls)
|
||||||
|
{
|
||||||
|
foreach (Control control in controls)
|
||||||
|
{
|
||||||
|
var button = control as Button;
|
||||||
|
if (button != null)
|
||||||
|
{
|
||||||
|
button.BackColor = 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)
|
||||||
|
{
|
||||||
|
if (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 = foreMain;
|
||||||
|
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreMain;
|
||||||
|
|
||||||
|
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 = foreMain;
|
||||||
|
chart.ChartAreas[0].AxisY.LineColor = foreMain;
|
||||||
|
|
||||||
|
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 AdjustImage(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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
313
app/CustomControls.cs
Normal file
@@ -0,0 +1,313 @@
|
|||||||
|
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;
|
||||||
|
public bool invert = false;
|
||||||
|
|
||||||
|
public void InitTheme()
|
||||||
|
{
|
||||||
|
bool newDarkTheme = CheckSystemDarkModeStatus();
|
||||||
|
invert = (darkTheme != newDarkTheme);
|
||||||
|
darkTheme = newDarkTheme;
|
||||||
|
|
||||||
|
ControlHelper.Adjust(this, 2, invert);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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.LightGray;
|
||||||
|
[DefaultValue(typeof(Color), "LightGray")]
|
||||||
|
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 = 3;
|
||||||
|
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 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
76
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,24 +31,27 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
ChartArea chartArea3 = new ChartArea();
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
Title title3 = new Title();
|
||||||
|
ChartArea chartArea4 = new ChartArea();
|
||||||
|
Title title4 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
|
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();
|
||||||
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();
|
||||||
@@ -73,6 +79,7 @@
|
|||||||
//
|
//
|
||||||
// panelFans
|
// panelFans
|
||||||
//
|
//
|
||||||
|
panelFans.Controls.Add(labelTip);
|
||||||
panelFans.Controls.Add(labelBoost);
|
panelFans.Controls.Add(labelBoost);
|
||||||
panelFans.Controls.Add(comboBoost);
|
panelFans.Controls.Add(comboBoost);
|
||||||
panelFans.Controls.Add(picturePerf);
|
panelFans.Controls.Add(picturePerf);
|
||||||
@@ -89,6 +96,17 @@
|
|||||||
panelFans.Size = new Size(824, 1159);
|
panelFans.Size = new Size(824, 1159);
|
||||||
panelFans.TabIndex = 12;
|
panelFans.TabIndex = 12;
|
||||||
//
|
//
|
||||||
|
// labelTip
|
||||||
|
//
|
||||||
|
labelTip.AutoSize = true;
|
||||||
|
labelTip.BackColor = SystemColors.ControlLightLight;
|
||||||
|
labelTip.Location = new Point(245, 13);
|
||||||
|
labelTip.Name = "labelTip";
|
||||||
|
labelTip.Padding = new Padding(5);
|
||||||
|
labelTip.Size = new Size(107, 42);
|
||||||
|
labelTip.TabIndex = 40;
|
||||||
|
labelTip.Text = "500,300";
|
||||||
|
//
|
||||||
// labelBoost
|
// labelBoost
|
||||||
//
|
//
|
||||||
labelBoost.AutoSize = true;
|
labelBoost.AutoSize = true;
|
||||||
@@ -101,6 +119,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,8 +160,8 @@
|
|||||||
//
|
//
|
||||||
// chartGPU
|
// chartGPU
|
||||||
//
|
//
|
||||||
chartArea1.Name = "ChartArea1";
|
chartArea3.Name = "ChartArea1";
|
||||||
chartGPU.ChartAreas.Add(chartArea1);
|
chartGPU.ChartAreas.Add(chartArea3);
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
chartGPU.Location = new Point(2, 506);
|
chartGPU.Location = new Point(2, 506);
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -150,11 +169,13 @@
|
|||||||
chartGPU.Size = new Size(760, 476);
|
chartGPU.Size = new Size(760, 476);
|
||||||
chartGPU.TabIndex = 17;
|
chartGPU.TabIndex = 17;
|
||||||
chartGPU.Text = "chart1";
|
chartGPU.Text = "chart1";
|
||||||
|
title3.Name = "Title1";
|
||||||
|
chartGPU.Titles.Add(title3);
|
||||||
//
|
//
|
||||||
// chartCPU
|
// chartCPU
|
||||||
//
|
//
|
||||||
chartArea2.Name = "ChartArea1";
|
chartArea4.Name = "ChartArea1";
|
||||||
chartCPU.ChartAreas.Add(chartArea2);
|
chartCPU.ChartAreas.Add(chartArea4);
|
||||||
chartCPU.Dock = DockStyle.Fill;
|
chartCPU.Dock = DockStyle.Fill;
|
||||||
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);
|
||||||
@@ -162,6 +183,8 @@
|
|||||||
chartCPU.Size = new Size(760, 476);
|
chartCPU.Size = new Size(760, 476);
|
||||||
chartCPU.TabIndex = 14;
|
chartCPU.TabIndex = 14;
|
||||||
chartCPU.Text = "chartCPU";
|
chartCPU.Text = "chartCPU";
|
||||||
|
title4.Name = "Title1";
|
||||||
|
chartCPU.Titles.Add(title4);
|
||||||
//
|
//
|
||||||
// labelFans
|
// labelFans
|
||||||
//
|
//
|
||||||
@@ -188,25 +211,33 @@
|
|||||||
//
|
//
|
||||||
// buttonReset
|
// buttonReset
|
||||||
//
|
//
|
||||||
|
buttonReset.Activated = false;
|
||||||
buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
buttonReset.BackColor = SystemColors.ControlLight;
|
||||||
|
buttonReset.BorderColor = Color.Transparent;
|
||||||
|
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.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 = SystemColors.ControlLight;
|
||||||
|
buttonApply.BorderColor = Color.Transparent;
|
||||||
|
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.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 Fan Curve";
|
||||||
buttonApply.UseVisualStyleBackColor = true;
|
buttonApply.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
// panelPower
|
// panelPower
|
||||||
//
|
//
|
||||||
@@ -264,14 +295,18 @@
|
|||||||
//
|
//
|
||||||
// buttonApplyPower
|
// buttonApplyPower
|
||||||
//
|
//
|
||||||
|
buttonApplyPower.Activated = false;
|
||||||
buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
buttonApplyPower.BackColor = SystemColors.ControlLight;
|
||||||
|
buttonApplyPower.BorderColor = Color.Transparent;
|
||||||
|
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.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
|
||||||
//
|
//
|
||||||
@@ -443,11 +478,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;
|
||||||
@@ -466,7 +501,8 @@
|
|||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
59
app/Fans.cs
@@ -1,16 +1,25 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
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;
|
||||||
|
|
||||||
|
static int MinRPM, MaxRPM;
|
||||||
|
|
||||||
|
static string ChartPercToRPM(int percentage, string unit = "")
|
||||||
|
{
|
||||||
|
if (percentage == 0) return "OFF";
|
||||||
|
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -24,10 +33,7 @@ namespace GHelper
|
|||||||
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].AxisX.MajorGrid.LineColor = Color.LightGray;
|
||||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
|
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
|
||||||
@@ -41,10 +47,8 @@ namespace GHelper
|
|||||||
|
|
||||||
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
|
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(-2, 2, "OFF");
|
for (int i = 0; i <= 90; i += 10)
|
||||||
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
||||||
for (int i = 1; i <= 9; i++)
|
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(i * 10 - 2, i * 10 + 2, (1800 + 400 * i).ToString());
|
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(98, 102, "RPM");
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(98, 102, "RPM");
|
||||||
|
|
||||||
@@ -76,14 +80,29 @@ 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.BackColor = Color.Transparent;
|
||||||
|
|
||||||
FormClosing += Fans_FormClosing;
|
FormClosing += Fans_FormClosing;
|
||||||
|
|
||||||
seriesCPU = chartCPU.Series.Add("CPU");
|
seriesCPU = chartCPU.Series.Add("CPU");
|
||||||
seriesGPU = chartGPU.Series.Add("GPU");
|
seriesGPU = chartGPU.Series.Add("GPU");
|
||||||
|
|
||||||
seriesCPU.Color = Color.Blue;
|
seriesCPU.Color = colorStandard;
|
||||||
seriesGPU.Color = Color.Red;
|
seriesGPU.Color = colorTurbo;
|
||||||
|
|
||||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||||
@@ -126,7 +145,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
int boost = NativeMethods.GetCPUBoost();
|
int boost = NativeMethods.GetCPUBoost();
|
||||||
if (boost >= 0)
|
if (boost >= 0)
|
||||||
comboBoost.SelectedIndex = boost;
|
comboBoost.SelectedIndex = Math.Min(boost, comboBoost.Items.Count - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComboBoost_Changed(object? sender, EventArgs e)
|
private void ComboBoost_Changed(object? sender, EventArgs e)
|
||||||
@@ -234,12 +253,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";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -334,6 +353,7 @@ namespace GHelper
|
|||||||
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
curPoint = null;
|
curPoint = null;
|
||||||
|
labelTip.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChartCPU_MouseMove(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseMove(object? sender, MouseEventArgs e)
|
||||||
@@ -371,13 +391,18 @@ namespace GHelper
|
|||||||
if (dy < 0) dy = 0;
|
if (dy < 0) dy = 0;
|
||||||
if (dy > 100) dy = 100;
|
if (dy > 100) dy = 100;
|
||||||
|
|
||||||
dymin = (dx - 60) * 1.2;
|
dymin = (dx - 65) * 1.2;
|
||||||
|
|
||||||
if (dy < dymin) dy = dymin;
|
if (dy < dymin) dy = dymin;
|
||||||
|
|
||||||
curPoint.XValue = dx;
|
curPoint.XValue = dx;
|
||||||
curPoint.YValues[0] = dy;
|
curPoint.YValues[0] = dy;
|
||||||
|
|
||||||
|
labelTip.Visible = true;
|
||||||
|
labelTip.Text = Math.Round(dx) + "C, " + ChartPercToRPM((int)dy, " RPM");
|
||||||
|
labelTip.Top = e.Y + ((Control)sender).Top;
|
||||||
|
labelTip.Left = e.X;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,9 +16,15 @@
|
|||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.29</AssemblyVersion>
|
<AssemblyVersion>0.34</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="screenshots\**" />
|
||||||
|
<EmbeddedResource Remove="screenshots\**" />
|
||||||
|
<None Remove="screenshots\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Resources\eco.ico" />
|
<None Remove="Resources\eco.ico" />
|
||||||
<None Remove="Resources\icons8-charging-battery-48.png" />
|
<None Remove="Resources\icons8-charging-battery-48.png" />
|
||||||
@@ -45,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>
|
||||||
@@ -102,8 +99,4 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="screenshots\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -58,28 +58,36 @@ 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 {
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
Logger.WriteLine($"GpuTemperatureProvider: {GpuTemperatureProvider?.GetType().Name}");
|
Logger.WriteLine($"GpuTemperatureProvider: {GpuTemperatureProvider?.GetType().Name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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,6 +49,8 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged;
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
|
|
||||||
ds = settingsForm.Handle;
|
ds = settingsForm.Handle;
|
||||||
@@ -60,8 +63,6 @@ namespace GHelper
|
|||||||
settingsForm.InitAura();
|
settingsForm.InitAura();
|
||||||
settingsForm.InitMatrix();
|
settingsForm.InitMatrix();
|
||||||
|
|
||||||
settingsForm.VisualiseGPUAuto(config.getConfig("gpu_auto"));
|
|
||||||
settingsForm.VisualiseScreenAuto(config.getConfig("screen_auto"));
|
|
||||||
settingsForm.SetStartupCheck(Startup.IsScheduled());
|
settingsForm.SetStartupCheck(Startup.IsScheduled());
|
||||||
|
|
||||||
SetAutoModes();
|
SetAutoModes();
|
||||||
@@ -79,6 +80,30 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTheme) < 2000) return;
|
||||||
|
lastTheme = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
|
switch (e.Category)
|
||||||
|
{
|
||||||
|
case UserPreferenceCategory.General:
|
||||||
|
Debug.WriteLine("Theme Changed");
|
||||||
|
settingsForm.InitTheme();
|
||||||
|
|
||||||
|
if (settingsForm.fans is not null && settingsForm.fans.Text != "")
|
||||||
|
settingsForm.fans.InitTheme();
|
||||||
|
|
||||||
|
if (settingsForm.keyb is not null && settingsForm.keyb.Text != "")
|
||||||
|
settingsForm.keyb.InitTheme();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static async void CheckForUpdates()
|
static async void CheckForUpdates()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -114,7 +139,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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) < 1000) return;
|
||||||
@@ -128,6 +153,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);
|
||||||
|
|
||||||
@@ -137,7 +165,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
170
app/Properties/Resources.Designer.cs
generated
@@ -80,6 +80,26 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_balance_symbol_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-balance-symbol-96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_bicycle_48__1_ {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-bicycle-48 (1)", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -90,6 +110,16 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_fan_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-fan-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -100,6 +130,36 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_fan_speed_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-fan-speed-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_fiat_500_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-fiat-500-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_game_controller_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-game-controller-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -120,6 +180,36 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_launch_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-launch-96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_leaf_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-leaf-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_leaf_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-leaf-96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -130,6 +220,26 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_organic_food_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-organic-food-96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_organic_food_961 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-organic-food-961", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -140,6 +250,56 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_project_management_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-project-management-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_project_management_48__1_ {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-project-management-48 (1)", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_rocket_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-rocket-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_spa_flower_48 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-spa-flower-48", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_spa_flower_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-spa-flower-96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -170,6 +330,16 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_xbox_controller_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-xbox-controller-96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -118,43 +118,94 @@
|
|||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-leaf-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-leaf-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-matrix-desktop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-launch-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-launch-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-charging-battery-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-charging-battery-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-organic-food-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-organic-food-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-video-card-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-fan-head-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-fan-head-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-processor-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-processor-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-spa-flower-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-spa-flower-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-spa-flower-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\standard.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-keyboard-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-keyboard-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-keyboard-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-keyboard-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="icons8-fan-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-fan-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-speed-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-laptop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-rocket-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-organic-food-961" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-organic-food-961.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-balance-symbol-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-balance-symbol-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-fan-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-fan-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-matrix-desktop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-xbox-controller-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-xbox-controller-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-project-management-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-project-management-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8-leaf-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
<data name="ultimate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="ultimate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\ultimate.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\ultimate.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\standard.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\everything-is-fine-itsfine.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\everything-is-fine-itsfine.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-speed-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-game-controller-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
|
||||||
<data name="icons8-video-card-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-fan-head-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-fan-head-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-charging-battery-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-charging-battery-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-laptop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-processor-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-processor-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
BIN
app/Resources/icons8-balance-symbol-96.png
Normal file
|
After Width: | Height: | Size: 710 B |
BIN
app/Resources/icons8-bicycle-48 (1).png
Normal file
|
After Width: | Height: | Size: 924 B |
BIN
app/Resources/icons8-fan-48.png
Normal file
|
After Width: | Height: | Size: 992 B |
BIN
app/Resources/icons8-fan-speed-48.png
Normal file
|
After Width: | Height: | Size: 870 B |
BIN
app/Resources/icons8-fiat-500-48.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
app/Resources/icons8-game-controller-48.png
Normal file
|
After Width: | Height: | Size: 611 B |
BIN
app/Resources/icons8-launch-96.png
Normal file
|
After Width: | Height: | Size: 648 B |
BIN
app/Resources/icons8-leaf-48.png
Normal file
|
After Width: | Height: | Size: 851 B |
BIN
app/Resources/icons8-leaf-96.png
Normal file
|
After Width: | Height: | Size: 910 B |
BIN
app/Resources/icons8-organic-food-96.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
app/Resources/icons8-organic-food-961.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/Resources/icons8-project-management-48 (1).png
Normal file
|
After Width: | Height: | Size: 837 B |
BIN
app/Resources/icons8-project-management-48.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
app/Resources/icons8-rocket-48.png
Normal file
|
After Width: | Height: | Size: 763 B |
BIN
app/Resources/icons8-spa-flower-48.png
Normal file
|
After Width: | Height: | Size: 949 B |
BIN
app/Resources/icons8-spa-flower-96.png
Normal file
|
After Width: | Height: | Size: 954 B |
BIN
app/Resources/icons8-xbox-controller-96.png
Normal file
|
After Width: | Height: | Size: 724 B |
@@ -1,78 +0,0 @@
|
|||||||
using System.ComponentModel;
|
|
||||||
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);
|
|
||||||
|
|
||||||
Rectangle rectSurface = this.ClientRectangle;
|
|
||||||
Rectangle rectBorder = Rectangle.Inflate(rectSurface, -borderSize, -borderSize);
|
|
||||||
|
|
||||||
Color borderDrawColor = activated ? borderColor : Color.Transparent;
|
|
||||||
|
|
||||||
using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius+borderSize))
|
|
||||||
using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius))
|
|
||||||
using (Pen penSurface = new Pen(this.Parent.BackColor, borderSize))
|
|
||||||
using (Pen penBorder = new Pen(borderDrawColor, borderSize))
|
|
||||||
{
|
|
||||||
penBorder.Alignment = PenAlignment.Outset;
|
|
||||||
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
|
||||||
this.Region = new Region(pathSurface);
|
|
||||||
pevent.Graphics.DrawPath(penSurface, pathSurface);
|
|
||||||
pevent.Graphics.DrawPath(penBorder, pathBorder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
816
app/Settings.Designer.cs
generated
293
app/Settings.cs
@@ -1,19 +1,15 @@
|
|||||||
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;
|
||||||
|
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
public partial class SettingsForm : Form
|
public partial class SettingsForm : RForm
|
||||||
{
|
{
|
||||||
|
|
||||||
static Color colorEco = Color.FromArgb(255, 6, 180, 138);
|
|
||||||
static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
|
|
||||||
static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
|
|
||||||
|
|
||||||
static System.Timers.Timer aTimer = default!;
|
static System.Timers.Timer aTimer = default!;
|
||||||
static System.Timers.Timer matrixTimer = default!;
|
static System.Timers.Timer matrixTimer = default!;
|
||||||
|
|
||||||
@@ -21,15 +17,15 @@ namespace GHelper
|
|||||||
|
|
||||||
public string perfName = "Balanced";
|
public string perfName = "Balanced";
|
||||||
|
|
||||||
Fans fans;
|
public Fans fans;
|
||||||
Keyboard keyb;
|
public Keyboard keyb;
|
||||||
|
|
||||||
static AnimeMatrixDevice mat;
|
static AnimeMatrixDevice mat;
|
||||||
|
|
||||||
public SettingsForm()
|
public SettingsForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InitTheme();
|
||||||
|
|
||||||
FormClosing += SettingsForm_FormClosing;
|
FormClosing += SettingsForm_FormClosing;
|
||||||
|
|
||||||
@@ -40,10 +36,14 @@ namespace GHelper
|
|||||||
buttonEco.BorderColor = colorEco;
|
buttonEco.BorderColor = colorEco;
|
||||||
buttonStandard.BorderColor = colorStandard;
|
buttonStandard.BorderColor = colorStandard;
|
||||||
buttonUltimate.BorderColor = colorTurbo;
|
buttonUltimate.BorderColor = colorTurbo;
|
||||||
|
buttonOptimized.BorderColor = colorEco;
|
||||||
|
|
||||||
button60Hz.BorderColor = SystemColors.ActiveBorder;
|
button60Hz.BorderColor = SystemColors.ActiveBorder;
|
||||||
button120Hz.BorderColor = SystemColors.ActiveBorder;
|
button120Hz.BorderColor = SystemColors.ActiveBorder;
|
||||||
|
buttonScreenAuto.BorderColor = SystemColors.ActiveBorder;
|
||||||
|
buttonMiniled.BorderColor = colorTurbo;
|
||||||
|
|
||||||
|
buttonOptimized.Click += ButtonOptimized_Click;
|
||||||
buttonSilent.Click += ButtonSilent_Click;
|
buttonSilent.Click += ButtonSilent_Click;
|
||||||
buttonBalanced.Click += ButtonBalanced_Click;
|
buttonBalanced.Click += ButtonBalanced_Click;
|
||||||
buttonTurbo.Click += ButtonTurbo_Click;
|
buttonTurbo.Click += ButtonTurbo_Click;
|
||||||
@@ -58,13 +58,11 @@ namespace GHelper
|
|||||||
|
|
||||||
button60Hz.Click += Button60Hz_Click;
|
button60Hz.Click += Button60Hz_Click;
|
||||||
button120Hz.Click += Button120Hz_Click;
|
button120Hz.Click += Button120Hz_Click;
|
||||||
|
buttonScreenAuto.Click += ButtonScreenAuto_Click;
|
||||||
|
buttonMiniled.Click += ButtonMiniled_Click;
|
||||||
|
|
||||||
buttonQuit.Click += ButtonQuit_Click;
|
buttonQuit.Click += ButtonQuit_Click;
|
||||||
|
|
||||||
checkGPU.CheckedChanged += CheckGPU_CheckedChanged;
|
|
||||||
|
|
||||||
checkScreen.CheckedChanged += checkScreen_CheckedChanged;
|
|
||||||
|
|
||||||
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboKeyboard.SelectedIndex = 0;
|
comboKeyboard.SelectedIndex = 0;
|
||||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
||||||
@@ -93,12 +91,96 @@ 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.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
|
|
||||||
|
buttonEco.MouseMove += ButtonEco_MouseHover;
|
||||||
|
buttonEco.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
|
|
||||||
|
buttonStandard.MouseMove += ButtonStandard_MouseHover;
|
||||||
|
buttonStandard.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
|
|
||||||
|
buttonUltimate.MouseMove += ButtonUltimate_MouseHover;
|
||||||
|
buttonUltimate.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
|
|
||||||
|
buttonScreenAuto.MouseMove += ButtonScreenAuto_MouseHover;
|
||||||
|
buttonScreenAuto.MouseLeave += ButtonScreen_MouseLeave;
|
||||||
|
|
||||||
|
button60Hz.MouseMove += Button60Hz_MouseHover;
|
||||||
|
button60Hz.MouseLeave += ButtonScreen_MouseLeave;
|
||||||
|
|
||||||
|
button120Hz.MouseMove += Button120Hz_MouseHover;
|
||||||
|
button120Hz.MouseLeave += ButtonScreen_MouseLeave;
|
||||||
|
|
||||||
|
//buttonStandard.Image = (Image)(new Bitmap(buttonStandard.Image, new Size(16, 16)));
|
||||||
|
|
||||||
SetTimer();
|
SetTimer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipScreen.Text = "Max refresh rate + screen overdrive for lower latency";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button60Hz_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipScreen.Text = "60Hz refresh rate to save battery";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonScreen_MouseLeave(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipScreen.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonScreenAuto_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipScreen.Text = "Sets 60Hz to save battery, and back when plugged";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonUltimate_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipGPU.Text = "Routes laptop screen to dGPU, maximizing FPS";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonStandard_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipGPU.Text = "Enables dGPU for standard use";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonEco_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipGPU.Text = "Disables dGPU for battery savings";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonOptimized_MouseHover(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipGPU.Text = "Switch to Eco on battery and to Standard when plugged";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonGPU_MouseLeave(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelTipGPU.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void ButtonOptimized_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("gpu_auto", (Program.config.getConfig("gpu_auto") == 1) ? 0 : 1);
|
||||||
|
VisualiseGPUMode();
|
||||||
|
AutoGPUMode(SystemInformation.PowerStatus.PowerLineStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("screen_auto", 1);
|
||||||
|
InitScreen();
|
||||||
|
AutoScreen(SystemInformation.PowerStatus.PowerLineStatus);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void WndProc(ref Message m)
|
protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
switch (m.Msg)
|
switch (m.Msg)
|
||||||
@@ -130,12 +212,6 @@ namespace GHelper
|
|||||||
base.WndProc(ref m);
|
base.WndProc(ref m);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckGPU_CheckedChanged(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is null) return;
|
|
||||||
CheckBox check = (CheckBox)sender;
|
|
||||||
Program.config.setConfig("gpu_auto", check.Checked ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetVersionLabel(string label, string url = null)
|
public void SetVersionLabel(string label, string url = null)
|
||||||
{
|
{
|
||||||
@@ -528,21 +604,27 @@ namespace GHelper
|
|||||||
|
|
||||||
private void Button120Hz_Click(object? sender, EventArgs e)
|
private void Button120Hz_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Program.config.setConfig("screen_auto", 0);
|
||||||
SetScreen(1000, 1);
|
SetScreen(1000, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button60Hz_Click(object? sender, EventArgs e)
|
private void Button60Hz_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Program.config.setConfig("screen_auto", 0);
|
||||||
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;
|
||||||
@@ -551,18 +633,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);
|
||||||
|
|
||||||
|
if (miniled >= 0)
|
||||||
|
{
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled);
|
||||||
|
Debug.WriteLine("Miniled " + miniled);
|
||||||
|
}
|
||||||
|
|
||||||
InitScreen();
|
InitScreen();
|
||||||
Logger.WriteLine("Screen " + frequency.ToString() + "Hz");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,37 +661,31 @@ namespace GHelper
|
|||||||
int frequency = NativeMethods.GetRefreshRate();
|
int frequency = NativeMethods.GetRefreshRate();
|
||||||
int maxFrequency = Program.config.getConfig("max_frequency");
|
int maxFrequency = Program.config.getConfig("max_frequency");
|
||||||
|
|
||||||
if (frequency < 0)
|
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
||||||
{
|
|
||||||
button60Hz.Enabled = false;
|
|
||||||
button120Hz.Enabled = false;
|
|
||||||
labelSreen.Text = "Laptop Screen: Turned off";
|
|
||||||
button60Hz.BackColor = SystemColors.ControlLight;
|
|
||||||
button120Hz.BackColor = SystemColors.ControlLight;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
button60Hz.Enabled = true;
|
|
||||||
button120Hz.Enabled = true;
|
|
||||||
button60Hz.BackColor = SystemColors.ControlLightLight;
|
|
||||||
button120Hz.BackColor = SystemColors.ControlLightLight;
|
|
||||||
labelSreen.Text = "Laptop Screen";
|
|
||||||
}
|
|
||||||
|
|
||||||
int overdrive = 0;
|
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
||||||
try
|
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
||||||
{
|
|
||||||
overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
bool screenEnabled = (frequency >= 0);
|
||||||
}
|
|
||||||
catch
|
ButtonEnabled(button60Hz, screenEnabled);
|
||||||
{
|
ButtonEnabled(button120Hz, screenEnabled);
|
||||||
Logger.WriteLine("Screen Overdrive not supported");
|
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;
|
||||||
|
buttonScreenAuto.Activated = false;
|
||||||
|
|
||||||
if (frequency == 60)
|
if (screenAuto)
|
||||||
|
{
|
||||||
|
buttonScreenAuto.Activated = true;
|
||||||
|
}
|
||||||
|
else if (frequency == 60)
|
||||||
{
|
{
|
||||||
button60Hz.Activated = true;
|
button60Hz.Activated = true;
|
||||||
}
|
}
|
||||||
@@ -620,6 +703,13 @@ namespace GHelper
|
|||||||
button120Hz.Text = maxFrequency.ToString() + "Hz + OD";
|
button120Hz.Text = maxFrequency.ToString() + "Hz + OD";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (miniled >= 0)
|
||||||
|
{
|
||||||
|
tableScreen.Controls.Add(buttonMiniled, 3, 0);
|
||||||
|
buttonMiniled.Activated = (miniled == 1);
|
||||||
|
Program.config.setConfig("miniled", miniled);
|
||||||
|
}
|
||||||
|
|
||||||
Program.config.setConfig("frequency", frequency);
|
Program.config.setConfig("frequency", frequency);
|
||||||
Program.config.setConfig("overdrive", overdrive);
|
Program.config.setConfig("overdrive", overdrive);
|
||||||
}
|
}
|
||||||
@@ -857,8 +947,7 @@ namespace GHelper
|
|||||||
|
|
||||||
public void AutoScreen(PowerLineStatus Plugged = PowerLineStatus.Online)
|
public void AutoScreen(PowerLineStatus Plugged = PowerLineStatus.Online)
|
||||||
{
|
{
|
||||||
int ScreenAuto = Program.config.getConfig("screen_auto");
|
if (Program.config.getConfig("screen_auto") != 1) return;
|
||||||
if (ScreenAuto != 1) return;
|
|
||||||
|
|
||||||
if (Plugged == PowerLineStatus.Online)
|
if (Plugged == PowerLineStatus.Online)
|
||||||
SetScreen(1000, 1);
|
SetScreen(1000, 1);
|
||||||
@@ -871,8 +960,8 @@ namespace GHelper
|
|||||||
public bool AutoGPUMode(PowerLineStatus Plugged = PowerLineStatus.Online)
|
public bool AutoGPUMode(PowerLineStatus Plugged = PowerLineStatus.Online)
|
||||||
{
|
{
|
||||||
|
|
||||||
int GpuAuto = Program.config.getConfig("gpu_auto");
|
bool GpuAuto = Program.config.getConfig("gpu_auto") == 1;
|
||||||
if (GpuAuto != 1) return false;
|
if (!GpuAuto) return false;
|
||||||
|
|
||||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
||||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
||||||
@@ -897,6 +986,29 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UltimateUI(bool ultimate)
|
||||||
|
{
|
||||||
|
if (!ultimate)
|
||||||
|
{
|
||||||
|
tableGPU.Controls.Remove(buttonUltimate);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* buttonFans.Image = null;
|
||||||
|
buttonFans.Height = 44;
|
||||||
|
*/
|
||||||
|
|
||||||
|
tablePerf.ColumnCount = 0;
|
||||||
|
tableGPU.ColumnCount = 0;
|
||||||
|
tableScreen.ColumnCount = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
tableLayoutKeyboard.ColumnCount = 0;
|
||||||
|
tableLayoutMatrix.ColumnCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public int InitGPUMode()
|
public int InitGPUMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -914,14 +1026,17 @@ namespace GHelper
|
|||||||
else
|
else
|
||||||
GpuMode = ASUSWmi.GPUModeStandard;
|
GpuMode = ASUSWmi.GPUModeStandard;
|
||||||
|
|
||||||
buttonUltimate.Visible = (mux == 1);
|
UltimateUI(mux == 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Program.config.setConfig("gpu_mode", GpuMode);
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -932,6 +1047,7 @@ namespace GHelper
|
|||||||
public void SetEcoGPU(int eco)
|
public void SetEcoGPU(int eco)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
ButtonEnabled(buttonOptimized, false);
|
||||||
ButtonEnabled(buttonEco, false);
|
ButtonEnabled(buttonEco, false);
|
||||||
ButtonEnabled(buttonStandard, false);
|
ButtonEnabled(buttonStandard, false);
|
||||||
ButtonEnabled(buttonUltimate, false);
|
ButtonEnabled(buttonUltimate, false);
|
||||||
@@ -944,7 +1060,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();
|
||||||
}
|
}
|
||||||
@@ -968,9 +1084,13 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
int CurrentGPU = Program.config.getConfig("gpu_mode");
|
int CurrentGPU = Program.config.getConfig("gpu_mode");
|
||||||
|
Program.config.setConfig("gpu_auto", 0);
|
||||||
|
|
||||||
if (CurrentGPU == GPUMode)
|
if (CurrentGPU == GPUMode)
|
||||||
|
{
|
||||||
|
VisualiseGPUMode();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var restart = false;
|
var restart = false;
|
||||||
var changed = false;
|
var changed = false;
|
||||||
@@ -987,7 +1107,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeUltimate)
|
else if (GPUMode == ASUSWmi.GPUModeUltimate)
|
||||||
{
|
{
|
||||||
DialogResult dialogResult = MessageBox.Show(" Ultimate Mode requires restart", "Reboot now?", MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show("Ultimate Mode requires restart", "Reboot now?", MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0);
|
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0);
|
||||||
@@ -1012,60 +1132,55 @@ namespace GHelper
|
|||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("gpu_mode", GPUMode);
|
Program.config.setConfig("gpu_mode", GPUMode);
|
||||||
|
|
||||||
HardwareMonitor.RecreateGpuTemperatureProviderWithRetry();
|
HardwareMonitor.RecreateGpuTemperatureProviderWithRetry();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restart)
|
if (restart)
|
||||||
{
|
{
|
||||||
VisualiseGPUMode(GPUMode);
|
VisualiseGPUMode();
|
||||||
Process.Start("shutdown", "/r /t 1");
|
Process.Start("shutdown", "/r /t 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void VisualiseGPUAuto(int GPUAuto)
|
|
||||||
{
|
|
||||||
checkGPU.Checked = (GPUAuto == 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void VisualiseScreenAuto(int ScreenAuto)
|
|
||||||
{
|
|
||||||
checkScreen.Checked = (ScreenAuto == 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void VisualiseGPUMode(int GPUMode = -1)
|
public void VisualiseGPUMode(int GPUMode = -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GPUMode == -1)
|
if (GPUMode == -1)
|
||||||
{
|
|
||||||
GPUMode = Program.config.getConfig("gpu_mode");
|
GPUMode = Program.config.getConfig("gpu_mode");
|
||||||
}
|
|
||||||
|
bool GPUAuto = (Program.config.getConfig("gpu_auto") == 1);
|
||||||
|
|
||||||
buttonEco.Activated = false;
|
buttonEco.Activated = false;
|
||||||
buttonStandard.Activated = false;
|
buttonStandard.Activated = false;
|
||||||
buttonUltimate.Activated = false;
|
buttonUltimate.Activated = false;
|
||||||
|
buttonOptimized.Activated = false;
|
||||||
|
|
||||||
switch (GPUMode)
|
switch (GPUMode)
|
||||||
{
|
{
|
||||||
case ASUSWmi.GPUModeEco:
|
case ASUSWmi.GPUModeEco:
|
||||||
buttonEco.Activated = true;
|
buttonOptimized.BorderColor = colorEco;
|
||||||
|
buttonEco.Activated = !GPUAuto;
|
||||||
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = "GPU Mode: iGPU only";
|
labelGPU.Text = "GPU Mode: iGPU only";
|
||||||
Program.trayIcon.Icon = GHelper.Properties.Resources.eco;
|
Program.trayIcon.Icon = Properties.Resources.eco;
|
||||||
break;
|
break;
|
||||||
case ASUSWmi.GPUModeUltimate:
|
case ASUSWmi.GPUModeUltimate:
|
||||||
buttonUltimate.Activated = true;
|
buttonUltimate.Activated = true;
|
||||||
labelGPU.Text = "GPU Mode: dGPU exclusive";
|
labelGPU.Text = "GPU Mode: dGPU exclusive";
|
||||||
Program.trayIcon.Icon = GHelper.Properties.Resources.ultimate;
|
Program.trayIcon.Icon = Properties.Resources.ultimate;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
buttonStandard.Activated = true;
|
buttonOptimized.BorderColor = colorStandard;
|
||||||
|
buttonStandard.Activated = !GPUAuto;
|
||||||
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = "GPU Mode: iGPU + dGPU";
|
labelGPU.Text = "GPU Mode: iGPU + dGPU";
|
||||||
Program.trayIcon.Icon = GHelper.Properties.Resources.standard;
|
Program.trayIcon.Icon = Properties.Resources.standard;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1089,10 +1204,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)
|
||||||
@@ -1123,14 +1238,6 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void checkScreen_CheckedChanged(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is null) return;
|
|
||||||
CheckBox check = (CheckBox)sender;
|
|
||||||
Program.config.setConfig("screen_auto", check.Checked ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,8 +54,8 @@
|
|||||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<windowsSettings>
|
<windowsSettings>
|
||||||
<!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor/dpiAwareness>-->
|
<!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor/dpiAwareness>-->
|
||||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
|
||||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">System</dpiAwareness>
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">System</dpiAwareness>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||||
</windowsSettings>
|
</windowsSettings>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
@@ -56,6 +55,7 @@ PPTs are shown for G14 2022, for other models PPTs will be different as they are
|
|||||||
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 (Windows 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
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 4.2 MiB |