read and use scrolling configuration
This commit is contained in:
@@ -12,6 +12,8 @@ type Config = {
|
||||
resizeNeighborColumn: boolean,
|
||||
reMaximize: boolean,
|
||||
skipSwitcher: boolean,
|
||||
scrollingLazy: boolean,
|
||||
scrollingCentered: boolean,
|
||||
tiledKeepBelow: boolean,
|
||||
floatingKeepAbove: boolean,
|
||||
windowRules: string,
|
||||
|
||||
@@ -117,6 +117,16 @@ const configDef = [
|
||||
"type": "Bool",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "scrollingLazy",
|
||||
"type": "Bool",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "scrollingCentered",
|
||||
"type": "Bool",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "tiledKeepBelow",
|
||||
"type": "Bool",
|
||||
|
||||
@@ -8,7 +8,6 @@ class Desktop {
|
||||
private dirtyPins: boolean;
|
||||
public clientArea: QRect;
|
||||
public tilingArea: QRect;
|
||||
public readonly scroller: Desktop.Scroller = new ScrollerLazy();
|
||||
|
||||
constructor(desktopNumber: number, pinManager: PinManager, config: Desktop.Config, layoutConfig: LayoutConfig) {
|
||||
this.pinManager = pinManager;
|
||||
@@ -104,7 +103,11 @@ class Desktop {
|
||||
return;
|
||||
}
|
||||
|
||||
this.scroller.focusColumn(this, focusedColumn);
|
||||
this.focusColumn(focusedColumn);
|
||||
}
|
||||
|
||||
public focusColumn(column: Column) {
|
||||
this.config.scroller.focusColumn(this, column);
|
||||
}
|
||||
|
||||
private getVisibleRange(scrollX: number) {
|
||||
@@ -190,6 +193,7 @@ namespace Desktop {
|
||||
marginLeft: number,
|
||||
marginRight: number,
|
||||
overscroll: number,
|
||||
scroller: Desktop.Scroller,
|
||||
};
|
||||
|
||||
export type Range = {
|
||||
|
||||
@@ -277,7 +277,7 @@ class Grid {
|
||||
lastFocusedColumn.restoreToTiled();
|
||||
}
|
||||
this.lastFocusedColumn = column;
|
||||
this.desktop.scroller.focusColumn(this.desktop, column);
|
||||
this.desktop.focusColumn(column);
|
||||
}
|
||||
|
||||
public onScreenSizeChanged() {
|
||||
|
||||
@@ -29,6 +29,9 @@ class World {
|
||||
marginLeft: config.gapsOuterLeft,
|
||||
marginRight: config.gapsOuterRight,
|
||||
overscroll: config.overscroll,
|
||||
scroller: config.scrollingLazy ? new ScrollerLazy() :
|
||||
config.scrollingCentered ? new ScrollerCentered() :
|
||||
console.assert(false),
|
||||
},
|
||||
{
|
||||
gapsInnerHorizontal: config.gapsInnerHorizontal,
|
||||
|
||||
Reference in New Issue
Block a user