mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
fix reference count for action group arguments
This commit is contained in:
parent
6f7a21705e
commit
86fba1dc69
@ -37,10 +37,22 @@ impl Browser {
|
|||||||
let widget = Rc::new(Widget::new(
|
let widget = Rc::new(Widget::new(
|
||||||
window.gobject(),
|
window.gobject(),
|
||||||
&[
|
&[
|
||||||
// Connect action groups
|
// Connect action groups (to apply accels)
|
||||||
(action.id(), action.gobject()),
|
(
|
||||||
(window.action().id(), window.action().gobject()),
|
// Browser
|
||||||
(window.tab().action().id(), window.tab().action().gobject()),
|
action.id(),
|
||||||
|
action.gobject().clone(),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
// Window
|
||||||
|
window.action().id(),
|
||||||
|
window.action().gobject().clone(),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
// Tab
|
||||||
|
window.tab().action().id(),
|
||||||
|
window.tab().action().gobject().clone(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ impl Widget {
|
|||||||
// Construct
|
// Construct
|
||||||
pub fn new(
|
pub fn new(
|
||||||
content: &impl IsA<gtk::Widget>,
|
content: &impl IsA<gtk::Widget>,
|
||||||
action_groups: &[(&GString, &SimpleActionGroup)],
|
action_groups: &[(&GString, SimpleActionGroup)],
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// Init GTK
|
// Init GTK
|
||||||
let gobject = ApplicationWindow::builder()
|
let gobject = ApplicationWindow::builder()
|
||||||
@ -34,7 +34,7 @@ impl Widget {
|
|||||||
|
|
||||||
// Register actions
|
// Register actions
|
||||||
for (name, group) in action_groups {
|
for (name, group) in action_groups {
|
||||||
gobject.insert_action_group(name, Some(group.clone()));
|
gobject.insert_action_group(name, Some(group));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return new struct
|
// Return new struct
|
||||||
|
Loading…
x
Reference in New Issue
Block a user