Rectangle invalid = Rectangle.Empty;
- if (selected_node != null)
- invalid = selected_node.Bounds;
- if (focused_node != null)
- invalid = Rectangle.Union (focused_node.Bounds, invalid);
- invalid = Rectangle.Union (invalid, value.Bounds);
+ if (selected_node != null) {
+ invalid = Bloat (selected_node.Bounds);
+ }
+ if (focused_node != null) {
+ invalid = Rectangle.Union (invalid,
+ Bloat (focused_node.Bounds));
+ }
+
+ invalid = Rectangle.Union (invalid, Bloat (value.Bounds));
selected_node = value;
focused_node = value;
invalid.X = 0;
invalid.Width = ViewportRectangle.Width;
}
- invalid.Y += 2;
-
+
Invalidate (invalid);
// We ensure its visible after we update because
}
}
+ private Rectangle Bloat (Rectangle rect)
+ {
+ rect.Y--;
+ rect.X--;
+ rect.Height += 2;
+ rect.Width += 2;
+ return rect;
+ }
+
[DefaultValue(true)]
public bool ShowLines {
get { return show_lines; }
}
// We need to update the current node so the plus/minus block gets update too
- Rectangle invalid = new Rectangle (0, node.Bounds.Top + 2, Width, Height - node.Bounds.Top);
+ Rectangle invalid = new Rectangle (0, node.Bounds.Top - 1,
+ Width, Height - node.Bounds.Top + 1);
Invalidate (invalid);
}
return;
}
- Rectangle invalid = new Rectangle (0, node.Bounds.Top + 2, Width, node.Bounds.Height);
+ Rectangle invalid = new Rectangle (0, node.Bounds.Top - 1, Width,
+ node.Bounds.Height + 1);
Invalidate (invalid);
}
dc.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (BackColor), clip);
+ Color dash_color = ControlPaint.Dark (BackColor);
+ if (dash_color == BackColor)
+ dash_color = ControlPaint.Light (BackColor);
+ dash = new Pen (dash_color, 1);
+ dash.DashStyle = DashStyle.Dash;
+
int depth = 0;
int item_height = ItemHeight;
int height = ClientRectangle.Height;
select_mmove = true;
if (old_selected != null) {
- Invalidate (Rectangle.Union (old_selected.Bounds,
- selected_node.Bounds));
+ Invalidate (Rectangle.Union (Bloat (old_selected.Bounds),
+ Bloat (selected_node.Bounds)));
} else {
- Invalidate (selected_node.Bounds);
+ Invalidate (Bloat (selected_node.Bounds));
}
}
Rectangle invalid;
if (!ce.Cancel) {
- if (focused_node != null)
- invalid = Rectangle.Union (focused_node.Bounds, selected_node.Bounds);
- else
- invalid = selected_node.Bounds;
+ if (focused_node != null) {
+ invalid = Rectangle.Union (Bloat (focused_node.Bounds),
+ Bloat (selected_node.Bounds));
+ } else {
+ invalid = Bloat (selected_node.Bounds);
+ }
focused_node = selected_node;
OnAfterSelect (new TreeViewEventArgs (selected_node, TreeViewAction.ByMouse));
- invalid.Y -= 2;
- invalid.X -= 2;
- invalid.Height += 4;
- invalid.Width += 4;
+
Invalidate (invalid);
} else {
selected_node = focused_node;