update struct member name

This commit is contained in:
yggverse 2024-10-06 05:23:19 +03:00
parent 0c98b869d3
commit c97222d68c
8 changed files with 48 additions and 48 deletions

View file

@ -2,29 +2,29 @@ use gtk::{gio::SimpleAction, prelude::ActionExt, prelude::ButtonExt, Button};
use std::sync::Arc;
pub struct Tab {
pub widget: Button,
pub gobject: Button,
}
impl Tab {
// Construct
pub fn new(action_tab_append: Arc<SimpleAction>) -> Self {
// Init widget
let widget = Button::builder()
let gobject = Button::builder()
.icon_name("tab-new-symbolic")
.tooltip_text("New tab")
.build();
// Init events
widget.connect_clicked(move |_| {
gobject.connect_clicked(move |_| {
action_tab_append.activate(None);
});
// Return activated struct
Self { widget }
Self { gobject }
}
// Getters
pub fn widget(&self) -> &Button {
&self.widget
pub fn gobject(&self) -> &Button {
&self.gobject
}
}