2024-10-10 23:34:06 +03:00
|
|
|
use adw::TabBar;
|
2024-10-31 16:16:02 +02:00
|
|
|
use gtk::{prelude::BoxExt, Box, MenuButton, Orientation, WindowControls};
|
2024-11-08 05:21:08 +02:00
|
|
|
use std::rc::Rc;
|
2024-10-10 23:34:06 +03:00
|
|
|
|
|
|
|
pub struct Widget {
|
|
|
|
gobject: Box,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Widget {
|
|
|
|
// Construct
|
2024-11-08 05:21:08 +02:00
|
|
|
pub fn new_rc(control: &WindowControls, menu: &MenuButton, tab: &TabBar) -> Rc<Self> {
|
2024-10-10 23:34:06 +03:00
|
|
|
let gobject = Box::builder()
|
|
|
|
.orientation(Orientation::Horizontal)
|
|
|
|
.spacing(8)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
gobject.append(tab);
|
|
|
|
gobject.append(menu);
|
|
|
|
gobject.append(control);
|
|
|
|
|
2024-11-08 05:21:08 +02:00
|
|
|
Rc::new(Self { gobject })
|
2024-10-10 23:34:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Getters
|
|
|
|
pub fn gobject(&self) -> &Box {
|
|
|
|
&self.gobject
|
|
|
|
}
|
|
|
|
}
|