mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
use libadwaita for app & app window
This commit is contained in:
parent
e2ab831d57
commit
9e5a2a490c
11 changed files with 57 additions and 47 deletions
30
src/app/browser/window/header/tray/tab.rs
Normal file
30
src/app/browser/window/header/tray/tab.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use gtk::{gio::SimpleAction, prelude::ActionExt, prelude::ButtonExt, Button};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Tab {
|
||||
pub gobject: Button,
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new(action_tab_append: Arc<SimpleAction>) -> Self {
|
||||
// Init widget
|
||||
let gobject = Button::builder()
|
||||
.icon_name("tab-new-symbolic")
|
||||
.tooltip_text("New tab")
|
||||
.build();
|
||||
|
||||
// Init events
|
||||
gobject.connect_clicked(move |_| {
|
||||
action_tab_append.activate(None);
|
||||
});
|
||||
|
||||
// Return activated struct
|
||||
Self { gobject }
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gobject(&self) -> &Button {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue