* Application.cs: fix compilation errors when debug is enabled.
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ToolBarButton.cs
index 0eb0f64b2e1e6cc7fe80da7602fbf6a1aa00bd59..037b4ec731c2198443a737a72a002b82cd8a0970 100644 (file)
@@ -74,7 +74,7 @@ namespace System.Windows.Forms
                                        return;
 
                                hilight = value;
-                               InvalidateBorder ();
+                               Invalidate ();
                        }
                }
 
@@ -330,10 +330,10 @@ namespace System.Windows.Forms
                        
                        if (Parent.TextAlign == ToolBarTextAlign.Underneath) {
                                new_image_rect = new Rectangle ((bounds.Size.Width - image_size.Width) / 2 - grip, 0, image_size.Width + 2 + grip, image_size.Height + 2 * grip);
-                               new_text_rect = new Rectangle (0, new_image_rect.Height, bounds.Size.Width, bounds.Size.Height - new_image_rect.Height);
+                               new_text_rect = new Rectangle (0, new_image_rect.Height, bounds.Size.Width, bounds.Size.Height - new_image_rect.Height - 2 * grip);
                        } else {
                                new_image_rect = new Rectangle (0, 0, image_size.Width + 2 * grip, image_size.Height + 2 * grip);
-                               new_text_rect = new Rectangle (new_image_rect.Width, 0, bounds.Size.Width - new_image_rect.Width, bounds.Size.Height);
+                               new_text_rect = new Rectangle (new_image_rect.Width, 0, bounds.Size.Width - new_image_rect.Width, bounds.Size.Height - 2 * grip);
                        }
 
                        bool changed = false;
@@ -389,28 +389,7 @@ namespace System.Windows.Forms
                        return size;
                }
 
-               internal void InvalidateBorder ()
-               {
-                       if (ThemeEngine.Current.ToolBarInvalidateEntireButton) {
-                               Invalidate ();
-                       }
-                       else {
-                               if (Rectangle == Rectangle.Empty)
-                                       return;
-
-                               /* invalidate the four sides of our border */
-                               Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y - 2,
-                                                                 Rectangle.Width + 4, 4));
-                               Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y - 2,
-                                                                 4, Rectangle.Height + 4));
-                               Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y + Rectangle.Height - 2,
-                                                                 Rectangle.Width + 4, 4));
-                               Parent.Invalidate (new Rectangle (Rectangle.X + Rectangle.Width - 2, Rectangle.Y - 2,
-                                                                 4, Rectangle.Height + 4));
-                       }
-               }
-
-               void Invalidate ()
+               internal void Invalidate ()
                {
                        if (Parent != null)
                                Parent.Invalidate (Rectangle);