mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
update struct member name
This commit is contained in:
parent
0c98b869d3
commit
c97222d68c
8 changed files with 48 additions and 48 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue