replace arc with rc

This commit is contained in:
yggverse 2024-11-08 05:21:08 +02:00
parent a0e923eb7d
commit c843e5b7c0
62 changed files with 317 additions and 334 deletions

View file

@ -4,24 +4,24 @@ use widget::Widget;
use adw::PasswordEntryRow;
use gtk::{gio::SimpleAction, glib::GString};
use std::sync::Arc;
use std::rc::Rc;
pub struct Form {
widget: Arc<Widget>,
widget: Rc<Widget>,
}
impl Form {
// Construct
pub fn new_arc(
pub fn new_rc(
action_send: SimpleAction,
title: Option<&str>,
max_length: Option<i32>,
) -> Arc<Self> {
) -> Rc<Self> {
// Init widget
let widget = Widget::new_arc(action_send, title, max_length);
let widget = Widget::new_rc(action_send, title, max_length);
// Result
Arc::new(Self { widget })
Rc::new(Self { widget })
}
// Actions

View file

@ -7,7 +7,7 @@ use gtk::{
glib::GString,
prelude::{ActionExt, EditableExt, WidgetExt},
};
use std::sync::Arc;
use std::rc::Rc;
pub struct Widget {
gobject: PasswordEntryRow,
@ -15,11 +15,11 @@ pub struct Widget {
impl Widget {
// Construct
pub fn new_arc(
pub fn new_rc(
action_send: SimpleAction,
title: Option<&str>,
max_length: Option<i32>,
) -> Arc<Self> {
) -> Rc<Self> {
// Init gobject
let gobject = PasswordEntryRow::builder().show_apply_button(true).build();
@ -37,7 +37,7 @@ impl Widget {
});
// Return activated struct
Arc::new(Self { gobject })
Rc::new(Self { gobject })
}
// Actions

View file

@ -1,6 +1,6 @@
use adw::PasswordEntryRow;
use gtk::{prelude::BoxExt, Box, Orientation};
use std::sync::Arc;
use std::rc::Rc;
const MARGIN: i32 = 6;
const SPACING: i32 = 8;
@ -11,7 +11,7 @@ pub struct Widget {
impl Widget {
// Construct
pub fn new_arc(response: &PasswordEntryRow) -> Arc<Self> {
pub fn new_rc(response: &PasswordEntryRow) -> Rc<Self> {
let gobject = Box::builder()
.margin_bottom(MARGIN)
.margin_end(MARGIN)
@ -23,7 +23,7 @@ impl Widget {
gobject.append(response);
Arc::new(Self { gobject })
Rc::new(Self { gobject })
}
// Getters