Added some GUI improvements: Better handling of the row selection, minimal row spacing of 18 pixel (to get nice dotted lines) and 3 decimal digits for voltages. Also changed the tree view font rendering to get better quality without ClearType.

This commit is contained in:
Michael Möller 2011-05-15 20:48:52 +00:00
parent 0fb52a4723
commit 58fcb67dcd
4 changed files with 33 additions and 22 deletions

View File

@ -77,6 +77,8 @@ namespace OpenHardwareMonitor.GUI {
this.saveReportMenuItem = new System.Windows.Forms.MenuItem(); this.saveReportMenuItem = new System.Windows.Forms.MenuItem();
this.sumbitReportMenuItem = new System.Windows.Forms.MenuItem(); this.sumbitReportMenuItem = new System.Windows.Forms.MenuItem();
this.MenuItem2 = new System.Windows.Forms.MenuItem(); this.MenuItem2 = new System.Windows.Forms.MenuItem();
this.resetMenuItem = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.exitMenuItem = new System.Windows.Forms.MenuItem(); this.exitMenuItem = new System.Windows.Forms.MenuItem();
this.viewMenuItem = new System.Windows.Forms.MenuItem(); this.viewMenuItem = new System.Windows.Forms.MenuItem();
this.resetMinMaxMenuItem = new System.Windows.Forms.MenuItem(); this.resetMinMaxMenuItem = new System.Windows.Forms.MenuItem();
@ -108,8 +110,6 @@ namespace OpenHardwareMonitor.GUI {
this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv(); this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv();
this.treeView = new Aga.Controls.Tree.TreeViewAdv(); this.treeView = new Aga.Controls.Tree.TreeViewAdv();
this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel(); this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel();
this.resetMenuItem = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout(); this.splitContainer.SuspendLayout();
@ -165,6 +165,7 @@ namespace OpenHardwareMonitor.GUI {
this.nodeTextBoxText.LeftMargin = 3; this.nodeTextBoxText.LeftMargin = 3;
this.nodeTextBoxText.ParentColumn = this.sensor; this.nodeTextBoxText.ParentColumn = this.sensor;
this.nodeTextBoxText.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; this.nodeTextBoxText.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
this.nodeTextBoxText.UseCompatibleTextRendering = true;
// //
// nodeTextBoxValue // nodeTextBoxValue
// //
@ -173,6 +174,7 @@ namespace OpenHardwareMonitor.GUI {
this.nodeTextBoxValue.LeftMargin = 3; this.nodeTextBoxValue.LeftMargin = 3;
this.nodeTextBoxValue.ParentColumn = this.value; this.nodeTextBoxValue.ParentColumn = this.value;
this.nodeTextBoxValue.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; this.nodeTextBoxValue.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
this.nodeTextBoxValue.UseCompatibleTextRendering = true;
// //
// nodeTextBoxMin // nodeTextBoxMin
// //
@ -181,6 +183,7 @@ namespace OpenHardwareMonitor.GUI {
this.nodeTextBoxMin.LeftMargin = 3; this.nodeTextBoxMin.LeftMargin = 3;
this.nodeTextBoxMin.ParentColumn = this.min; this.nodeTextBoxMin.ParentColumn = this.min;
this.nodeTextBoxMin.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; this.nodeTextBoxMin.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
this.nodeTextBoxMin.UseCompatibleTextRendering = true;
// //
// nodeTextBoxMax // nodeTextBoxMax
// //
@ -189,6 +192,7 @@ namespace OpenHardwareMonitor.GUI {
this.nodeTextBoxMax.LeftMargin = 3; this.nodeTextBoxMax.LeftMargin = 3;
this.nodeTextBoxMax.ParentColumn = this.max; this.nodeTextBoxMax.ParentColumn = this.max;
this.nodeTextBoxMax.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; this.nodeTextBoxMax.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
this.nodeTextBoxMax.UseCompatibleTextRendering = true;
// //
// mainMenu // mainMenu
// //
@ -227,6 +231,17 @@ namespace OpenHardwareMonitor.GUI {
this.MenuItem2.Index = 2; this.MenuItem2.Index = 2;
this.MenuItem2.Text = "-"; this.MenuItem2.Text = "-";
// //
// resetMenuItem
//
this.resetMenuItem.Index = 3;
this.resetMenuItem.Text = "Reset";
this.resetMenuItem.Click += new System.EventHandler(this.resetClick);
//
// menuItem6
//
this.menuItem6.Index = 4;
this.menuItem6.Text = "-";
//
// exitMenuItem // exitMenuItem
// //
this.exitMenuItem.Index = 5; this.exitMenuItem.Index = 5;
@ -448,6 +463,7 @@ namespace OpenHardwareMonitor.GUI {
this.treeView.UseColumns = true; this.treeView.UseColumns = true;
this.treeView.NodeMouseDoubleClick += new System.EventHandler<Aga.Controls.Tree.TreeNodeAdvMouseEventArgs>(this.treeView_NodeMouseDoubleClick); this.treeView.NodeMouseDoubleClick += new System.EventHandler<Aga.Controls.Tree.TreeNodeAdvMouseEventArgs>(this.treeView_NodeMouseDoubleClick);
this.treeView.Click += new System.EventHandler(this.treeView_Click); this.treeView.Click += new System.EventHandler(this.treeView_Click);
this.treeView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseMove);
// //
// plotPanel // plotPanel
// //
@ -457,17 +473,6 @@ namespace OpenHardwareMonitor.GUI {
this.plotPanel.Size = new System.Drawing.Size(386, 124); this.plotPanel.Size = new System.Drawing.Size(386, 124);
this.plotPanel.TabIndex = 0; this.plotPanel.TabIndex = 0;
// //
// resetMenuItem
//
this.resetMenuItem.Index = 3;
this.resetMenuItem.Text = "Reset";
this.resetMenuItem.Click += new System.EventHandler(this.resetClick);
//
// menuItem6
//
this.menuItem6.Index = 4;
this.menuItem6.Text = "-";
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -120,7 +120,7 @@ namespace OpenHardwareMonitor.GUI {
int p = (int)Environment.OSVersion.Platform; int p = (int)Environment.OSVersion.Platform;
if ((p == 4) || (p == 128)) { // Unix if ((p == 4) || (p == 128)) { // Unix
treeView.RowHeight = Math.Max(treeView.RowHeight, 17); treeView.RowHeight = Math.Max(treeView.RowHeight, 18);
splitContainer.BorderStyle = BorderStyle.None; splitContainer.BorderStyle = BorderStyle.None;
splitContainer.Border3DStyle = Border3DStyle.Adjust; splitContainer.Border3DStyle = Border3DStyle.Adjust;
splitContainer.SplitterWidth = 4; splitContainer.SplitterWidth = 4;
@ -131,7 +131,7 @@ namespace OpenHardwareMonitor.GUI {
minTrayMenuItem.Visible = false; minTrayMenuItem.Visible = false;
startMinMenuItem.Visible = false; startMinMenuItem.Visible = false;
} else { // Windows } else { // Windows
treeView.RowHeight = Math.Max(treeView.Font.Height + 1, 17); treeView.RowHeight = Math.Max(treeView.Font.Height + 1, 18);
gadget = new SensorGadget(computer, settings, unitManager); gadget = new SensorGadget(computer, settings, unitManager);
gadget.HideShowCommand += hideShowClick; gadget.HideShowCommand += hideShowClick;
@ -627,5 +627,11 @@ namespace OpenHardwareMonitor.GUI {
// restore the MainIcon setting // restore the MainIcon setting
systemTray.IsMainIconEnabled = minimizeToTray.Value; systemTray.IsMainIconEnabled = minimizeToTray.Value;
} }
private void treeView_MouseMove(object sender, MouseEventArgs e) {
if ((e.Button & (MouseButtons.Left | MouseButtons.Right)) > 0) {
treeView.SelectedNode = treeView.GetNodeAt(e.Location);
}
}
} }
} }

View File

@ -118,16 +118,16 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 17</value> <value>373, 17</value>
</metadata> </metadata>
<metadata name="sensorContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="treeContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>334, 17</value>
</metadata>
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>164, 17</value>
</metadata>
<metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>146, 17</value> <value>293, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -67,7 +67,7 @@ namespace OpenHardwareMonitor.GUI {
this.settings = settings; this.settings = settings;
this.unitManager = unitManager; this.unitManager = unitManager;
switch (sensor.SensorType) { switch (sensor.SensorType) {
case SensorType.Voltage: format = "{0:F2} V"; break; case SensorType.Voltage: format = "{0:F3} V"; break;
case SensorType.Clock: format = "{0:F0} MHz"; break; case SensorType.Clock: format = "{0:F0} MHz"; break;
case SensorType.Load: format = "{0:F1} %"; break; case SensorType.Load: format = "{0:F1} %"; break;
case SensorType.Temperature: format = "{0:F1} °C"; break; case SensorType.Temperature: format = "{0:F1} °C"; break;