1
0
Fork 0
forked from wry/wry

config: add focus-below and focus-above actions

This commit is contained in:
Julian Orth 2025-07-19 22:01:50 +02:00
parent c034ea7604
commit bd85db5b59
12 changed files with 211 additions and 19 deletions

View file

@ -23,7 +23,10 @@ use {
ahash::AHashMap,
jay_config::{
Axis, Direction, Workspace,
input::{SwitchEvent, Timeline, acceleration::AccelProfile, clickmethod::ClickMethod},
input::{
LayerDirection, SwitchEvent, Timeline, acceleration::AccelProfile,
clickmethod::ClickMethod,
},
keyboard::{Keymap, ModifiedKeySym, mods::Modifiers, syms::KeySym},
logging::LogLevel,
status::MessageFormat,
@ -72,6 +75,7 @@ pub enum SimpleCommand {
ShowBar(bool),
ToggleBar,
FocusHistory(Timeline),
FocusLayerRel(LayerDirection),
}
#[derive(Debug, Clone)]

View file

@ -34,7 +34,7 @@ use {
jay_config::{
Axis::{Horizontal, Vertical},
get_workspace,
input::Timeline,
input::{LayerDirection, Timeline},
},
thiserror::Error,
};
@ -139,6 +139,8 @@ impl ActionParser<'_> {
"toggle-bar" => ToggleBar,
"focus-prev" => FocusHistory(Timeline::Older),
"focus-next" => FocusHistory(Timeline::Newer),
"focus-below" => FocusLayerRel(LayerDirection::Below),
"focus-above" => FocusLayerRel(LayerDirection::Above),
_ => {
return Err(
ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span)

View file

@ -160,6 +160,10 @@ impl Action {
let persistent = state.persistent.clone();
B::new(move || persistent.seat.focus_history(timeline))
}
SimpleCommand::FocusLayerRel(direction) => {
let persistent = state.persistent.clone();
B::new(move || persistent.seat.focus_layer_rel(direction))
}
},
Action::Multi { actions } => {
let actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();