# HG changeset patch # User moel.mich # Date 1305492532 0 # Node ID 1f5cf5d533e6764a71c07592ec7745f7c1e7154a # Parent 48d7e8d6c0db23e5cad969b08077eb03ab6ab022 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. diff -r 48d7e8d6c0db -r 1f5cf5d533e6 GUI/MainForm.Designer.cs --- a/GUI/MainForm.Designer.cs Sun May 15 17:21:27 2011 +0000 +++ b/GUI/MainForm.Designer.cs Sun May 15 20:48:52 2011 +0000 @@ -77,6 +77,8 @@ this.saveReportMenuItem = new System.Windows.Forms.MenuItem(); this.sumbitReportMenuItem = 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.viewMenuItem = new System.Windows.Forms.MenuItem(); this.resetMinMaxMenuItem = new System.Windows.Forms.MenuItem(); @@ -108,8 +110,6 @@ this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv(); this.treeView = new Aga.Controls.Tree.TreeViewAdv(); 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.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); @@ -165,6 +165,7 @@ this.nodeTextBoxText.LeftMargin = 3; this.nodeTextBoxText.ParentColumn = this.sensor; this.nodeTextBoxText.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; + this.nodeTextBoxText.UseCompatibleTextRendering = true; // // nodeTextBoxValue // @@ -173,6 +174,7 @@ this.nodeTextBoxValue.LeftMargin = 3; this.nodeTextBoxValue.ParentColumn = this.value; this.nodeTextBoxValue.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; + this.nodeTextBoxValue.UseCompatibleTextRendering = true; // // nodeTextBoxMin // @@ -181,6 +183,7 @@ this.nodeTextBoxMin.LeftMargin = 3; this.nodeTextBoxMin.ParentColumn = this.min; this.nodeTextBoxMin.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; + this.nodeTextBoxMin.UseCompatibleTextRendering = true; // // nodeTextBoxMax // @@ -189,6 +192,7 @@ this.nodeTextBoxMax.LeftMargin = 3; this.nodeTextBoxMax.ParentColumn = this.max; this.nodeTextBoxMax.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; + this.nodeTextBoxMax.UseCompatibleTextRendering = true; // // mainMenu // @@ -227,6 +231,17 @@ this.MenuItem2.Index = 2; 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 // this.exitMenuItem.Index = 5; @@ -448,6 +463,7 @@ this.treeView.UseColumns = true; this.treeView.NodeMouseDoubleClick += new System.EventHandler(this.treeView_NodeMouseDoubleClick); this.treeView.Click += new System.EventHandler(this.treeView_Click); + this.treeView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseMove); // // plotPanel // @@ -457,17 +473,6 @@ this.plotPanel.Size = new System.Drawing.Size(386, 124); 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 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff -r 48d7e8d6c0db -r 1f5cf5d533e6 GUI/MainForm.cs --- a/GUI/MainForm.cs Sun May 15 17:21:27 2011 +0000 +++ b/GUI/MainForm.cs Sun May 15 20:48:52 2011 +0000 @@ -120,7 +120,7 @@ int p = (int)Environment.OSVersion.Platform; 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.Border3DStyle = Border3DStyle.Adjust; splitContainer.SplitterWidth = 4; @@ -131,7 +131,7 @@ minTrayMenuItem.Visible = false; startMinMenuItem.Visible = false; } 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.HideShowCommand += hideShowClick; @@ -627,5 +627,11 @@ // restore the MainIcon setting 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); + } + } } } diff -r 48d7e8d6c0db -r 1f5cf5d533e6 GUI/MainForm.resx --- a/GUI/MainForm.resx Sun May 15 17:21:27 2011 +0000 +++ b/GUI/MainForm.resx Sun May 15 20:48:52 2011 +0000 @@ -118,16 +118,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 226, 17 + 373, 17 - - 334, 17 + + 17, 17 - 17, 17 + 164, 17 - 146, 17 + 293, 17 diff -r 48d7e8d6c0db -r 1f5cf5d533e6 GUI/SensorNode.cs --- a/GUI/SensorNode.cs Sun May 15 17:21:27 2011 +0000 +++ b/GUI/SensorNode.cs Sun May 15 20:48:52 2011 +0000 @@ -67,7 +67,7 @@ this.settings = settings; this.unitManager = unitManager; 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.Load: format = "{0:F1} %"; break; case SensorType.Temperature: format = "{0:F1} °C"; break;