# HG changeset patch
# User moel.mich
# Date 1342640759 0
# Node ID 667c75cad9372887ff8cb6a9eaae34c09550ee00
# Parent  a8a8ff22d95932813e246e6f9b35b2243dd1728d
Changed the system tray icon font scaling to adapt to the size of the tray icon in pixels, because on Windows 7 the tray icon scales with the system font size, while on Windows XP the tray icons are always 16 pixels large.
diff -r a8a8ff22d959 -r 667c75cad937 GUI/SensorNotifyIcon.cs
--- a/GUI/SensorNotifyIcon.cs	Tue Jul 17 16:12:07 2012 +0000
+++ b/GUI/SensorNotifyIcon.cs	Wed Jul 18 19:45:59 2012 +0000
@@ -53,8 +53,6 @@
         "traycolor").ToString(), defaultColor);      
       
       this.pen = new Pen(Color.FromArgb(96, Color.Black));
-      this.font = SystemFonts.MessageBoxFont;
-      this.smallFont = new Font(font.FontFamily, font.Size * 0.8f);
 
       ContextMenu contextMenu = new ContextMenu();
       MenuItem hideShowItem = new MenuItem("Hide/Show");
@@ -88,7 +86,7 @@
       this.notifyIcon.ContextMenu = contextMenu;
       this.notifyIcon.DoubleClick += delegate(object obj, EventArgs args) {
         sensorSystemTray.SendHideShowCommand();
-      };
+      };      
 
       // get the default dpi to create an icon with the correct size
       float dpiX, dpiY;
@@ -102,8 +100,22 @@
       int height = (int)Math.Round(16 * dpiY / 96);
 
       // make sure it does never get smaller than 16x16
-      width = width < 16 ? 16: width;
-      height = height < 16 ? 16: height;
+      width = width < 16 ? 16 : width;
+      height = height < 16 ? 16 : height;
+
+      // adjust the font size to the icon size
+      FontFamily family = SystemFonts.MessageBoxFont.FontFamily;
+      float baseSize;
+      switch (family.Name) {
+        case "Segoe UI": baseSize = 12; break;
+        case "Tahoma": baseSize = 11; break;
+        default: baseSize = 12; break;
+      }
+
+      this.font = new Font(family,
+        baseSize * width / 16.0f, GraphicsUnit.Pixel);
+      this.smallFont = new Font(family, 
+        0.75f * baseSize * width / 16.0f, GraphicsUnit.Pixel);
 
       this.bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);      
       this.graphics = Graphics.FromImage(this.bitmap);
@@ -151,6 +163,7 @@
       pen.Dispose();
       graphics.Dispose();      
       bitmap.Dispose();
+      font.Dispose();
       smallFont.Dispose();
     }
 
@@ -169,7 +182,7 @@
           if (unitManager.TemperatureUnit == TemperatureUnit.Fahrenheit)
             return string.Format("{0:F0}", 
               UnitManager.CelsiusToFahrenheit(sensor.Value));
-          else 
+          else
             return string.Format("{0:F0}", sensor.Value);
         case SensorType.Fan: 
           return string.Format("{0:F1}", 1e-3f * sensor.Value);
diff -r a8a8ff22d959 -r 667c75cad937 OpenHardwareMonitor.csproj
--- a/OpenHardwareMonitor.csproj	Tue Jul 17 16:12:07 2012 +0000
+++ b/OpenHardwareMonitor.csproj	Wed Jul 18 19:45:59 2012 +0000
@@ -173,7 +173,9 @@
   
   
     
-    
+    
+      Designer
+    
     
   
   
diff -r a8a8ff22d959 -r 667c75cad937 Properties/AssemblyVersion.cs
--- a/Properties/AssemblyVersion.cs	Tue Jul 17 16:12:07 2012 +0000
+++ b/Properties/AssemblyVersion.cs	Wed Jul 18 19:45:59 2012 +0000
@@ -10,5 +10,5 @@
 
 using System.Reflection;
 
-[assembly: AssemblyVersion("0.4.0.17")]
-[assembly: AssemblyInformationalVersion("0.4.0.17 Alpha")]
\ No newline at end of file
+[assembly: AssemblyVersion("0.4.0.18")]
+[assembly: AssemblyInformationalVersion("0.4.0.18 Alpha")]
\ No newline at end of file
diff -r a8a8ff22d959 -r 667c75cad937 Resources/app.manifest
--- a/Resources/app.manifest	Tue Jul 17 16:12:07 2012 +0000
+++ b/Resources/app.manifest	Wed Jul 18 19:45:59 2012 +0000
@@ -1,5 +1,9 @@
 
-
+
   
     
       
@@ -7,4 +11,9 @@
       
     
   
+  
+    
+      true
+    
+