+2006-07-17 Mike Kestner <mkestner@novell.com>
+
+ * ListViewItem.cs: restructure Font and subitem Font handling
+ to hold a specific font and refer back to owner on null.
+ Fixes #78761.
+
2006-07-17 Mike Kestner <mkestner@novell.com>
* ToolBar.cs: bandaid for side-effect of previous patch which was
Rectangle item_rect;
Rectangle label_rect;
ListView owner;
+ Font font;
bool selected;
internal int row;
this.image_index = imageIndex;
ForeColor = foreColor;
BackColor = backColor;
- Font = font;
+ this.font = font;
}
#endregion // Public Constructors
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public Font Font {
get {
- if (sub_items.Count > 0)
- return sub_items[0].Font;
-
- if (owner != null)
+ if (font != null)
+ return font;
+ else if (owner != null)
return owner.Font;
return ThemeEngine.Current.DefaultFont;
}
set {
- if (sub_items[0].Font == value)
+ if (font == value)
return;
- sub_items[0].Font = value;
+ font = value;
if (owner != null)
Layout ();
public ListViewSubItem (ListViewItem owner, string text)
: this (owner, text, ThemeEngine.Current.ColorWindowText,
- ThemeEngine.Current.ColorWindow,
- ThemeEngine.Current.DefaultFont)
+ ThemeEngine.Current.ColorWindow, null)
{
}
return font;
else if (owner != null)
return owner.Font;
- return font;
+ return ThemeEngine.Current.DefaultFont;
}
set {
+ if (font == value)
+ return;
font = value;
Invalidate ();
}