# HG changeset patch # User moel.mich # Date 1267570357 0 # Node ID dc69dc4d751297a123ae64eb9e93090c9f9ca157 # Parent 5f539c00e925158dc8d5ba64438d0220d33b4ded Set the system tray icon font to a fixed size. Fixed the exiting of the application when the form was never shown and Close() is called. diff -r 5f539c00e925 -r dc69dc4d7512 GUI/MainForm.cs --- a/GUI/MainForm.cs Tue Mar 02 22:26:07 2010 +0000 +++ b/GUI/MainForm.cs Tue Mar 02 22:52:37 2010 +0000 @@ -157,6 +157,9 @@ } else { Show(); } + + // Create a handle, otherwise calling Close() does not fire FormClosed + CreateHandle(); } private void SubHardwareAdded(IHardware hardware, Node node) { @@ -233,7 +236,7 @@ } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { - Close(); + Close(); } private void timer_Tick(object sender, EventArgs e) { diff -r 5f539c00e925 -r dc69dc4d7512 GUI/SensorNotifyIcon.cs --- a/GUI/SensorNotifyIcon.cs Tue Mar 02 22:26:07 2010 +0000 +++ b/GUI/SensorNotifyIcon.cs Tue Mar 02 22:52:37 2010 +0000 @@ -59,6 +59,7 @@ private Brush brush; private Brush darkBrush; private Pen pen; + private Font font; public SensorNotifyIcon(SensorSystemTray sensorSystemTray, ISensor sensor, bool balloonTip) @@ -73,6 +74,7 @@ Color = Config.Get(sensor.Identifier + "/traycolor", defaultColor); this.pen = new Pen(Color.FromArgb(96, Color.Black)); + this.font = new Font(SystemFonts.StatusFont.FontFamily, 9); ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove"); @@ -134,6 +136,7 @@ if (darkBrush != null) darkBrush.Dispose(); pen.Dispose(); + font.Dispose(); graphics.Dispose(); graphics = null; bitmap.Dispose(); @@ -161,7 +164,7 @@ private Icon CreateTransparentIcon() { graphics.Clear(Color.Black); - TextRenderer.DrawText(graphics, GetString(), SystemFonts.StatusFont, + TextRenderer.DrawText(graphics, GetString(), font, new Point(-2, 0), Color.White, Color.Black); BitmapData data = bitmap.LockBits( diff -r 5f539c00e925 -r dc69dc4d7512 Properties/AssemblyInfo.cs --- a/Properties/AssemblyInfo.cs Tue Mar 02 22:26:07 2010 +0000 +++ b/Properties/AssemblyInfo.cs Tue Mar 02 22:52:37 2010 +0000 @@ -69,5 +69,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.24.3")] -[assembly: AssemblyFileVersion("0.1.24.3")] +[assembly: AssemblyVersion("0.1.25.0")] +[assembly: AssemblyFileVersion("0.1.25.0")]