diff --git a/package/contents/ui/config.ui b/package/contents/ui/config.ui index 57f814c..2141e9a 100644 --- a/package/contents/ui/config.ui +++ b/package/contents/ui/config.ui @@ -184,7 +184,31 @@ + + + + Manual scroll step size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + px + + + 999 + + + 0 + + + + + Un-tile windows by dragging them @@ -192,7 +216,7 @@ - + Stack columns by default @@ -200,7 +224,7 @@ - + Resize neighbor column on edge resize @@ -208,7 +232,7 @@ - + Qt::Vertical diff --git a/src/Actions.ts b/src/Actions.ts index a250dc4..6685021 100644 --- a/src/Actions.ts +++ b/src/Actions.ts @@ -1,5 +1,5 @@ module Actions { - export function init(world: World) { + export function init(world: World, config: Config) { return { focusLeft: () => { world.doIfTiledFocused(true, (window, column, grid) => { @@ -183,6 +183,14 @@ module Actions { }); }, + gridScrollLeft: () => { + gridScroll(world, -config.manualScrollStep); + }, + + gridScrollRight: () => { + gridScroll(world, config.manualScrollStep); + }, + gridScrollStart: () => { const grid = world.getCurrentGrid(); const firstColumn = grid.getFirstColumn(); @@ -320,4 +328,8 @@ module Actions { grid.container.adjustScroll(scrollAmount, false); grid.container.arrange(); } + + export type Config = { + manualScrollStep: number, + } } diff --git a/src/config/config.ts b/src/config/config.ts index 532ab47..5d4dac3 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -6,6 +6,7 @@ type Config = { gapsInnerHorizontal: number, gapsInnerVertical: number, overscroll: number, + manualScrollStep: number, untileOnDrag: boolean, stackColumnsByDefault: boolean, resizeNeighborColumn: boolean, diff --git a/src/config/definition.ts b/src/config/definition.ts index 380c1fc..48e2cbc 100644 --- a/src/config/definition.ts +++ b/src/config/definition.ts @@ -83,6 +83,11 @@ const configDef = [ "type": "UInt", "default": 18 }, + { + "name": "manualScrollStep", + "type": "UInt", + "default": 200 + }, { "name": "untileOnDrag", "type": "Bool", diff --git a/src/keyBindings/definition.ts b/src/keyBindings/definition.ts index 1f981ea..804f786 100644 --- a/src/keyBindings/definition.ts +++ b/src/keyBindings/definition.ts @@ -140,6 +140,18 @@ const keyBindings: KeyBinding[] = [ "defaultKeySequence": "Meta+Alt+D", "action": "gridScrollRightColumn", }, + { + "name": "grid-scroll-left", + "description": "Scroll left", + "defaultKeySequence": "Meta+Alt+PgUp", + "action": "gridScrollLeft", + }, + { + "name": "grid-scroll-right", + "description": "Scroll right", + "defaultKeySequence": "Meta+Alt+PgDown", + "action": "gridScrollRight", + }, { "name": "grid-scroll-start", "description": "Scroll to start", diff --git a/src/keyBindings/loader.ts b/src/keyBindings/loader.ts index e8d4726..a001e4e 100644 --- a/src/keyBindings/loader.ts +++ b/src/keyBindings/loader.ts @@ -49,8 +49,8 @@ function registerNumKeyBindings(name: string, description: string, modifiers: st } } -function registerKeyBindings(world: World) { - const actions = Actions.init(world); +function registerKeyBindings(world: World, config: Config) { + const actions = Actions.init(world, config); for (const binding of keyBindings) { registerKeyBinding(binding.name, binding.description, binding.defaultKeySequence, actions[binding.action]); } diff --git a/src/main.ts b/src/main.ts index e3e1347..1d1a427 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ function init() { const config = loadConfig(); const world = new World(config); - registerKeyBindings(world); + registerKeyBindings(world, config); return world; }