final refactors
This commit is contained in:
+7
-2
@@ -13,7 +13,6 @@ use ratatui::widgets::{Block, Paragraph, StatefulWidget, Widget, Wrap};
|
||||
use crate::utils::rgba8_to_color;
|
||||
|
||||
/// View state for the log panel.
|
||||
#[derive(Default)]
|
||||
pub struct LogState {
|
||||
/// Whether the log panel is currently open.
|
||||
pub open: bool,
|
||||
@@ -23,10 +22,16 @@ pub struct LogState {
|
||||
pub scroll: u16,
|
||||
}
|
||||
|
||||
impl Default for LogState {
|
||||
fn default() -> Self {
|
||||
Self { open: false, height: 10, scroll: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
impl LogState {
|
||||
/// Creates a `LogState` with sensible defaults (closed, 10 rows tall).
|
||||
pub fn new() -> Self {
|
||||
Self { open: false, height: 10, scroll: 0 }
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Toggles the panel open or closed, resetting scroll to the top on open.
|
||||
|
||||
Reference in New Issue
Block a user