feat: runtime configurable keybindings
This commit is contained in:
parent
62afa4cf61
commit
553c49b42b
25 changed files with 674 additions and 829 deletions
|
|
@ -72,13 +72,14 @@ use smithay::desktop::WindowSurface;
|
|||
use tracing::debug;
|
||||
|
||||
use super::{
|
||||
focus::{target::PointerFocusTarget, FocusDirection},
|
||||
focus::target::PointerFocusTarget,
|
||||
layout::{
|
||||
floating::{ResizeState, TiledCorners},
|
||||
tiling::NodeDesc,
|
||||
},
|
||||
Direction, ManagedLayer, SeatExt,
|
||||
ManagedLayer, SeatExt,
|
||||
};
|
||||
use cosmic_settings_config::shortcuts::action::{Direction, FocusDirection};
|
||||
|
||||
space_elements! {
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use std::sync::Mutex;
|
||||
|
||||
use crate::{
|
||||
config::{Action, Config},
|
||||
config::Config,
|
||||
fl,
|
||||
shell::{grabs::ResizeEdge, ResizeDirection},
|
||||
shell::grabs::ResizeEdge,
|
||||
utils::iced::{IcedElement, Program},
|
||||
};
|
||||
|
||||
|
|
@ -15,6 +15,7 @@ use cosmic::{
|
|||
widget::{icon::from_name, text},
|
||||
Apply,
|
||||
};
|
||||
use cosmic_settings_config::shortcuts::action::{Action, ResizeDirection};
|
||||
use smithay::utils::Size;
|
||||
|
||||
pub type ResizeIndicator = IcedElement<ResizeIndicatorInternal>;
|
||||
|
|
@ -30,8 +31,7 @@ pub fn resize_indicator(
|
|||
edges: Mutex::new(ResizeEdge::all()),
|
||||
direction,
|
||||
shortcut1: config
|
||||
.static_conf
|
||||
.key_bindings
|
||||
.shortcuts
|
||||
.iter()
|
||||
.find_map(|(pattern, action)| {
|
||||
(*action == Action::Resizing(ResizeDirection::Outwards)).then_some(pattern)
|
||||
|
|
@ -39,8 +39,7 @@ pub fn resize_indicator(
|
|||
.map(|pattern| format!("{}: ", pattern.to_string()))
|
||||
.unwrap_or_else(|| crate::fl!("unknown-keybinding")),
|
||||
shortcut2: config
|
||||
.static_conf
|
||||
.key_bindings
|
||||
.shortcuts
|
||||
.iter()
|
||||
.find_map(|(pattern, action)| {
|
||||
(*action == Action::Resizing(ResizeDirection::Inwards)).then_some(pattern)
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ use super::{surface::RESIZE_BORDER, window::Focus, CosmicSurface};
|
|||
use crate::{
|
||||
backend::render::cursor::{CursorShape, CursorState},
|
||||
shell::{
|
||||
focus::{target::PointerFocusTarget, FocusDirection},
|
||||
focus::target::PointerFocusTarget,
|
||||
grabs::{ReleaseMode, ResizeEdge},
|
||||
layout::tiling::NodeDesc,
|
||||
Direction,
|
||||
},
|
||||
state::State,
|
||||
utils::{
|
||||
|
|
@ -21,7 +20,9 @@ use cosmic::{
|
|||
iced_widget::scrollable::AbsoluteOffset,
|
||||
theme, widget as cosmic_widget, Apply, Element as CosmicElement,
|
||||
};
|
||||
use cosmic_settings_config::shortcuts;
|
||||
use once_cell::sync::Lazy;
|
||||
use shortcuts::action::{Direction, FocusDirection};
|
||||
use smithay::{
|
||||
backend::{
|
||||
input::KeyState,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue