From 89d0d13c42b07cb89ffe357edc5a473e75abdf16 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 11 Nov 2024 13:25:43 +0200 Subject: [PATCH] remove constructions not in use --- src/app/browser/window/tab/item.rs | 8 +--- src/app/browser/window/tab/item/action.rs | 38 ++----------------- .../browser/window/tab/item/action/load.rs | 7 ---- src/app/browser/window/tab/item/page.rs | 2 - 4 files changed, 4 insertions(+), 51 deletions(-) diff --git a/src/app/browser/window/tab/item.rs b/src/app/browser/window/tab/item.rs index 2d86e4be..dba8a04b 100644 --- a/src/app/browser/window/tab/item.rs +++ b/src/app/browser/window/tab/item.rs @@ -22,7 +22,6 @@ pub struct Item { // useful as widget name in GTK actions callback id: GString, // Components - action: Rc, page: Rc, widget: Rc, } @@ -94,12 +93,7 @@ impl Item { }); // Done - Self { - id, - action, - page, - widget, - } + Self { id, page, widget } } // Actions diff --git a/src/app/browser/window/tab/item/action.rs b/src/app/browser/window/tab/item/action.rs index aa577b5a..cf276d93 100644 --- a/src/app/browser/window/tab/item/action.rs +++ b/src/app/browser/window/tab/item/action.rs @@ -1,20 +1,12 @@ mod load; use load::Load; -use gtk::{ - gio::SimpleActionGroup, - glib::{uuid_string_random, GString}, - prelude::ActionMapExt, -}; use std::rc::Rc; /// [SimpleActionGroup](https://docs.gtk.org/gio/class.SimpleActionGroup.html) wrapper for `Browser` actions pub struct Action { // Actions load: Rc, - // Group - id: GString, - gobject: SimpleActionGroup, } impl Action { @@ -22,20 +14,9 @@ impl Action { /// Create new `Self` pub fn new() -> Self { - // Init actions - let load = Rc::new(Load::new()); - - // Generate unique group ID - let id = uuid_string_random(); - - // Init group - let gobject = SimpleActionGroup::new(); - - // Add action to given group - gobject.add_action(load.gobject()); - - // Done - Self { load, id, gobject } + Self { + load: Rc::new(Load::new()), + } } // Getters @@ -44,17 +25,4 @@ impl Action { pub fn load(&self) -> &Rc { &self.load } - - /// Get auto-generated name for action group - /// * useful for manual relationship with GObjects or as the `detailed_name` - /// for [Accels](https://docs.gtk.org/gtk4/method.Application.set_accels_for_action.html) or - /// [Menu](https://docs.gtk.org/gio/class.Menu.html) builder - pub fn id(&self) -> &GString { - &self.id - } - - /// Get reference to [SimpleActionGroup](https://docs.gtk.org/gio/class.SimpleActionGroup.html) GObject - pub fn gobject(&self) -> &SimpleActionGroup { - &self.gobject - } } diff --git a/src/app/browser/window/tab/item/action/load.rs b/src/app/browser/window/tab/item/action/load.rs index 260191da..06366ff1 100644 --- a/src/app/browser/window/tab/item/action/load.rs +++ b/src/app/browser/window/tab/item/action/load.rs @@ -50,11 +50,4 @@ impl Load { }) }); } - - // Getters - - /// Get reference to [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html) GObject - pub fn gobject(&self) -> &SimpleAction { - &self.gobject - } } diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 9902df5f..2fef0ab0 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -33,7 +33,6 @@ pub struct Page { cancellable: RefCell, // Actions browser_action: Rc, - window_action: Rc, tab_action: Rc, // Components navigation: Rc, @@ -78,7 +77,6 @@ impl Page { id, // Actions browser_action, - window_action, tab_action, // Components content,