mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
almost sane focus higlighting
This commit is contained in:
parent
4c9eed6fce
commit
c06b9d16e2
4 changed files with 30 additions and 31 deletions
|
|
@ -1,11 +1,11 @@
|
|||
use crate::prelude::*;
|
||||
|
||||
pub struct Chain {
|
||||
name: String,
|
||||
focused: bool,
|
||||
focus: usize,
|
||||
items: Vec<Box<dyn Device>>,
|
||||
view: ChainView
|
||||
pub name: String,
|
||||
pub focused: bool,
|
||||
pub focus: usize,
|
||||
pub items: Vec<Box<dyn Device>>,
|
||||
pub view: ChainView
|
||||
}
|
||||
|
||||
pub enum ChainView {
|
||||
|
|
@ -97,7 +97,7 @@ pub fn render (state: &Chain, buf: &mut Buffer, area: Rect)
|
|||
|
||||
pub fn draw_as_row (
|
||||
state: &Chain, buf: &mut Buffer, area: Rect, selected: Option<Style>
|
||||
) -> Usually<Rect> {
|
||||
) -> Usually<(Rect, Vec<Rect>)> {
|
||||
let Rect { mut x, mut y, width, height } = area;
|
||||
let mut w = 0u16;
|
||||
let mut h = 0u16;
|
||||
|
|
@ -113,7 +113,7 @@ pub fn draw_as_row (
|
|||
h = h.max(frame.height);
|
||||
x = x + frame.width;
|
||||
}
|
||||
Ok(area)
|
||||
Ok((area, frames))
|
||||
}
|
||||
|
||||
pub fn draw_as_column (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue