Repository: lapce/lapce
File: lapce-ui/src/editor/tab.rs (Rust)

Code before:
                } else if self.mouse_pos.y
                    < header_size.height + content_height / 3.0
                {
                    Size::new(width, content_height / 2.0)
                        .to_rect()
                        .with_origin(Point::new(0.0, header_height))
                } else if self.mouse_pos.y
                    > header_size.height + content_height / 3.0 * 2.0
                {
                    Size::new(width, content_height / 2.0)
                        .to_rect()
                        .with_origin(Point::new(
                            0.0,
                            header_height + content_height / 2.0,
                        ))
                } else {
                    Size::new(width, content_height)
                        .to_rect()
                        .with_origin(Point::new(0.0, header_height))
                };
                ctx.with_save(|ctx| {
                    ctx.incr_alpha_depth();
                    ctx.fill(
                        rect,
                        &data
                            .config
                            .get_color_unchecked(LapceTheme::EDITOR_CURRENT_LINE)
                            .clone()
                            .with_alpha(0.8),
                    );
                });
            }
        }
        ctx.with_save(|ctx| {
            ctx.incr_alpha_depth();
            self.header.paint(ctx, data, env);
        });
    }
}

pub trait TabRectRenderer {
    fn paint(
        &self,
        ctx: &mut PaintCtx,
        data: &LapceTabData,
        widget_id: WidgetId,
        tab_idx: usize,
        size: Size,
        mouse_pos: Option<Point>,
    );
}

Review comment (suggestion):
How about ```LapceTheme::DRAG_DROP_BACKGROUND``` which could used by panel drag and drop

Code after:
                } else if self.mouse_pos.y
                    < header_size.height + content_height / 3.0
                {
                    Size::new(width, content_height / 2.0)
                        .to_rect()
                        .with_origin(Point::new(0.0, header_height))
                } else if self.mouse_pos.y
                    > header_size.height + content_height / 3.0 * 2.0
                {
                    Size::new(width, content_height / 2.0)
                        .to_rect()
                        .with_origin(Point::new(
                            0.0,
                            header_height + content_height / 2.0,
                        ))
                } else {
                    Size::new(width, content_height)
                        .to_rect()
                        .with_origin(Point::new(0.0, header_height))
                };
                ctx.with_save(|ctx| {
                    ctx.incr_alpha_depth();
                    ctx.fill(
                        rect,
                        data.config.get_color_unchecked(
                            LapceTheme::EDITOR_SPLIT_DROP_BACKGROUND,
                        ),
                    );
                });
            }
        }
        ctx.with_save(|ctx| {
            ctx.incr_alpha_depth();
            self.header.paint(ctx, data, env);
        });
    }
}

pub trait TabRectRenderer {
    fn paint(
        &self,
        ctx: &mut PaintCtx,
        data: &LapceTabData,
        widget_id: WidgetId,
        tab_idx: usize,
        size: Size,
        mouse_pos: Option<Point>,
    );
}

impl TabRectRenderer for TabRect {