Revert "remove actions gridScrollLeft and gridScrollRight"
This reverts commit bdf62b65
This commit is contained in:
@@ -184,7 +184,31 @@
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_manualScrollStep">
|
||||
<property name="text">
|
||||
<string>Manual scroll step size:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="kcfg_manualScrollStep">
|
||||
<property name="suffix">
|
||||
<string> px</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="8" column="1">
|
||||
<widget class="QCheckBox" name="kcfg_untileOnDrag">
|
||||
<property name="text">
|
||||
<string>Un-tile windows by dragging them</string>
|
||||
@@ -192,7 +216,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="kcfg_stackColumnsByDefault">
|
||||
<property name="text">
|
||||
<string>Stack columns by default</string>
|
||||
@@ -200,7 +224,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="9" column="1">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="kcfg_resizeNeighborColumn">
|
||||
<property name="text">
|
||||
<string>Resize neighbor column on edge resize</string>
|
||||
@@ -208,7 +232,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="10" column="0" colspan="2">
|
||||
<item row="11" column="0" colspan="2">
|
||||
<spacer name="bottomSpacer_tab_general">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ type Config = {
|
||||
gapsInnerHorizontal: number,
|
||||
gapsInnerVertical: number,
|
||||
overscroll: number,
|
||||
manualScrollStep: number,
|
||||
untileOnDrag: boolean,
|
||||
stackColumnsByDefault: boolean,
|
||||
resizeNeighborColumn: boolean,
|
||||
|
||||
@@ -83,6 +83,11 @@ const configDef = [
|
||||
"type": "UInt",
|
||||
"default": 18
|
||||
},
|
||||
{
|
||||
"name": "manualScrollStep",
|
||||
"type": "UInt",
|
||||
"default": 200
|
||||
},
|
||||
{
|
||||
"name": "untileOnDrag",
|
||||
"type": "Bool",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function init() {
|
||||
const config = loadConfig();
|
||||
const world = new World(config);
|
||||
registerKeyBindings(world);
|
||||
registerKeyBindings(world, config);
|
||||
return world;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user