mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
remove constructions not in use
This commit is contained in:
parent
3d9ea1d54e
commit
89d0d13c42
4 changed files with 4 additions and 51 deletions
|
|
@ -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<Load>,
|
||||
// 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<Load> {
|
||||
&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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue