sel_bg() public method

public sel_bg ( log_view parent ) : Color
parent log_view
return Color
        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 void update_ui()
        {
            if (parent_ == null)
            {
                return;
            }
            if (ignore_change_ > 0)
            {
                return;
            }

            var  bounds  = parent_.sel_subrect_bounds;
            bool visible = should_be_visible();

            if (!visible)
            {
                Visible = false;
                return;
            }

            int offset_x = parent_.list.Left + 4;
            int offset_y = parent_.list.Top;
            var location = new Point(offset_x + bounds.X, offset_y + bounds.Y + 2);

            if (location.Y + bounds.Height > parent_.Height)
            {
                // it was the last row when user is moving down (down arrow) - we'll get notified again
                last_force_invisible_ = DateTime.Now;
                Visible = false;
                return;
            }
            int header_height = parent_.list.HeaderControl.ClientRectangle.Height;

            if (location.Y < offset_y + header_height)
            {
                // it was the first row when user is moving up (up arrow), we'll get notified again
                last_force_invisible_ = DateTime.Now;
                Visible = false;
                return;
            }

            ++ignore_change_;

            Location = location;
            Size     = new Size(bounds.Width, bounds.Height);
            Font     = parent_.list.Font;

            match_item i = parent_.sel;

            ForeColor = i.fg(parent_);
            BackColor = i.sel_bg(parent_);

            set_text(false);
            SelectionBackColor      = BackColor;
            SelectionColor          = ForeColor;
            changed_sel_background_ = false;

            // make visible only after we've properly set the location (otherwise, we would flicker)
            Visible = true;

            if (sel_start_ >= 0 && sel_start_ <= TextLength)
            {
                SelectionStart = sel_start_;
            }
            else if (TextLength > 0)
            {
                // our selection is bigger than what we have in the current cell
                SelectionStart = TextLength;
            }

            if (sel_start_ >= 0 && sel_start_ <= TextLength)
            {
                if (sel_len_ >= 0 && sel_len_ + sel_start_ <= TextLength)
                {
                    SelectionLength = sel_len_;
                }
            }

            --ignore_change_;
        }