2016-06-28 04:59:42 +00:00
|
|
|
use menu::*;
|
2016-07-01 06:38:01 +00:00
|
|
|
use theme::ColorStyle;
|
2016-06-28 04:59:42 +00:00
|
|
|
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
|
2016-07-01 06:38:01 +00:00
|
|
|
printer.with_color(ColorStyle::Primary, |printer| {
|
2016-06-28 04:59:42 +00:00
|
|
|
printer.print_hline((0, 0), printer.size.x, " ");
|
|
|
|
});
|
|
|
|
|
|
|
|
// TODO: draw the rest
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn on_event(&mut self, event: Event) -> Option<Rc<Callback>> {
|
2016-06-28 05:40:11 +00:00
|
|
|
let _ = &event;
|
2016-06-28 04:59:42 +00:00
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|