mirror of https://github.com/lapce/lapce.git
feat: add `plugin load failed` message
This commit is contained in:
parent
a84be09123
commit
cdf3d5d009
|
@ -158,6 +158,24 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
let viewport = ctx.size().to_rect().inflate(-padding, 0.0);
|
||||
ctx.clip(viewport);
|
||||
|
||||
if data.plugins.is_empty() {
|
||||
let y = self.line_height;
|
||||
let x = self.line_height;
|
||||
let layout = ctx
|
||||
.text()
|
||||
.new_text_layout("Failed to load plugin information")
|
||||
.font(
|
||||
data.config.ui.font_family(),
|
||||
data.config.ui.font_size() as f64,
|
||||
)
|
||||
.default_attribute(TextAttribute::Weight(FontWeight::BOLD))
|
||||
.text_color(Color::from_hex_str("#ffb900").unwrap())
|
||||
.build()
|
||||
.unwrap();
|
||||
ctx.draw_text(&layout, Point::new(x, y));
|
||||
return;
|
||||
}
|
||||
|
||||
for (i, plugin) in data.plugins.iter().enumerate() {
|
||||
let y = 3.0 * self.line_height * i as f64;
|
||||
let x = 3.0 * self.line_height;
|
||||
|
|
Loading…
Reference in New Issue