@@ -112,8 +112,14 @@ public MainForm() {
112112 nodeTextBoxMax . DrawText += nodeTextBoxText_DrawText ;
113113 nodeTextBoxText . EditorShowing += nodeTextBoxText_EditorShowing ;
114114
115+ this . sensor . Width = DpiHelper . LogicalToDeviceUnits ( 250 ) ;
116+ this . value . Width = DpiHelper . LogicalToDeviceUnits ( 100 ) ;
117+ this . min . Width = DpiHelper . LogicalToDeviceUnits ( 100 ) ;
118+ this . max . Width = DpiHelper . LogicalToDeviceUnits ( 100 ) ;
119+
115120 foreach ( TreeColumn column in treeView . Columns )
116- column . Width = Math . Max ( 20 , Math . Min ( 400 ,
121+ column . Width = Math . Max ( DpiHelper . LogicalToDeviceUnits ( 20 ) , Math . Min (
122+ DpiHelper . LogicalToDeviceUnits ( 400 ) ,
117123 settings . GetValue ( "treeView.Columns." + column . Header + ".Width" ,
118124 column . Width ) ) ) ;
119125
@@ -131,7 +137,8 @@ public MainForm() {
131137 systemTray . ExitCommand += exitClick ;
132138
133139 if ( Hardware . OperatingSystem . IsUnix ) { // Unix
134- treeView . RowHeight = Math . Max ( treeView . RowHeight , 18 ) ;
140+ treeView . RowHeight = Math . Max ( treeView . RowHeight ,
141+ DpiHelper . LogicalToDeviceUnits ( 18 ) ) ;
135142 splitContainer . BorderStyle = BorderStyle . None ;
136143 splitContainer . Border3DStyle = Border3DStyle . Adjust ;
137144 splitContainer . SplitterWidth = 4 ;
@@ -142,7 +149,9 @@ public MainForm() {
142149 minTrayMenuItem . Visible = false ;
143150 startMinMenuItem . Visible = false ;
144151 } else { // Windows
145- treeView . RowHeight = Math . Max ( treeView . Font . Height + 1 , 18 ) ;
152+ treeView . RowHeight = Math . Max ( treeView . Font . Height +
153+ DpiHelper . LogicalToDeviceUnits ( 1 ) ,
154+ DpiHelper . LogicalToDeviceUnits ( 18 ) ) ;
146155
147156 gadget = new SensorGadget ( computer , settings , unitManager ) ;
148157 gadget . HideShowCommand += hideShowClick ;
@@ -617,8 +626,10 @@ private void MainForm_Load(object sender, EventArgs e) {
617626 Rectangle newBounds = new Rectangle {
618627 X = settings . GetValue ( "mainForm.Location.X" , Location . X ) ,
619628 Y = settings . GetValue ( "mainForm.Location.Y" , Location . Y ) ,
620- Width = settings . GetValue ( "mainForm.Width" , 470 ) ,
621- Height = settings . GetValue ( "mainForm.Height" , 640 )
629+ Width = settings . GetValue ( "mainForm.Width" ,
630+ DpiHelper . LogicalToDeviceUnits ( 470 ) ) ,
631+ Height = settings . GetValue ( "mainForm.Height" ,
632+ DpiHelper . LogicalToDeviceUnits ( 640 ) )
622633 } ;
623634
624635 Rectangle fullWorkingArea = new Rectangle ( int . MaxValue , int . MaxValue ,
0 commit comments