diff --git a/src/model.ts b/src/model.ts index fe978f00..6d8b9556 100644 --- a/src/model.ts +++ b/src/model.ts @@ -281,6 +281,15 @@ class ScreenWindow { this.setScrollTop_debounced = debounce(1000, this.setScrollTop.bind(this)); } + updateSelf(swdata : ScreenWindowType) { + mobx.action(() => { + this.name.set(swdata.name); + this.layout.set(swdata.layout); + this.selectedLine.set(swdata.selectedline); + // do not set scrolltop! + })(); + } + setScrollTop(scrollTop : number) : void { GlobalCommandRunner.swSetScrollTop(this.sessionId, this.screenId, this.windowId, scrollTop); } @@ -1444,11 +1453,11 @@ class Model { } onMetaArrowUp() : void { - GlobalCommandRunner.swSelectLine("-"); + GlobalCommandRunner.swSelectLine("-1"); } onMetaArrowDown() : void { - GlobalCommandRunner.swSelectLine("+"); + GlobalCommandRunner.swSelectLine("+1"); } onMetaArrowUpOld() : void { @@ -1635,6 +1644,9 @@ class Model { if ("window" in update) { this.updateWindow(update.window, false); } + if ("screenwindow" in update) { + this.updateSW(update.screenwindow); + } if ("remotes" in update) { if (update.connect) { this.remotes.clear(); @@ -1715,6 +1727,14 @@ class Model { })(); } + updateSW(swdata : ScreenWindowType) { + let sw = this.getSWByIds(swdata.sessionid, swdata.screenid, swdata.windowid); + if (sw == null) { + return; + } + sw.updateSelf(swdata); + } + getScreenById(sessionId : string, screenId : string) : Screen { let session = this.getSessionById(sessionId); if (session == null) { @@ -1748,6 +1768,14 @@ class Model { return screen.getSW(windowId); } + getSWByIds(sessionId : string, screenId : string, windowId : string) : ScreenWindow { + let screen = this.getScreenById(sessionId, screenId); + if (screen == null) { + return null; + } + return screen.getSW(windowId); + } + getActiveScreen() : Screen { let session = this.getActiveSession(); if (session == null) { diff --git a/src/sh2.less b/src/sh2.less index 73040e22..d484040d 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -446,7 +446,7 @@ html, body, #main { align-self: flex-start; &.focus { - box-shadow: 0 0 3px 3px rgba(255, 255, 255, 0.3); + /* box-shadow: 0 0 3px 3px rgba(255, 255, 255, 0.3); */ } } } diff --git a/src/types.ts b/src/types.ts index 91b76ec7..26d36a57 100644 --- a/src/types.ts +++ b/src/types.ts @@ -261,6 +261,7 @@ type ModelUpdateType = { sessions? : SessionDataType[], activesessionid? : string, window? : WindowDataType, + screenwindow? : ScreenWindowType, line? : LineType, cmd? : CmdDataType, info? : InfoType,