aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
blob: 8f8a20971e4f2c23c988422704c579f72c80686c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use ratatui::widgets::ListState;

use crate::gentoo::{Package, portage::Portage};

#[derive(Debug)]
#[allow(dead_code)]
pub struct App {
    portage: Portage,
    pub list_state: ListState,
}

#[allow(dead_code)]
impl App {
    pub fn new(portage: Portage) -> Self {
        App {
            portage,
            list_state: ListState::default().with_selected(Some(0)),
        }
    }

    pub fn installed_packages(&self) -> Vec<Package> {
        self.portage.installed_packages.clone()
    }
}