mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +00:00
36 lines
702 B
Rust
36 lines
702 B
Rust
|
use menu::*;
|
||
|
use theme::ColorPair;
|
||
|
use printer::Printer;
|
||
|
use event::*;
|
||
|
|
||
|
use std::rc::Rc;
|
||
|
|
||
|
pub struct Menubar {
|
||
|
pub menu: MenuTree,
|
||
|
pub autohide: bool,
|
||
|
pub selected: bool,
|
||
|
}
|
||
|
|
||
|
impl Menubar {
|
||
|
pub fn new() -> Self {
|
||
|
Menubar {
|
||
|
menu: MenuTree::new(),
|
||
|
autohide: true,
|
||
|
selected: false,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
pub fn draw(&mut self, printer: &Printer) {
|
||
|
// Draw the bar at the top
|
||
|
printer.with_color(ColorPair::Primary, |printer| {
|
||
|
printer.print_hline((0, 0), printer.size.x, " ");
|
||
|
});
|
||
|
|
||
|
// TODO: draw the rest
|
||
|
}
|
||
|
|
||
|
pub fn on_event(&mut self, event: Event) -> Option<Rc<Callback>> {
|
||
|
None
|
||
|
}
|
||
|
}
|