GUI/SensorNotifyIcon.cs
changeset 70 dc69dc4d7512
parent 57 142907c75be4
child 72 c4dfd596a6c3
     1.1 --- a/GUI/SensorNotifyIcon.cs	Tue Mar 02 22:26:07 2010 +0000
     1.2 +++ b/GUI/SensorNotifyIcon.cs	Tue Mar 02 22:52:37 2010 +0000
     1.3 @@ -59,6 +59,7 @@
     1.4      private Brush brush;
     1.5      private Brush darkBrush;
     1.6      private Pen pen;
     1.7 +    private Font font;
     1.8  
     1.9      public SensorNotifyIcon(SensorSystemTray sensorSystemTray, ISensor sensor,
    1.10        bool balloonTip) 
    1.11 @@ -73,6 +74,7 @@
    1.12        Color = Config.Get(sensor.Identifier + "/traycolor", defaultColor);      
    1.13        
    1.14        this.pen = new Pen(Color.FromArgb(96, Color.Black));
    1.15 +      this.font = new Font(SystemFonts.StatusFont.FontFamily, 9);
    1.16  
    1.17        ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
    1.18        ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove");
    1.19 @@ -134,6 +136,7 @@
    1.20        if (darkBrush != null)
    1.21          darkBrush.Dispose();
    1.22        pen.Dispose();
    1.23 +      font.Dispose();
    1.24        graphics.Dispose();
    1.25        graphics = null;
    1.26        bitmap.Dispose();
    1.27 @@ -161,7 +164,7 @@
    1.28      private Icon CreateTransparentIcon() {
    1.29  
    1.30        graphics.Clear(Color.Black);
    1.31 -      TextRenderer.DrawText(graphics, GetString(), SystemFonts.StatusFont,
    1.32 +      TextRenderer.DrawText(graphics, GetString(), font,
    1.33          new Point(-2, 0), Color.White, Color.Black);
    1.34  
    1.35        BitmapData data = bitmap.LockBits(