bg() public method

public bg ( log_view parent ) : Color
parent log_view
return Color
Exemplo n.º 1
0
        public Color print_bg_color(OLVListItem item, text_part print)
        {
            match_item i      = item.RowObject as match_item;
            bool       is_sel = !ignore_selection?parent_sel.Contains(item.Index) : false;

            Color default_bg = i.bg(parent_);
            Color bg         = print.bg != util.transparent ? print.bg : default_bg;

            if (bg == util.transparent)
            {
                bg = app.inst.bg;
            }
            // selection needs a bit of dark
            if (is_sel)
            {
                bg = sel_bg_color(bg);
            }

            if (print.is_typed_search && !print.is_find_search)
            {
                // 1.7.22 - don't use the overridden background - we want to have the same background for all finds
                bg = util.darker_color(default_bg);
            }
            return(bg);
        }
Exemplo n.º 2
0
        private Color bg_color(OLVListItem item)
        {
            match_item i       = item.RowObject as match_item;
            int        row_idx = item.Index;

            bool is_sel = !ignore_selection?parent_sel.Contains(row_idx) : false;

            Color bg      = i.bg(parent_);
            Color dark_bg = sel_bg_color(bg);

            var color = is_sel ? dark_bg : bg;

            Debug.Assert(color != util.transparent);
            return(color);
        }
Exemplo n.º 3
0
        public Color sel_bg_color()
        {
            int row_idx = parent_.sel_row_idx;

            if (row_idx < 0)
            {
                return(drawer_.sel_bg_color(app.inst.bg));
            }
            int        col_idx  = parent_.cur_col_idx;
            match_item i        = parent_.item_at(row_idx);
            var        col_type = log_view_cell.cell_idx_to_type(col_idx);
            var        txt      = log_view_cell.cell_value_by_type(i, col_type);
            var        print    = category_formatted(cache_.override_print(i, txt, row_idx, col_idx), i, col_type);
            var        bg       = i.bg(parent_);

            return(drawer_.sel_bg_color(print.bg != util.transparent ? print.bg : bg));
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public Color print_bg_color(OLVListItem item, print_info print)
        {
            match_item i  = item.RowObject as match_item;
            Color      bg = print.bg != util.transparent ? print.bg : util.darker_color(i.bg(parent_));

            if (bg == util.transparent)
            {
                bg = app.inst.bg;
            }
            return(bg);
        }