mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
define ptr container outside
This commit is contained in:
parent
7b2c07ac45
commit
a5fc2a7475
58 changed files with 230 additions and 272 deletions
|
|
@ -20,25 +20,25 @@ pub struct Sensitive {
|
|||
|
||||
impl Sensitive {
|
||||
// Construct
|
||||
pub fn new_rc(
|
||||
pub fn new(
|
||||
tab_action: Rc<TabAction>,
|
||||
base: Uri,
|
||||
title: Option<&str>,
|
||||
max_length: Option<i32>,
|
||||
) -> Rc<Self> {
|
||||
) -> Self {
|
||||
// Init local actions
|
||||
let action_send = SimpleAction::new(&uuid_string_random(), None);
|
||||
|
||||
// Init components
|
||||
let form = Form::new_rc(
|
||||
let form = Rc::new(Form::new(
|
||||
action_send.clone(),
|
||||
title,
|
||||
max_length
|
||||
.map(|value| value - base.to_string_partial(UriHideFlags::QUERY).len() as i32),
|
||||
);
|
||||
));
|
||||
|
||||
// Init widget
|
||||
let widget = Widget::new_rc(form.gobject());
|
||||
let widget = Rc::new(Widget::new(form.gobject()));
|
||||
|
||||
// Init events
|
||||
action_send.connect_activate({
|
||||
|
|
@ -55,7 +55,7 @@ impl Sensitive {
|
|||
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