mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-04-04 05:10:44 +02:00
rgb highlights
This commit is contained in:
parent
6724f3848d
commit
f9fa24de0d
5 changed files with 203 additions and 109 deletions
19
src/view.rs
19
src/view.rs
|
|
@ -33,6 +33,7 @@ render!(App |self, buf, area| {
|
|||
buf,
|
||||
area: Rect { x, y, width, height: height / 3 },
|
||||
focused: self.section == 0,
|
||||
entered: self.entered,
|
||||
scenes: &self.scenes,
|
||||
tracks: &self.tracks,
|
||||
cursor: &(self.track_cursor, self.scene_cursor),
|
||||
|
|
@ -42,6 +43,7 @@ render!(App |self, buf, area| {
|
|||
buf,
|
||||
area: Rect { x, y, width, height: height / 3 },
|
||||
focused: self.section == 0,
|
||||
entered: self.entered,
|
||||
scenes: &self.scenes,
|
||||
tracks: &self.tracks,
|
||||
cursor: &(self.track_cursor, self.scene_cursor),
|
||||
|
|
@ -68,7 +70,7 @@ render!(App |self, buf, area| {
|
|||
phrase,
|
||||
focused: self.section == 2,
|
||||
ppq: self.timebase.ppq() as usize,
|
||||
now: self.timebase.pulse_to_frame(self.playhead as f64) as usize,
|
||||
now: self.timebase.frame_to_pulse(self.playhead as f64) as usize,
|
||||
time_cursor: self.time_cursor,
|
||||
time_start: self.time_start,
|
||||
time_zoom: self.time_zoom,
|
||||
|
|
@ -107,3 +109,18 @@ render!(App |self, buf, area| {
|
|||
|
||||
Ok(area)
|
||||
});
|
||||
|
||||
pub fn fill_bg (buf: &mut Buffer, area: Rect, color: Color) {
|
||||
let Rect { x, y, width, height } = area;
|
||||
for y in y..y+height {
|
||||
if y >= buf.area.height {
|
||||
break
|
||||
}
|
||||
for x in x..x+width {
|
||||
if x >= buf.area.width {
|
||||
break
|
||||
}
|
||||
buf.get_mut(x, y).set_bg(color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue