mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Panel UHD/FHD mode switch #2485
This commit is contained in:
@@ -79,6 +79,7 @@ public class AsusACPI
|
||||
public const uint ScreenOverdrive = 0x00050019;
|
||||
public const uint ScreenMiniled1 = 0x0005001E;
|
||||
public const uint ScreenMiniled2 = 0x0005002E;
|
||||
public const uint ScreenFHD = 0x0005001C;
|
||||
|
||||
public const uint DevsCPUFan = 0x00110022;
|
||||
public const uint DevsGPUFan = 0x00110023;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace GHelper.Display
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace GHelper.Display
|
||||
{
|
||||
public class ScreenControl
|
||||
{
|
||||
@@ -69,6 +71,18 @@
|
||||
InitScreen();
|
||||
}
|
||||
|
||||
public void ToogleFHD()
|
||||
{
|
||||
int fhd = Program.acpi.DeviceGet(AsusACPI.ScreenFHD);
|
||||
Logger.WriteLine($"FHD Toggle: {fhd}");
|
||||
|
||||
DialogResult dialogResult = MessageBox.Show("Changing display mode requires reboot", Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
||||
if (dialogResult == DialogResult.Yes)
|
||||
{
|
||||
Program.acpi.DeviceSet(AsusACPI.ScreenFHD, (fhd == 1) ? 0 : 1, "FHD");
|
||||
Process.Start("shutdown", "/r /t 1");
|
||||
}
|
||||
}
|
||||
|
||||
public int ToogleMiniled()
|
||||
{
|
||||
@@ -125,6 +139,12 @@
|
||||
|
||||
bool screenEnabled = (frequency >= 0);
|
||||
|
||||
int fhd = -1;
|
||||
if (AppConfig.IsDUO())
|
||||
{
|
||||
fhd = Program.acpi.DeviceGet(AsusACPI.ScreenFHD);
|
||||
}
|
||||
|
||||
AppConfig.Set("frequency", frequency);
|
||||
AppConfig.Set("overdrive", overdrive);
|
||||
|
||||
@@ -139,7 +159,8 @@
|
||||
overdriveSetting: overdriveSetting,
|
||||
miniled1: miniled1,
|
||||
miniled2: miniled2,
|
||||
hdr: hdr
|
||||
hdr: hdr,
|
||||
fhd: fhd
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
46
app/Settings.Designer.cs
generated
46
app/Settings.Designer.cs
generated
@@ -134,6 +134,7 @@ namespace GHelper
|
||||
labelGamma = new Label();
|
||||
pictureGamma = new PictureBox();
|
||||
labelGammaTitle = new Label();
|
||||
buttonFHD = new RButton();
|
||||
panelMatrix.SuspendLayout();
|
||||
panelMatrixAuto.SuspendLayout();
|
||||
tableLayoutMatrix.SuspendLayout();
|
||||
@@ -188,7 +189,7 @@ namespace GHelper
|
||||
panelMatrix.Controls.Add(tableLayoutMatrix);
|
||||
panelMatrix.Controls.Add(panelMatrixTitle);
|
||||
panelMatrix.Dock = DockStyle.Top;
|
||||
panelMatrix.Location = new Point(11, 1051);
|
||||
panelMatrix.Location = new Point(11, 1071);
|
||||
panelMatrix.Margin = new Padding(0);
|
||||
panelMatrix.Name = "panelMatrix";
|
||||
panelMatrix.Padding = new Padding(20, 20, 20, 11);
|
||||
@@ -368,7 +369,7 @@ namespace GHelper
|
||||
panelBattery.Controls.Add(sliderBattery);
|
||||
panelBattery.Controls.Add(panelBatteryTitle);
|
||||
panelBattery.Dock = DockStyle.Top;
|
||||
panelBattery.Location = new Point(11, 1705);
|
||||
panelBattery.Location = new Point(11, 1725);
|
||||
panelBattery.Margin = new Padding(0);
|
||||
panelBattery.Name = "panelBattery";
|
||||
panelBattery.Padding = new Padding(20, 20, 20, 11);
|
||||
@@ -460,7 +461,7 @@ namespace GHelper
|
||||
panelFooter.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
panelFooter.Controls.Add(tableButtons);
|
||||
panelFooter.Dock = DockStyle.Top;
|
||||
panelFooter.Location = new Point(11, 1881);
|
||||
panelFooter.Location = new Point(11, 1901);
|
||||
panelFooter.Margin = new Padding(0);
|
||||
panelFooter.Name = "panelFooter";
|
||||
panelFooter.Padding = new Padding(20);
|
||||
@@ -1040,7 +1041,7 @@ namespace GHelper
|
||||
panelScreen.Margin = new Padding(0);
|
||||
panelScreen.Name = "panelScreen";
|
||||
panelScreen.Padding = new Padding(20, 11, 20, 0);
|
||||
panelScreen.Size = new Size(827, 167);
|
||||
panelScreen.Size = new Size(827, 187);
|
||||
panelScreen.TabIndex = 2;
|
||||
panelScreen.TabStop = true;
|
||||
//
|
||||
@@ -1048,7 +1049,7 @@ namespace GHelper
|
||||
//
|
||||
labelTipScreen.Dock = DockStyle.Top;
|
||||
labelTipScreen.ForeColor = SystemColors.GrayText;
|
||||
labelTipScreen.Location = new Point(20, 131);
|
||||
labelTipScreen.Location = new Point(20, 151);
|
||||
labelTipScreen.Margin = new Padding(4, 0, 4, 0);
|
||||
labelTipScreen.Name = "labelTipScreen";
|
||||
labelTipScreen.Size = new Size(787, 36);
|
||||
@@ -1067,13 +1068,14 @@ namespace GHelper
|
||||
tableScreen.Controls.Add(button60Hz, 1, 0);
|
||||
tableScreen.Controls.Add(button120Hz, 2, 0);
|
||||
tableScreen.Controls.Add(buttonMiniled, 3, 0);
|
||||
tableScreen.Controls.Add(buttonFHD, 3, 0);
|
||||
tableScreen.Dock = DockStyle.Top;
|
||||
tableScreen.Location = new Point(20, 51);
|
||||
tableScreen.Margin = new Padding(8, 4, 8, 4);
|
||||
tableScreen.Name = "tableScreen";
|
||||
tableScreen.RowCount = 1;
|
||||
tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 80F));
|
||||
tableScreen.Size = new Size(787, 80);
|
||||
tableScreen.Size = new Size(787, 100);
|
||||
tableScreen.TabIndex = 23;
|
||||
//
|
||||
// buttonScreenAuto
|
||||
@@ -1207,7 +1209,7 @@ namespace GHelper
|
||||
panelKeyboard.Controls.Add(tableLayoutKeyboard);
|
||||
panelKeyboard.Controls.Add(panelKeyboardTitle);
|
||||
panelKeyboard.Dock = DockStyle.Top;
|
||||
panelKeyboard.Location = new Point(11, 1374);
|
||||
panelKeyboard.Location = new Point(11, 1394);
|
||||
panelKeyboard.Margin = new Padding(0);
|
||||
panelKeyboard.Name = "panelKeyboard";
|
||||
panelKeyboard.Padding = new Padding(20);
|
||||
@@ -1391,7 +1393,7 @@ namespace GHelper
|
||||
panelVersion.Controls.Add(labelCharge);
|
||||
panelVersion.Controls.Add(checkStartup);
|
||||
panelVersion.Dock = DockStyle.Top;
|
||||
panelVersion.Location = new Point(11, 1825);
|
||||
panelVersion.Location = new Point(11, 1845);
|
||||
panelVersion.Margin = new Padding(4);
|
||||
panelVersion.Name = "panelVersion";
|
||||
panelVersion.Size = new Size(827, 56);
|
||||
@@ -1417,7 +1419,7 @@ namespace GHelper
|
||||
panelPeripherals.Controls.Add(tableLayoutPeripherals);
|
||||
panelPeripherals.Controls.Add(panelPeripheralsTile);
|
||||
panelPeripherals.Dock = DockStyle.Top;
|
||||
panelPeripherals.Location = new Point(11, 1506);
|
||||
panelPeripherals.Location = new Point(11, 1526);
|
||||
panelPeripherals.Margin = new Padding(0);
|
||||
panelPeripherals.Name = "panelPeripherals";
|
||||
panelPeripherals.Padding = new Padding(20, 20, 20, 11);
|
||||
@@ -1559,7 +1561,7 @@ namespace GHelper
|
||||
panelAlly.Controls.Add(tableLayoutAlly);
|
||||
panelAlly.Controls.Add(panelAllyTitle);
|
||||
panelAlly.Dock = DockStyle.Top;
|
||||
panelAlly.Location = new Point(11, 1234);
|
||||
panelAlly.Location = new Point(11, 1254);
|
||||
panelAlly.Margin = new Padding(0);
|
||||
panelAlly.Name = "panelAlly";
|
||||
panelAlly.Padding = new Padding(20, 20, 20, 0);
|
||||
@@ -1696,7 +1698,7 @@ namespace GHelper
|
||||
panelGamma.Controls.Add(sliderGamma);
|
||||
panelGamma.Controls.Add(panelGammaTitle);
|
||||
panelGamma.Dock = DockStyle.Top;
|
||||
panelGamma.Location = new Point(11, 818);
|
||||
panelGamma.Location = new Point(11, 838);
|
||||
panelGamma.Margin = new Padding(0);
|
||||
panelGamma.Name = "panelGamma";
|
||||
panelGamma.Padding = new Padding(20, 11, 20, 11);
|
||||
@@ -1870,6 +1872,27 @@ namespace GHelper
|
||||
labelGammaTitle.TabIndex = 37;
|
||||
labelGammaTitle.Text = "Flicker-free Dimming";
|
||||
//
|
||||
// buttonFHD
|
||||
//
|
||||
buttonFHD.Activated = false;
|
||||
buttonFHD.BackColor = SystemColors.ControlLightLight;
|
||||
buttonFHD.BorderColor = Color.Transparent;
|
||||
buttonFHD.BorderRadius = 5;
|
||||
buttonFHD.CausesValidation = false;
|
||||
buttonFHD.Dock = DockStyle.Fill;
|
||||
buttonFHD.FlatAppearance.BorderSize = 0;
|
||||
buttonFHD.FlatStyle = FlatStyle.Flat;
|
||||
buttonFHD.ForeColor = SystemColors.ControlText;
|
||||
buttonFHD.Location = new Point(4, 84);
|
||||
buttonFHD.Margin = new Padding(4);
|
||||
buttonFHD.Name = "buttonFHD";
|
||||
buttonFHD.Secondary = false;
|
||||
buttonFHD.Size = new Size(188, 12);
|
||||
buttonFHD.TabIndex = 13;
|
||||
buttonFHD.Text = "FHD";
|
||||
buttonFHD.UseVisualStyleBackColor = false;
|
||||
buttonFHD.Visible = false;
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(192F, 192F);
|
||||
@@ -2071,5 +2094,6 @@ namespace GHelper
|
||||
private RComboBox comboColorTemp;
|
||||
private RButton buttonInstallColor;
|
||||
private Label labelVisual;
|
||||
private RButton buttonFHD;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ namespace GHelper
|
||||
button120Hz.Click += Button120Hz_Click;
|
||||
buttonScreenAuto.Click += ButtonScreenAuto_Click;
|
||||
buttonMiniled.Click += ButtonMiniled_Click;
|
||||
buttonFHD.Click += ButtonFHD_Click;
|
||||
|
||||
buttonQuit.Click += ButtonQuit_Click;
|
||||
|
||||
@@ -263,6 +264,11 @@ namespace GHelper
|
||||
InitVisual();
|
||||
}
|
||||
|
||||
private void ButtonFHD_Click(object? sender, EventArgs e)
|
||||
{
|
||||
screenControl.ToogleFHD();
|
||||
}
|
||||
|
||||
private void LabelCharge_Click(object? sender, EventArgs e)
|
||||
{
|
||||
BatteryControl.BatteryReport();
|
||||
@@ -1143,7 +1149,7 @@ namespace GHelper
|
||||
|
||||
|
||||
|
||||
public void VisualiseScreen(bool screenEnabled, bool screenAuto, int frequency, int maxFrequency, int overdrive, bool overdriveSetting, int miniled1, int miniled2, bool hdr)
|
||||
public void VisualiseScreen(bool screenEnabled, bool screenAuto, int frequency, int maxFrequency, int overdrive, bool overdriveSetting, int miniled1, int miniled2, bool hdr, int fhd)
|
||||
{
|
||||
|
||||
ButtonEnabled(button60Hz, screenEnabled);
|
||||
@@ -1182,6 +1188,12 @@ namespace GHelper
|
||||
panelScreen.Visible = false;
|
||||
}
|
||||
|
||||
if (fhd >= 0)
|
||||
{
|
||||
buttonFHD.Visible = true;
|
||||
buttonFHD.Text = fhd > 0 ? "FHD" : "UHD";
|
||||
}
|
||||
|
||||
if (miniled1 >= 0)
|
||||
{
|
||||
buttonMiniled.Enabled = !hdr;
|
||||
|
||||
Reference in New Issue
Block a user