mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-29 12:34:13 +00:00
29 lines
621 B
Rust
29 lines
621 B
Rust
use adw::TabBar;
|
|
use gtk::{prelude::BoxExt, Box, MenuButton, Orientation, WindowControls};
|
|
use std::rc::Rc;
|
|
|
|
pub struct Widget {
|
|
gobject: Box,
|
|
}
|
|
|
|
impl Widget {
|
|
// Construct
|
|
pub fn new_rc(control: &WindowControls, menu: &MenuButton, tab: &TabBar) -> Rc<Self> {
|
|
let gobject = Box::builder()
|
|
.orientation(Orientation::Horizontal)
|
|
.spacing(8)
|
|
.build();
|
|
|
|
gobject.append(tab);
|
|
gobject.append(menu);
|
|
gobject.append(control);
|
|
|
|
Rc::new(Self { gobject })
|
|
}
|
|
|
|
// Getters
|
|
pub fn gobject(&self) -> &Box {
|
|
&self.gobject
|
|
}
|
|
}
|