mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
begin action collections implementation (to reduce argument size by clippy)
This commit is contained in:
parent
7c7e91ca31
commit
ec7a668cd9
15 changed files with 164 additions and 129 deletions
45
src/action/browser.rs
Normal file
45
src/action/browser.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
use gtk::{gio::SimpleAction, glib::uuid_string_random, prelude::StaticVariantType};
|
||||
|
||||
pub struct Browser {
|
||||
about: SimpleAction,
|
||||
debug: SimpleAction,
|
||||
profile: SimpleAction,
|
||||
quit: SimpleAction,
|
||||
update: SimpleAction,
|
||||
}
|
||||
|
||||
impl Browser {
|
||||
// Constructors
|
||||
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
about: SimpleAction::new(&uuid_string_random(), None),
|
||||
debug: SimpleAction::new(&uuid_string_random(), None),
|
||||
profile: SimpleAction::new(&uuid_string_random(), None),
|
||||
quit: SimpleAction::new(&uuid_string_random(), None),
|
||||
update: SimpleAction::new(&uuid_string_random(), Some(&String::static_variant_type())),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
pub fn about(&self) -> &SimpleAction {
|
||||
&self.about
|
||||
}
|
||||
|
||||
pub fn debug(&self) -> &SimpleAction {
|
||||
&self.debug
|
||||
}
|
||||
|
||||
pub fn profile(&self) -> &SimpleAction {
|
||||
&self.profile
|
||||
}
|
||||
|
||||
pub fn quit(&self) -> &SimpleAction {
|
||||
&self.quit
|
||||
}
|
||||
|
||||
pub fn update(&self) -> &SimpleAction {
|
||||
&self.update
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue