mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
begin libadwaita headerbar tabs integration
This commit is contained in:
parent
765a24f331
commit
ce29a06dda
16 changed files with 269 additions and 156 deletions
34
src/app/browser/window/header/bar/widget.rs
Normal file
34
src/app/browser/window/header/bar/widget.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
use adw::TabBar;
|
||||
use gtk::{prelude::BoxExt, Box, Button, MenuButton, Orientation, WindowControls};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Widget {
|
||||
gobject: Box,
|
||||
}
|
||||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(
|
||||
control: &WindowControls,
|
||||
append: &Button,
|
||||
menu: &MenuButton,
|
||||
tab: &TabBar,
|
||||
) -> Arc<Self> {
|
||||
let gobject = Box::builder()
|
||||
.orientation(Orientation::Horizontal)
|
||||
.spacing(8)
|
||||
.build();
|
||||
|
||||
gobject.append(tab);
|
||||
gobject.append(append);
|
||||
gobject.append(menu);
|
||||
gobject.append(control);
|
||||
|
||||
Arc::new(Self { gobject })
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gobject(&self) -> &Box {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue