mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-04 23:44:13 +00:00
add parameter_type argument
This commit is contained in:
parent
e41216ab75
commit
c92a5406f5
24
src/app.rs
24
src/app.rs
@ -38,18 +38,18 @@ impl App {
|
||||
profile_path: PathBuf,
|
||||
) -> Self {
|
||||
// Init actions
|
||||
let action_tool_debug = Action::new("win", true);
|
||||
let action_tool_profile = Action::new("win", true);
|
||||
let action_quit = Action::new("win", true);
|
||||
let action_update = Action::new("win", true);
|
||||
let action_tab_append = Action::new("win", true);
|
||||
let action_tab_close = Action::new("win", true);
|
||||
let action_tab_close_all = Action::new("win", true);
|
||||
let action_tab_page_navigation_base = Action::new("win", false);
|
||||
let action_tab_page_navigation_history_back = Action::new("win", false);
|
||||
let action_tab_page_navigation_history_forward = Action::new("win", false);
|
||||
let action_tab_page_navigation_reload = Action::new("win", true);
|
||||
let action_tab_pin = Action::new("win", true);
|
||||
let action_tool_debug = Action::new("win", true, None);
|
||||
let action_tool_profile = Action::new("win", true, None);
|
||||
let action_quit = Action::new("win", true, None);
|
||||
let action_update = Action::new("win", true, None);
|
||||
let action_tab_append = Action::new("win", true, None);
|
||||
let action_tab_close = Action::new("win", true, None);
|
||||
let action_tab_close_all = Action::new("win", true, None);
|
||||
let action_tab_page_navigation_base = Action::new("win", false, None);
|
||||
let action_tab_page_navigation_history_back = Action::new("win", false, None);
|
||||
let action_tab_page_navigation_history_forward = Action::new("win", false, None);
|
||||
let action_tab_page_navigation_reload = Action::new("win", true, None);
|
||||
let action_tab_pin = Action::new("win", true, None);
|
||||
|
||||
// Init GTK
|
||||
let gobject = Application::builder()
|
||||
|
@ -6,7 +6,7 @@ use std::sync::Arc;
|
||||
|
||||
use gtk::{
|
||||
gio::SimpleAction,
|
||||
glib::{gformat, uuid_string_random, GString},
|
||||
glib::{gformat, uuid_string_random, GString, VariantTy},
|
||||
prelude::ActionExt,
|
||||
};
|
||||
|
||||
@ -17,9 +17,9 @@ pub struct Action {
|
||||
|
||||
impl Action {
|
||||
// Construct
|
||||
pub fn new(group: &str, is_enabled: bool) -> Self {
|
||||
pub fn new(group: &str, is_enabled: bool, parameter_type: Option<&VariantTy>) -> Self {
|
||||
// Create random action name as no static values should be in use
|
||||
let simple = Arc::new(SimpleAction::new(&uuid_string_random(), None));
|
||||
let simple = Arc::new(SimpleAction::new(&uuid_string_random(), parameter_type));
|
||||
simple.set_enabled(is_enabled);
|
||||
|
||||
// Assign action to the group
|
||||
|
Loading…
x
Reference in New Issue
Block a user