mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-13 15:16:41 +01:00
refactor: view constructors from App
This commit is contained in:
parent
1e3d96e64e
commit
b01863dfdc
5 changed files with 88 additions and 102 deletions
|
|
@ -8,6 +8,16 @@ pub struct ChainView<'a> {
|
|||
pub vertical: bool,
|
||||
}
|
||||
|
||||
impl<'a> ChainView<'a> {
|
||||
pub fn new (app: &'a App, vertical: bool) -> Self {
|
||||
Self {
|
||||
focused: app.section == AppSection::Chain,
|
||||
track: app.tracks.get(app.track_cursor - 1),
|
||||
vertical
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Render for ChainView<'a> {
|
||||
fn render (&self, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
|
||||
let style = Some(if self.focused {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue