about ui tweak
},
config::LapceTheme,
data::LapceTabData,
+ proxy::VERSION,
};
use crate::svg::get_svg;
@@ -284,7 +285,7 @@ fn layout(
.new_text_layout("About Lapce")
.font(
data.config.ui.font_family(),
- data.config.ui.font_size() as f64,
+ (data.config.ui.font_size() as f64 * 1.2).round(),
)
.default_attribute(TextAttribute::Weight(FontWeight::BOLD))
.alignment(TextAlignment::Center)
@@ -341,7 +342,7 @@ fn layout(
msg_layout.clone(),
Point::new(self.padding, y),
)]);
- y += msg_layout.size().height;
+ y += msg_layout.size().height + 5.0;
}
self.close_rect = Size::new(20.0, 20.0)
@@ -380,7 +381,28 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
);
let mut y = self.title.as_ref().unwrap().1.y
- + self.title.as_ref().unwrap().0.size().height;
+ + self.title.as_ref().unwrap().0.size().height
+ + 15.0;
+
+ let ver_layout = ctx
+ .text()
+ .new_text_layout(format!("Version: {}", *VERSION))
+ .set_line_height(1.2)
+ .alignment(TextAlignment::Center)
+ .max_width(self.width - self.padding * 2.0)
+ .font(
+ data.config.ui.font_family(),
+ (data.config.ui.font_size()) as f64,
+ )
+ .text_color(
+ data.config
+ .get_color_unchecked(LapceTheme::EDITOR_FOREGROUND)
+ .clone(),
+ )
+ .build()
+ .unwrap();
+ ctx.draw_text(&ver_layout, Point::new(self.padding, y));
+ y += ver_layout.size().height + 5.0;
for (msg, link) in [
("Website", URI_LAPCE),
@@ -426,7 +448,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
));
ctx.draw_text(&left_item, Point::new(self.padding, y));
- y += left_item.size().height;
+ y += left_item.size().height + 5.0;
}
if self.close_rect.contains(self.mouse_pos) {
