mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
separate modules to submodule components
This commit is contained in:
parent
2c389abdfd
commit
e45b7f0a4a
13 changed files with 167 additions and 71 deletions
|
|
@ -1,17 +1,19 @@
|
|||
use gtk::{gio, MenuButton};
|
||||
mod model;
|
||||
mod widget;
|
||||
|
||||
pub fn new() -> MenuButton {
|
||||
let menu = MenuButton::builder().tooltip_text("Menu").build();
|
||||
|
||||
let model = gio::Menu::new();
|
||||
let model_tab = gio::Menu::new();
|
||||
|
||||
model_tab.append(Some("Append"), Some("win.tab_append"));
|
||||
model.append_submenu(Some("Tab"), &model_tab);
|
||||
model.append(Some("Debug"), Some("win.debug"));
|
||||
model.append(Some("Quit"), Some("win.quit"));
|
||||
|
||||
menu.set_menu_model(Some(&model));
|
||||
|
||||
menu
|
||||
pub struct Menu {
|
||||
widget: widget::Menu,
|
||||
}
|
||||
|
||||
impl Menu {
|
||||
pub fn new() -> Menu {
|
||||
Self {
|
||||
widget: widget::Menu::new(model::Menu::new().model()),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &widget::Menu {
|
||||
&self.widget
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue