mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
36 lines
800 B
Rust
36 lines
800 B
Rust
mod bar;
|
|
|
|
use super::{Action as WindowAction, BrowserAction, Profile};
|
|
use adw::{TabView, ToolbarView};
|
|
use bar::Bar;
|
|
use gtk::Box;
|
|
use std::rc::Rc;
|
|
|
|
pub trait Header {
|
|
fn header(
|
|
action: (&Rc<BrowserAction>, &Rc<WindowAction>),
|
|
profile: &Rc<Profile>,
|
|
tab_view: &TabView,
|
|
) -> Self;
|
|
}
|
|
|
|
impl Header for ToolbarView {
|
|
// Constructors
|
|
|
|
/// Build new `Self`
|
|
fn header(
|
|
(browser_action, window_action): (&Rc<BrowserAction>, &Rc<WindowAction>),
|
|
profile: &Rc<Profile>,
|
|
tab_view: &TabView,
|
|
) -> Self {
|
|
let toolbar_view = ToolbarView::builder().build();
|
|
|
|
toolbar_view.add_top_bar(&Box::bar(
|
|
(browser_action, window_action),
|
|
profile,
|
|
tab_view,
|
|
));
|
|
|
|
toolbar_view
|
|
}
|
|
}
|