mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 13:46:42 +01:00
change Layout to output minimum size (breaks Align::Center?)
This commit is contained in:
parent
0737769232
commit
1a0e06dc66
13 changed files with 232 additions and 162 deletions
|
|
@ -317,9 +317,9 @@ impl Handle<Tui> for TransportBPM<Tui> {
|
|||
}
|
||||
impl Widget for TransportBPM<Tui> {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
fn layout (&self, area: [u16;2]) -> Perhaps<[u16;2]> {
|
||||
area.expect_min(10, 1)?;
|
||||
Ok(Some([area.x(), area.y(), 10, 1]))
|
||||
Ok(Some([10, 1]))
|
||||
}
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
let area = to.area();
|
||||
|
|
@ -371,9 +371,9 @@ impl Handle<Tui> for TransportQuantize<Tui> {
|
|||
}
|
||||
impl Widget for TransportQuantize<Tui> {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
fn layout (&self, area: [u16;2]) -> Perhaps<[u16;2]> {
|
||||
area.expect_min(10, 1)?;
|
||||
Ok(Some([area.x(), area.y(), 10, 1]))
|
||||
Ok(Some([10, 1]))
|
||||
}
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
let [x, y, ..] = to.area();
|
||||
|
|
@ -424,9 +424,9 @@ impl Handle<Tui> for TransportSync<Tui> {
|
|||
}
|
||||
impl Widget for TransportSync<Tui> {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
fn layout (&self, area: [u16;2]) -> Perhaps<[u16;2]> {
|
||||
area.expect_min(10, 1)?;
|
||||
Ok(Some([area.x(), area.y(), 10, 1]))
|
||||
Ok(Some([10, 1]))
|
||||
}
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
let [x, y, ..] = to.area();
|
||||
|
|
@ -470,9 +470,9 @@ impl Handle<Tui> for TransportClock<Tui> {
|
|||
}
|
||||
impl Widget for TransportClock<Tui> {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
area.expect_min(10, 1)?;
|
||||
Ok(Some([area.x(), area.y(), 20, 1]))
|
||||
fn layout (&self, area: [u16;2]) -> Perhaps<[u16;2]> {
|
||||
area.expect_min(20, 1)?;
|
||||
Ok(Some([20, 1]))
|
||||
}
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
let [x, y, width, _] = to.area();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue