mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
define ptr container outside
This commit is contained in:
parent
7b2c07ac45
commit
a5fc2a7475
58 changed files with 230 additions and 272 deletions
|
|
@ -24,23 +24,27 @@ pub struct Response {
|
|||
|
||||
impl Response {
|
||||
// Construct
|
||||
pub fn new_rc(
|
||||
pub fn new(
|
||||
tab_action: Rc<TabAction>,
|
||||
base: Uri,
|
||||
title: Option<&str>,
|
||||
size_limit: Option<usize>,
|
||||
) -> Rc<Self> {
|
||||
) -> Self {
|
||||
// Init local actions
|
||||
let action_update = SimpleAction::new(&uuid_string_random(), None);
|
||||
let action_send = SimpleAction::new(&uuid_string_random(), None);
|
||||
|
||||
// Init components
|
||||
let control = Control::new_rc(action_send.clone());
|
||||
let form = Form::new_rc(action_update.clone());
|
||||
let title = Title::new_rc(title);
|
||||
let control = Rc::new(Control::new(action_send.clone()));
|
||||
let form = Rc::new(Form::new(action_update.clone()));
|
||||
let title = Rc::new(Title::new(title));
|
||||
|
||||
// Init widget
|
||||
let widget = Widget::new_rc(title.gobject(), form.gobject(), control.gobject());
|
||||
let widget = Rc::new(Widget::new(
|
||||
title.gobject(),
|
||||
form.gobject(),
|
||||
control.gobject(),
|
||||
));
|
||||
|
||||
// Init events
|
||||
action_update.connect_activate({
|
||||
|
|
@ -70,7 +74,7 @@ impl Response {
|
|||
widget.gobject().connect_realize(move |_| form.focus());
|
||||
|
||||
// Return activated struct
|
||||
Rc::new(Self { widget })
|
||||
Self { widget }
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue