begin window actions group implementation

This commit is contained in:
yggverse 2024-11-10 08:51:08 +02:00
parent 5f280efaf3
commit 36b86ef5cf
15 changed files with 145 additions and 63 deletions

View file

@ -1,7 +1,5 @@
mod append;
mod open;
use append::Append;
use open::Open;
use gtk::{
@ -14,7 +12,6 @@ use std::rc::Rc;
/// [SimpleActionGroup](https://docs.gtk.org/gio/class.SimpleActionGroup.html) wrapper for `Browser` actions
pub struct Action {
// Actions
append: Rc<Append>,
open: Rc<Open>,
// Group
id: GString,
@ -27,7 +24,6 @@ impl Action {
/// Create new `Self`
pub fn new() -> Self {
// Init actions
let append = Rc::new(Append::new());
let open = Rc::new(Open::new());
// Generate unique group ID
@ -37,25 +33,14 @@ impl Action {
let gobject = SimpleActionGroup::new();
// Add action to given group
gobject.add_action(append.gobject());
gobject.add_action(open.gobject());
// Done
Self {
append,
open,
id,
gobject,
}
Self { open, id, gobject }
}
// Getters
/// Get reference `Append` action
pub fn append(&self) -> &Rc<Append> {
&self.append
}
/// Get reference `Open` action
pub fn open(&self) -> &Rc<Open> {
&self.open