/// <summary> /// Given the item and the subitem, calculate its bounds. /// </summary> /// <param name="item"></param> /// <param name="subItem"></param> /// <returns></returns> public Rectangle CalculateItemBounds(OLVListItem item, OLVListSubItem subItem) { if (item == null) { return(Rectangle.Empty); } if (subItem == null) { return(item.Bounds); } else { return(item.GetSubItemBounds(item.SubItems.IndexOf(subItem))); } }
public Color bg_color(OLVListItem item, int col_idx) { match_item i = item.RowObject as match_item; int row_idx = item.Index; Color color; bool is_sel = !ignore_selection?parent_.multi_sel_idx.Contains(row_idx) : false; Color bg = i.bg(parent_); Color dark_bg = i.sel_bg(parent_); if (col_idx == parent_.msgCol.fixed_index()) { if (is_sel) { color = is_sel ? dark_bg : bg; } else if (app.inst.use_bg_gradient) { Rectangle r = item.GetSubItemBounds(col_idx); if (r.Width > 0 && r.Height > 0) { // it's a gradient color = util.transparent; } else { color = bg; } } else { color = bg; } } else { color = is_sel ? dark_bg : bg; } if (color == util.transparent) { color = app.inst.bg; } return(color); }
public Brush bg_brush(OLVListItem item, int col_idx) { match_item i = item.RowObject as match_item; int row_idx = item.Index; if (col_idx == parent_.msgCol.fixed_index()) { bool is_sel = !ignore_selection?parent_.multi_sel_idx.Contains(row_idx) : false; if (!is_sel && app.inst.use_bg_gradient) { Rectangle r = item.GetSubItemBounds(col_idx); if (r.Width > 0 && r.Height > 0) { return(gradient_.brush(r, app.inst.bg_from, app.inst.bg_to)); } } } return(brush_.brush(bg_color(item, col_idx))); }
/// <summary> /// Given the item and the subitem, calculate its bounds. /// </summary> /// <param name="item"></param> /// <param name="subItem"></param> /// <returns></returns> public Rectangle CalculateItemBounds(OLVListItem item, OLVListSubItem subItem) { if (item == null) return Rectangle.Empty; if (subItem == null) return item.Bounds; else return item.GetSubItemBounds(item.SubItems.IndexOf(subItem)); }