layout: Make it possible to opt out of latching per-key

This commit is contained in:
Dorota Czaplejewicz
2020-12-04 16:45:00 +00:00
parent c6cc58fd8e
commit 676a2b60ac
3 changed files with 93 additions and 13 deletions

View File

@ -266,7 +266,11 @@ struct ButtonMeta {
#[serde(deny_unknown_fields)]
enum Action {
#[serde(rename="locking")]
Locking { lock_view: String, unlock_view: String },
Locking {
lock_view: String,
unlock_view: String,
pops: Option<bool>,
},
#[serde(rename="set_view")]
SetView(String),
#[serde(rename="show_prefs")]
@ -577,7 +581,8 @@ fn create_action<H: logging::Handler>(
)
),
SubmitData::Action(Action::Locking {
lock_view, unlock_view
lock_view, unlock_view,
pops,
}) => ::action::Action::LockView {
lock: filter_view_name(
name,
@ -591,6 +596,7 @@ fn create_action<H: logging::Handler>(
&view_names,
warning_handler,
),
latches: pops.unwrap_or(true),
},
SubmitData::Action(
Action::ShowPrefs