mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
drop Arc from SimpleAction #1
This commit is contained in:
parent
08ad677ba4
commit
920721412e
40 changed files with 162 additions and 175 deletions
|
|
@ -10,14 +10,14 @@ use gtk::{
|
|||
use std::{cell::RefCell, sync::Arc};
|
||||
|
||||
pub struct Base {
|
||||
action_tab_page_navigation_base: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_base: SimpleAction,
|
||||
uri: RefCell<Option<Uri>>,
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
||||
impl Base {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_base: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_base: SimpleAction) -> Arc<Self> {
|
||||
Arc::new(Self {
|
||||
action_tab_page_navigation_base: action_tab_page_navigation_base.clone(),
|
||||
uri: RefCell::new(None),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_base: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_base: SimpleAction) -> Arc<Self> {
|
||||
// Init gobject
|
||||
let gobject = Button::builder()
|
||||
.icon_name("go-home-symbolic")
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ pub struct History {
|
|||
impl History {
|
||||
// Construct
|
||||
pub fn new_arc(
|
||||
action_tab_page_navigation_history_back: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_history_forward: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_history_back: SimpleAction,
|
||||
action_tab_page_navigation_history_forward: SimpleAction,
|
||||
) -> Arc<Self> {
|
||||
// init components
|
||||
let back = Back::new_arc(action_tab_page_navigation_history_back);
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ use gtk::{gio::SimpleAction, Button};
|
|||
use std::sync::Arc;
|
||||
|
||||
pub struct Back {
|
||||
action_tab_page_navigation_history_back: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_history_back: SimpleAction,
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
||||
impl Back {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_history_back: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_history_back: SimpleAction) -> Arc<Self> {
|
||||
// Return activated struct
|
||||
Arc::new(Self {
|
||||
action_tab_page_navigation_history_back: action_tab_page_navigation_history_back
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_history_back: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_history_back: SimpleAction) -> Arc<Self> {
|
||||
// Init gobject
|
||||
let gobject = Button::builder()
|
||||
.icon_name("go-previous-symbolic")
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ use gtk::{gio::SimpleAction, Button};
|
|||
use std::sync::Arc;
|
||||
|
||||
pub struct Forward {
|
||||
action_tab_page_navigation_history_forward: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_history_forward: SimpleAction,
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
||||
impl Forward {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_history_forward: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_history_forward: SimpleAction) -> Arc<Self> {
|
||||
// Return activated struct
|
||||
Arc::new(Self {
|
||||
action_tab_page_navigation_history_forward: action_tab_page_navigation_history_forward
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_history_forward: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_history_forward: SimpleAction) -> Arc<Self> {
|
||||
// Init gobject
|
||||
let gobject = Button::builder()
|
||||
.icon_name("go-next-symbolic")
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ use gtk::{gio::SimpleAction, Button};
|
|||
use std::sync::Arc;
|
||||
|
||||
pub struct Reload {
|
||||
action_tab_page_navigation_reload: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_reload: SimpleAction,
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
||||
impl Reload {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_reload: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_reload: SimpleAction) -> Arc<Self> {
|
||||
Arc::new(Self {
|
||||
action_tab_page_navigation_reload: action_tab_page_navigation_reload.clone(),
|
||||
widget: Widget::new_arc(action_tab_page_navigation_reload),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_page_navigation_reload: Arc<SimpleAction>) -> Arc<Self> {
|
||||
pub fn new_arc(action_tab_page_navigation_reload: SimpleAction) -> Arc<Self> {
|
||||
// Init gobject
|
||||
let gobject = Button::builder()
|
||||
.icon_name("view-refresh-symbolic")
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ impl Request {
|
|||
// Construct
|
||||
pub fn new_arc(
|
||||
// Actions
|
||||
action_update: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_reload: Arc<SimpleAction>, // @TODO local `action_page_open`?
|
||||
action_update: SimpleAction,
|
||||
action_tab_page_navigation_reload: SimpleAction, // @TODO local `action_page_open`?
|
||||
) -> Arc<Self> {
|
||||
Arc::new(Self {
|
||||
widget: Widget::new_arc(action_update, action_tab_page_navigation_reload),
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ pub struct Widget {
|
|||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(
|
||||
action_update: Arc<SimpleAction>,
|
||||
action_tab_page_navigation_reload: Arc<SimpleAction>, // @TODO local `action_page_open`?
|
||||
action_update: SimpleAction,
|
||||
action_tab_page_navigation_reload: SimpleAction, // @TODO local `action_page_open`?
|
||||
) -> Arc<Self> {
|
||||
// Init animated progress bar state
|
||||
let progress = Arc::new(Progress {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue