Merge pull request #355 from PhilipDaniels/terminal_painting

Make terminal paint in proper background color
This commit is contained in:
Dongdong Zhou 2022-04-03 16:52:51 +00:00 committed by GitHub
commit e2edd74690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -345,6 +345,8 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
}
}
/// This struct is used as the outer container for a panel,
/// it contains the heading such as "Terminal" or "File Explorer".
pub struct PanelMainHeader {
text: String,
icons: Vec<LapceIcon>,
@ -517,6 +519,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
data.config
.get_color_unchecked(LapceTheme::LAPCE_DROPDOWN_SHADOW),
);
ctx.fill(
rect,
data.config

View File

@ -84,6 +84,8 @@ pub fn new(
}
}
/// This struct represents the main body of the terminal, i.e. the part
/// where the shell is presented.
pub struct TerminalPanel {
widget_id: WidgetId,
split: WidgetPod<LapceTabData, LapceSplitNew>,
@ -189,6 +191,11 @@ fn layout(
}
fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
let rect = ctx.size().to_rect();
ctx.fill(
rect,
data.config.get_color_unchecked(LapceTheme::TERMINAL_BACKGROUND),
);
self.split.paint(ctx, data, env);
}
}
@ -289,7 +296,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
ctx.fill(
rect,
data.config
.get_color_unchecked(LapceTheme::EDITOR_BACKGROUND),
.get_color_unchecked(LapceTheme::TERMINAL_BACKGROUND),
);
});