2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / NotifyIcon.cs
index 446bdaf1bf975fa7842225d9531fd4de7efc69c3..a8e675f47e49fa1a9b6bce66dd6946fc9b948bb0 100644 (file)
@@ -135,8 +135,6 @@ namespace System.Windows.Forms {
                                        int             y;
                                        int             size;\r
 \r
-Console.WriteLine("CalculateIconRect: Width:{0}, Height:{1}", Width, Height);\r
-\r
                                        // Icons are always square. Try to center them in the window\r
                                        if (ClientRectangle.Width < ClientRectangle.Height) {\r
                                                size = ClientRectangle.Width;\r
@@ -148,8 +146,13 @@ Console.WriteLine("CalculateIconRect: Width:{0}, Height:{1}", Width, Height);
                                        rect = new Rectangle(x, y, size, size);\r
 \r
                                        // Force our window to be square\r
-                                       this.Width = size;\r
-                                       this.Height = size;\r
+                                       if (Width != size) {\r
+                                               this.Width = size;\r
+                                       }\r
+\r
+                                       if (Height != size) {\r
+                                               this.Height = size;\r
+                                       }\r
                                }\r
                        }\r
 \r