mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +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,
|
profile_path: PathBuf,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// Init actions
|
// Init actions
|
||||||
let action_tool_debug = Action::new("win", true);
|
let action_tool_debug = Action::new("win", true, None);
|
||||||
let action_tool_profile = Action::new("win", true);
|
let action_tool_profile = Action::new("win", true, None);
|
||||||
let action_quit = Action::new("win", true);
|
let action_quit = Action::new("win", true, None);
|
||||||
let action_update = Action::new("win", true);
|
let action_update = Action::new("win", true, None);
|
||||||
let action_tab_append = Action::new("win", true);
|
let action_tab_append = Action::new("win", true, None);
|
||||||
let action_tab_close = Action::new("win", true);
|
let action_tab_close = Action::new("win", true, None);
|
||||||
let action_tab_close_all = Action::new("win", true);
|
let action_tab_close_all = Action::new("win", true, None);
|
||||||
let action_tab_page_navigation_base = Action::new("win", false);
|
let action_tab_page_navigation_base = Action::new("win", false, None);
|
||||||
let action_tab_page_navigation_history_back = Action::new("win", false);
|
let action_tab_page_navigation_history_back = Action::new("win", false, None);
|
||||||
let action_tab_page_navigation_history_forward = Action::new("win", false);
|
let action_tab_page_navigation_history_forward = Action::new("win", false, None);
|
||||||
let action_tab_page_navigation_reload = Action::new("win", true);
|
let action_tab_page_navigation_reload = Action::new("win", true, None);
|
||||||
let action_tab_pin = Action::new("win", true);
|
let action_tab_pin = Action::new("win", true, None);
|
||||||
|
|
||||||
// Init GTK
|
// Init GTK
|
||||||
let gobject = Application::builder()
|
let gobject = Application::builder()
|
||||||
|
@ -6,7 +6,7 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use gtk::{
|
use gtk::{
|
||||||
gio::SimpleAction,
|
gio::SimpleAction,
|
||||||
glib::{gformat, uuid_string_random, GString},
|
glib::{gformat, uuid_string_random, GString, VariantTy},
|
||||||
prelude::ActionExt,
|
prelude::ActionExt,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,9 +17,9 @@ pub struct Action {
|
|||||||
|
|
||||||
impl Action {
|
impl Action {
|
||||||
// Construct
|
// 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
|
// 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);
|
simple.set_enabled(is_enabled);
|
||||||
|
|
||||||
// Assign action to the group
|
// Assign action to the group
|
||||||
|
Loading…
x
Reference in New Issue
Block a user