mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
improve arranger selection display
This commit is contained in:
parent
cdb5390795
commit
41946cb095
1 changed files with 27 additions and 14 deletions
|
|
@ -80,13 +80,14 @@ render!(Arranger |self, buf, area| {
|
|||
});
|
||||
fill_bg(buf, area, Nord::bg_lo(self.focused, self.entered));
|
||||
area = if self.mode {
|
||||
self.draw_horizontal(buf, area)
|
||||
self.draw_horizontal(buf, area)?
|
||||
} else {
|
||||
self.draw_vertical(buf, area)
|
||||
}?;
|
||||
if self.focused && self.entered {
|
||||
Corners(Style::default().green().not_dim()).draw(buf, area)?;
|
||||
}
|
||||
let area = self.draw_vertical(buf, area)?;
|
||||
if self.focused && self.entered && self.selected == ArrangerFocus::Mix {
|
||||
Corners(Style::default().green().not_dim()).draw(buf, area)?;
|
||||
};
|
||||
area
|
||||
};
|
||||
Ok(area)
|
||||
});
|
||||
|
||||
|
|
@ -143,12 +144,16 @@ impl Arranger {
|
|||
if playing { "" } else { " " }.blit(buf, x+1, y, style)?;
|
||||
scene.name.blit(buf, x + 2, y, style)?;
|
||||
if self.selected.scene() == Some(scene_index) {
|
||||
let bg = if self.selected == ArrangerFocus::Scene(scene_index) {
|
||||
bg_hi
|
||||
let selected = self.selected == ArrangerFocus::Scene(scene_index);
|
||||
let area = Rect { x, y, width, height: 2 };
|
||||
if selected {
|
||||
fill_bg(buf, area, bg_hi);
|
||||
if self.focused && self.entered {
|
||||
Corners(Style::default().green().not_dim()).draw(buf, area)?;
|
||||
}
|
||||
} else {
|
||||
bg_lo
|
||||
};
|
||||
fill_bg(buf, Rect { x, y, width, height: 2 }, bg)
|
||||
fill_bg(buf, area, bg_lo);
|
||||
}
|
||||
}
|
||||
}
|
||||
let width = 2 + self.scenes.iter()
|
||||
|
|
@ -164,7 +169,7 @@ impl Arranger {
|
|||
break
|
||||
}
|
||||
let width = 16u16;
|
||||
track.name.blit(buf, x, y, Some(Style::default().bold()))?;
|
||||
track.name.blit(buf, x + 1, y, Some(Style::default().bold()))?;
|
||||
for (scene_index, scene) in self.scenes.iter().enumerate() {
|
||||
if y + 2 * scene_index as u16 >= height {
|
||||
break
|
||||
|
|
@ -186,11 +191,19 @@ impl Arranger {
|
|||
if self.selected == ArrangerFocus::Clip(track_index, scene_index) {
|
||||
fill_bg(buf, Rect { x: area.x, y, width: area.width, height: 2 }, bg_lo);
|
||||
fill_bg(buf, Rect { x, y: area.y, width, height: area.height }, bg_lo);
|
||||
fill_bg(buf, Rect { x, y, width, height: 2 }, bg_hi);
|
||||
let area = Rect { x, y, width, height: 2 };
|
||||
fill_bg(buf, area, bg_hi);
|
||||
if self.focused && self.entered {
|
||||
Corners(Style::default().green().not_dim()).draw(buf, area)?;
|
||||
};
|
||||
}
|
||||
}
|
||||
if self.selected == ArrangerFocus::Track(track_index) {
|
||||
fill_bg(buf, Rect { x, y: area.y, width, height: 1 }, bg_hi)
|
||||
fill_bg(buf, Rect { x, y: area.y, width, height: 1 }, bg_hi);
|
||||
if self.focused && self.entered {
|
||||
Corners(Style::default().green().not_dim())
|
||||
.draw(buf, Rect { x, y: area.y, width, height })?;
|
||||
};
|
||||
}
|
||||
x = x + width as u16;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue