give name to gobject variables

This commit is contained in:
yggverse 2024-12-14 06:50:30 +02:00
parent 702269f1f1
commit a1617b2b1b
35 changed files with 213 additions and 209 deletions

View file

@ -24,7 +24,7 @@ impl Back {
pub fn update(&self, status: bool) {
// Update actions
self.action.history_back.gobject.set_enabled(status);
self.action.history_back.simple_action.set_enabled(status);
// Update child components
self.widget.update(status);

View file

@ -22,7 +22,10 @@ impl Forward {
// Actions
pub fn update(&self, status: bool) {
// Update actions
self.action.history_forward.gobject.set_enabled(status);
self.action
.history_forward
.simple_action
.set_enabled(status);
// Update child components
self.widget.update(status);

View file

@ -34,7 +34,7 @@ impl Home {
false
}
};
self.action.home.gobject.set_enabled(has_home);
self.action.home.simple_action.set_enabled(has_home);
self.widget.update(has_home);
}

View file

@ -23,7 +23,7 @@ impl Reload {
pub fn update(&self, is_enabled: bool) {
// Update actions
self.action.reload.gobject.set_enabled(is_enabled);
self.action.reload.simple_action.set_enabled(is_enabled);
// Update child components
self.widget.update(is_enabled);

View file

@ -4,7 +4,7 @@ use gtk::{
};
pub struct Widget {
gobject: Box,
pub g_box: Box,
}
impl Widget {
@ -17,20 +17,15 @@ impl Widget {
input: &impl IsA<gtk::Widget>,
) -> Self {
// Init self
let gobject = Box::builder()
let g_box = Box::builder()
.orientation(Orientation::Vertical)
.name(name)
.build();
gobject.append(navigation);
gobject.append(content);
gobject.append(input);
g_box.append(navigation);
g_box.append(content);
g_box.append(input);
Self { gobject }
}
// Getters
pub fn gobject(&self) -> &Box {
&self.gobject
Self { g_box }
}
}