@@ -112,8 +112,14 @@ public MainForm() {
112
112
nodeTextBoxMax . DrawText += nodeTextBoxText_DrawText ;
113
113
nodeTextBoxText . EditorShowing += nodeTextBoxText_EditorShowing ;
114
114
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
+
115
120
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 ) ,
117
123
settings . GetValue ( "treeView.Columns." + column . Header + ".Width" ,
118
124
column . Width ) ) ) ;
119
125
@@ -131,7 +137,8 @@ public MainForm() {
131
137
systemTray . ExitCommand += exitClick ;
132
138
133
139
if ( Hardware . OperatingSystem . IsUnix ) { // Unix
134
- treeView . RowHeight = Math . Max ( treeView . RowHeight , 18 ) ;
140
+ treeView . RowHeight = Math . Max ( treeView . RowHeight ,
141
+ DpiHelper . LogicalToDeviceUnits ( 18 ) ) ;
135
142
splitContainer . BorderStyle = BorderStyle . None ;
136
143
splitContainer . Border3DStyle = Border3DStyle . Adjust ;
137
144
splitContainer . SplitterWidth = 4 ;
@@ -142,7 +149,9 @@ public MainForm() {
142
149
minTrayMenuItem . Visible = false ;
143
150
startMinMenuItem . Visible = false ;
144
151
} 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 ) ) ;
146
155
147
156
gadget = new SensorGadget ( computer , settings , unitManager ) ;
148
157
gadget . HideShowCommand += hideShowClick ;
@@ -617,8 +626,10 @@ private void MainForm_Load(object sender, EventArgs e) {
617
626
Rectangle newBounds = new Rectangle {
618
627
X = settings . GetValue ( "mainForm.Location.X" , Location . X ) ,
619
628
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 ) )
622
633
} ;
623
634
624
635
Rectangle fullWorkingArea = new Rectangle ( int . MaxValue , int . MaxValue ,
0 commit comments