mirror of https://github.com/lapce/lapce.git
editor tab minum width
This commit is contained in:
parent
7b0dcda389
commit
06456edf11
|
@ -8,6 +8,7 @@ font-family = ""
|
|||
font-size = 13
|
||||
header-height = 30
|
||||
status-height = 25
|
||||
tab-min-width = 100
|
||||
activity-width = 50
|
||||
scroll-width = 10
|
||||
drop-shadow = true
|
||||
|
|
|
@ -170,6 +170,9 @@ pub struct UIConfig {
|
|||
#[field_names(desc = "Set the height for status line")]
|
||||
status_height: usize,
|
||||
|
||||
#[field_names(desc = "Set the minium width for editor tab")]
|
||||
tab_min_width: usize,
|
||||
|
||||
#[field_names(desc = "Set the width for activity bar")]
|
||||
activity_width: usize,
|
||||
|
||||
|
@ -203,6 +206,10 @@ pub fn status_height(&self) -> usize {
|
|||
self.status_height.max(font_size)
|
||||
}
|
||||
|
||||
pub fn tab_min_width(&self) -> usize {
|
||||
self.tab_min_width
|
||||
}
|
||||
|
||||
pub fn activity_width(&self) -> usize {
|
||||
self.activity_width
|
||||
}
|
||||
|
|
|
@ -386,7 +386,8 @@ fn layout(
|
|||
.build()
|
||||
.unwrap();
|
||||
let text_size = text_layout.size();
|
||||
let width = (text_size.width + height * 2.0).max(100.0);
|
||||
let width = (text_size.width + height * 2.0)
|
||||
.max(data.config.ui.tab_min_width() as f64);
|
||||
let close_size = 24.0;
|
||||
let inflate = (height - close_size) / 2.0;
|
||||
let tab_rect = TabRect {
|
||||
|
|
|
@ -953,7 +953,8 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
|
|||
if ctx.is_hot() {
|
||||
ctx.fill(
|
||||
rect,
|
||||
data.config.get_color_unchecked(LapceTheme::PANEL_HOVERED),
|
||||
data.config
|
||||
.get_color_unchecked(LapceTheme::EDITOR_CURRENT_LINE),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue