ui: make StatusPanel grid growable
parent
776dc107c2
commit
1d6ef92a4f
|
@ -225,7 +225,8 @@ impl Component for StatusPanel {
|
||||||
|
|
||||||
impl StatusPanel {
|
impl StatusPanel {
|
||||||
pub fn new() -> StatusPanel {
|
pub fn new() -> StatusPanel {
|
||||||
let content = CellBuffer::new(120, 40, Cell::default());
|
let mut content = CellBuffer::new(120, 40, Cell::default());
|
||||||
|
content.set_growable(true);
|
||||||
|
|
||||||
StatusPanel {
|
StatusPanel {
|
||||||
cursor: (0, 0),
|
cursor: (0, 0),
|
||||||
|
|
|
@ -765,17 +765,21 @@ macro_rules! inspect_bounds {
|
||||||
let bounds = $grid.size();
|
let bounds = $grid.size();
|
||||||
let (upper_left, bottom_right) = $area;
|
let (upper_left, bottom_right) = $area;
|
||||||
if $x > (get_x(bottom_right)) || $x > get_x(bounds) {
|
if $x > (get_x(bottom_right)) || $x > get_x(bounds) {
|
||||||
$x = get_x(upper_left);
|
if $grid.growable {
|
||||||
$y += 1;
|
$grid.resize($grid.cols * 2, $grid.rows, Cell::default());
|
||||||
if $y > (get_y(bottom_right)) || $y > get_y(bounds) {
|
} else {
|
||||||
if $grid.growable {
|
$x = get_x(upper_left);
|
||||||
$grid.resize($grid.cols, $grid.rows * 2, Cell::default());
|
$y += 1;
|
||||||
} else {
|
if !$line_break {
|
||||||
return ($x, $y - 1);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !$line_break {
|
}
|
||||||
break;
|
if $y > (get_y(bottom_right)) || $y > get_y(bounds) {
|
||||||
|
if $grid.growable {
|
||||||
|
$grid.resize($grid.cols, $grid.rows * 2, Cell::default());
|
||||||
|
} else {
|
||||||
|
return ($x, $y - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue