From e4bf68ca3ba94fbffe8563213957bb97da882b53 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 23 Aug 2022 13:14:57 -0700 Subject: [PATCH] scrolling info box --- src/main.tsx | 7 ++++--- src/sh2.less | 29 +++++++++++++++++++++++------ src/types.ts | 1 + 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index dbcfe95e5..051b7bdc0 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -276,7 +276,7 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width return (
-
= 5}, "status-" + status)} onClick={this.doRefresh}> +
= 5}, "status-" + status, {"ephemeral": line.ephemeral})} onClick={this.doRefresh}> {cmdRefNumStr} @@ -472,6 +472,7 @@ class CmdInput extends React.Component<{}, {}> { let istr : string = null; let istrIdx : number = 0; let line : string = null; + let idx : number = 0; return (
@@ -487,8 +488,8 @@ class CmdInput extends React.Component<{}, {}> {
- -
{line}
+ +
{line}
diff --git a/src/sh2.less b/src/sh2.less index 8c811672b..fb9267ba2 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -399,6 +399,11 @@ html, body, #main { background-color: #555; } + &.ephemeral { + opacity: 0.5; + outline: 1px solid white; + } + &.status-error { .status-icon { color: #cc0000; @@ -467,13 +472,15 @@ body .xterm .xterm-viewport { overflow-y: auto; } -.xterm-viewport::-webkit-scrollbar { - background-color: #777; - width: 5px; -} +.cmd-input-info, .xterm-viewport { + &::-webkit-scrollbar { + background-color: #777; + width: 5px; + } -.xterm-viewport::-webkit-scrollbar-thumb { - background: white; + &::-webkit-scrollbar-thumb { + background: white; + } } .line.line-invalid { @@ -491,6 +498,10 @@ body .xterm .xterm-viewport { padding-top: 10px; padding-right: 0px; flex-grow: 1; + + .line:first-child { + padding-top: 1px; + } } .cmd-input { @@ -499,6 +510,9 @@ body .xterm .xterm-viewport { border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; border-bottom-right-radius: 10px; + max-height: max(300px, 40%); + display: flex; + flex-direction: column; &.has-info { padding-top: 5px; @@ -535,6 +549,9 @@ body .xterm .xterm-viewport { } .cmd-input-info { + flex-shrink: 1; + overflow-y: auto; + .info-msg { font-family: 'JetBrains Mono', monospace; font-weight: 400; diff --git a/src/types.ts b/src/types.ts index 64b46abd6..27440b068 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,6 +23,7 @@ type LineType = { linetype : string, text : string, cmdid : string, + ephemeral? : boolean, remove? : boolean, };