mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-05 00:35:18 +00:00
Small corrections to improve the DPI awareness (display scaling).
This commit is contained in:
@@ -112,8 +112,14 @@ namespace OpenHardwareMonitor.GUI {
|
||||
nodeTextBoxMax.DrawText += nodeTextBoxText_DrawText;
|
||||
nodeTextBoxText.EditorShowing += nodeTextBoxText_EditorShowing;
|
||||
|
||||
this.sensor.Width = DpiHelper.LogicalToDeviceUnits(250);
|
||||
this.value.Width = DpiHelper.LogicalToDeviceUnits(100);
|
||||
this.min.Width = DpiHelper.LogicalToDeviceUnits(100);
|
||||
this.max.Width = DpiHelper.LogicalToDeviceUnits(100);
|
||||
|
||||
foreach (TreeColumn column in treeView.Columns)
|
||||
column.Width = Math.Max(20, Math.Min(400,
|
||||
column.Width = Math.Max(DpiHelper.LogicalToDeviceUnits(20), Math.Min(
|
||||
DpiHelper.LogicalToDeviceUnits(400),
|
||||
settings.GetValue("treeView.Columns." + column.Header + ".Width",
|
||||
column.Width)));
|
||||
|
||||
@@ -131,7 +137,8 @@ namespace OpenHardwareMonitor.GUI {
|
||||
systemTray.ExitCommand += exitClick;
|
||||
|
||||
if (Hardware.OperatingSystem.IsUnix) { // Unix
|
||||
treeView.RowHeight = Math.Max(treeView.RowHeight, 18);
|
||||
treeView.RowHeight = Math.Max(treeView.RowHeight,
|
||||
DpiHelper.LogicalToDeviceUnits(18));
|
||||
splitContainer.BorderStyle = BorderStyle.None;
|
||||
splitContainer.Border3DStyle = Border3DStyle.Adjust;
|
||||
splitContainer.SplitterWidth = 4;
|
||||
@@ -142,7 +149,9 @@ namespace OpenHardwareMonitor.GUI {
|
||||
minTrayMenuItem.Visible = false;
|
||||
startMinMenuItem.Visible = false;
|
||||
} else { // Windows
|
||||
treeView.RowHeight = Math.Max(treeView.Font.Height + 1, 18);
|
||||
treeView.RowHeight = Math.Max(treeView.Font.Height +
|
||||
DpiHelper.LogicalToDeviceUnits(1),
|
||||
DpiHelper.LogicalToDeviceUnits(18));
|
||||
|
||||
gadget = new SensorGadget(computer, settings, unitManager);
|
||||
gadget.HideShowCommand += hideShowClick;
|
||||
@@ -617,8 +626,10 @@ namespace OpenHardwareMonitor.GUI {
|
||||
Rectangle newBounds = new Rectangle {
|
||||
X = settings.GetValue("mainForm.Location.X", Location.X),
|
||||
Y = settings.GetValue("mainForm.Location.Y", Location.Y),
|
||||
Width = settings.GetValue("mainForm.Width", 470),
|
||||
Height = settings.GetValue("mainForm.Height", 640)
|
||||
Width = settings.GetValue("mainForm.Width",
|
||||
DpiHelper.LogicalToDeviceUnits(470)),
|
||||
Height = settings.GetValue("mainForm.Height",
|
||||
DpiHelper.LogicalToDeviceUnits(640))
|
||||
};
|
||||
|
||||
Rectangle fullWorkingArea = new Rectangle(int.MaxValue, int.MaxValue,
|
||||
|
Reference in New Issue
Block a user