mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
08f5c6fecb
* Add corner selection in config * Add hot corner docs * Working per-monitor hot corners Handle defaults * run cargo fmt --all * Fix hot corners in is_sticky_obscured_under * Change default to fall back to gesture hot corners if output hot corners are unset * Add hot corner output config docs * Support fractional scaling * Trigger hot corners over widgets * Improve float handling Fixed YaLTeR/niri/pull/2108 * Refactor * Bug Fixes * Amend docs Fix styling Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com> * Integrate code review Move is_inside_hot_corner * fixes --------- Co-authored-by: Aadniz <8147434+Aadniz@users.noreply.github.com> Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
66 lines
2.0 KiB
Rust
66 lines
2.0 KiB
Rust
use crate::FloatOrInt;
|
|
|
|
#[derive(knuffel::Decode, Debug, Default, Clone, Copy, PartialEq)]
|
|
pub struct Gestures {
|
|
#[knuffel(child, default)]
|
|
pub dnd_edge_view_scroll: DndEdgeViewScroll,
|
|
#[knuffel(child, default)]
|
|
pub dnd_edge_workspace_switch: DndEdgeWorkspaceSwitch,
|
|
#[knuffel(child, default)]
|
|
pub hot_corners: HotCorners,
|
|
}
|
|
|
|
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
|
|
pub struct DndEdgeViewScroll {
|
|
#[knuffel(child, unwrap(argument), default = Self::default().trigger_width)]
|
|
pub trigger_width: FloatOrInt<0, 65535>,
|
|
#[knuffel(child, unwrap(argument), default = Self::default().delay_ms)]
|
|
pub delay_ms: u16,
|
|
#[knuffel(child, unwrap(argument), default = Self::default().max_speed)]
|
|
pub max_speed: FloatOrInt<0, 1_000_000>,
|
|
}
|
|
|
|
impl Default for DndEdgeViewScroll {
|
|
fn default() -> Self {
|
|
Self {
|
|
trigger_width: FloatOrInt(30.), // Taken from GTK 4.
|
|
delay_ms: 100,
|
|
max_speed: FloatOrInt(1500.),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
|
|
pub struct DndEdgeWorkspaceSwitch {
|
|
#[knuffel(child, unwrap(argument), default = Self::default().trigger_height)]
|
|
pub trigger_height: FloatOrInt<0, 65535>,
|
|
#[knuffel(child, unwrap(argument), default = Self::default().delay_ms)]
|
|
pub delay_ms: u16,
|
|
#[knuffel(child, unwrap(argument), default = Self::default().max_speed)]
|
|
pub max_speed: FloatOrInt<0, 1_000_000>,
|
|
}
|
|
|
|
impl Default for DndEdgeWorkspaceSwitch {
|
|
fn default() -> Self {
|
|
Self {
|
|
trigger_height: FloatOrInt(50.),
|
|
delay_ms: 100,
|
|
max_speed: FloatOrInt(1500.),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(knuffel::Decode, Debug, Default, Clone, Copy, PartialEq)]
|
|
pub struct HotCorners {
|
|
#[knuffel(child)]
|
|
pub off: bool,
|
|
#[knuffel(child)]
|
|
pub top_left: bool,
|
|
#[knuffel(child)]
|
|
pub top_right: bool,
|
|
#[knuffel(child)]
|
|
pub bottom_left: bool,
|
|
#[knuffel(child)]
|
|
pub bottom_right: bool,
|
|
}
|