mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
labels and icons
This commit is contained in:
parent
3e748fefa7
commit
eb0547dc37
6 changed files with 19 additions and 18 deletions
|
|
@ -66,6 +66,9 @@ impl HasClipsSize for App {
|
|||
//});
|
||||
|
||||
impl App {
|
||||
pub fn update_clock (&self) {
|
||||
ViewCache::update_clock(&self.view_cache, self.clock(), self.size.w() > 80)
|
||||
}
|
||||
pub fn toggle_dialog (&mut self, mut dialog: Option<Dialog>) -> Option<Dialog> {
|
||||
std::mem::swap(&mut self.dialog, &mut dialog);
|
||||
dialog
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@ use crate::*;
|
|||
pub(crate) use std::fmt::Write;
|
||||
pub(crate) use ::tengri::tui::ratatui::prelude::Position;
|
||||
|
||||
impl App {
|
||||
|
||||
pub fn update_clock (&self) {
|
||||
ViewCache::update_clock(&self.view_cache, self.clock(), self.size.w() > 80)
|
||||
}
|
||||
}
|
||||
|
||||
#[tengri_proc::view(TuiOut)]
|
||||
impl App {
|
||||
pub fn view_nil (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
|
|
@ -95,7 +88,11 @@ impl App {
|
|||
cache.bpm.view.clone(), cache.beat.view.clone(), cache.time.view.clone())
|
||||
}
|
||||
pub fn view_editor (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.editor()
|
||||
let bg = self.editor()
|
||||
.and_then(|editor|editor.clip().clone())
|
||||
.map(|clip|clip.read().unwrap().color.darker)
|
||||
.unwrap_or(self.color.darker);
|
||||
Fill::xy(Tui::bg(bg.rgb, self.editor()))
|
||||
}
|
||||
pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.editor().map(|e|Fixed::x(20, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue