mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-12-04 05:56:31 +01:00
feat(komorebic): pan the Scrolling layout to the left or the right
komorebic pan <left|right> moves the view along the row of the Scrolling layout by a column without moving focus first, and lets it come to rest with a column against an edge of the screen. Focus goes to the nearest column on the screen if the focused one has gone off it. It does nothing in the other layouts. The way that the view goes is the way that focus goes for the commands that have directions: panning to the left brings what is to the left of the screen into view, which is to move the row to the right. This is a command that a wheel can be bound to, as it is with whkd: alt + wheelup : komorebic pan left.
This commit is contained in:
1 parent
9e99150019
commit
71e8156f78
12 files changed
+261
No files matched your search
@@ -55,6 +55,7 @@ use komorebi_client::HidingBehaviour;
|
||||
use komorebi_client::MoveBehaviour;
|
||||
use komorebi_client::OperationBehaviour;
|
||||
use komorebi_client::OperationDirection;
|
||||
use komorebi_client::PanDirection;
|
||||
use komorebi_client::Rect;
|
||||
use komorebi_client::Sizing;
|
||||
use komorebi_client::SocketMessage;
|
||||
@@ -1009,6 +1010,13 @@ struct ScrollingLayoutColumns {
|
||||
count: NonZeroUsize,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Pan {
|
||||
/// The way that the view goes
|
||||
#[clap(value_enum)]
|
||||
direction: PanDirection,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct LayoutRatios {
|
||||
/// Column width ratios (space-separated values between 0.1 and 0.9)
|
||||
@@ -1302,6 +1310,10 @@ enum SubCommand {
|
||||
/// Stack the windows of the focused column of the Scrolling layout, or spread the focused
|
||||
/// stack out into a column with a window in each slot
|
||||
ToggleColumnStack,
|
||||
/// Move the view of the Scrolling layout a column to the left or the right, which does
|
||||
/// nothing in any other layout
|
||||
#[clap(arg_required_else_help = true)]
|
||||
Pan(Pan),
|
||||
/// Set the layout column and row ratios for the focused workspace
|
||||
LayoutRatios(LayoutRatios),
|
||||
/// Load a custom layout from file for the focused workspace
|
||||
@@ -2992,6 +3004,9 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
|
||||
SubCommand::ToggleColumnStack => {
|
||||
send_message(&SocketMessage::ToggleColumnStack)?;
|
||||
}
|
||||
SubCommand::Pan(args) => {
|
||||
send_message(&SocketMessage::Pan(args.direction))?;
|
||||
}
|
||||
SubCommand::LayoutRatios(args) => {
|
||||
if args.columns.is_none() && args.rows.is_none() {
|
||||
println!(
|
||||
|
||||
Reference in new issue
Block a user