UI Tweaks

This commit is contained in:
Serge
2023-06-12 14:41:47 +02:00
parent c575b17aba
commit 1cd9c30c4a
9 changed files with 98 additions and 105 deletions

View File

@@ -189,6 +189,16 @@ namespace GHelper
}
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
{
aTimer.Enabled = this.Visible;
if (this.Visible)
{
InitScreen();
InitXGM();
}
}
private void ButtonUpdates_Click(object? sender, EventArgs e)
{
if (updates == null || updates.Text == "")
@@ -876,6 +886,8 @@ namespace GHelper
bool screenEnabled = (frequency >= 0);
Debug.WriteLine(frequency.ToString());
ButtonEnabled(button60Hz, screenEnabled);
ButtonEnabled(button120Hz, screenEnabled);
ButtonEnabled(buttonScreenAuto, screenEnabled);
@@ -1012,27 +1024,6 @@ namespace GHelper
}
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
{
if (this.Visible)
{
InitScreen();
InitXGM();
this.Left = Screen.FromControl(this).WorkingArea.Width - 10 - this.Width;
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
this.Activate();
aTimer.Enabled = true;
}
else
{
aTimer.Enabled = false;
}
}
private void SetPerformanceLabel()
{
labelPerf.Text = Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "");
@@ -1497,8 +1488,10 @@ namespace GHelper
public void InitXGM()
{
bool connected = Program.acpi.IsXGConnected();
buttonXGM.Enabled = buttonXGM.Visible = connected;
buttonXGM.Enabled = buttonXGM.Visible = Program.acpi.IsXGConnected();
if (!connected) return;
int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG);
if (activated < 0) return;