Commit e66e092c authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

actions: add param_type support

parent 90146a59
......@@ -28,8 +28,8 @@ macro_rules! send {
#[macro_export]
macro_rules! action {
($actions_group:expr, $name:expr, $callback:expr) => {
let simple_action = gio::SimpleAction::new($name, None);
($actions_group:expr, $name:expr, $param_type:expr, $callback:expr) => {
let simple_action = gio::SimpleAction::new($name, $param_type);
simple_action.connect_activate($callback);
$actions_group.add_action(&simple_action);
};
......@@ -37,8 +37,8 @@ macro_rules! action {
#[macro_export]
macro_rules! stateful_action {
($actions_group:expr, $name:expr, $value:expr, $callback:expr) => {
let simple_action = gio::SimpleAction::new_stateful($name, None, &$value.to_variant());
($actions_group:expr, $name:expr, $param_type:expr, $state:expr, $callback:expr) => {
let simple_action = gio::SimpleAction::new_stateful($name, $param_type, &$state.to_variant());
simple_action.connect_activate($callback);
$actions_group.add_action(&simple_action);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment