manual minmax control for infomsg box

This commit is contained in:
sawka 2022-09-16 16:37:54 -07:00
parent 1d3d19b7c3
commit fb51263ed3
2 changed files with 25 additions and 0 deletions

View File

@ -944,6 +944,12 @@ class HistoryInfo extends React.Component<{}, {}> {
@mobxReact.observer
class CmdInput extends React.Component<{}, {}> {
@boundMethod
onInfoToggle() : void {
GlobalModel.inputModel.toggleInfoMsg();
return;
}
render() {
let model = GlobalModel;
let inputModel = model.inputModel;
@ -964,8 +970,17 @@ class CmdInput extends React.Component<{}, {}> {
let cwdStr = getCwdStr(remote, remoteState);
let infoShow = inputModel.infoShow.get();
let historyShow = !infoShow && inputModel.historyShow.get();
let hasInfo = (inputModel.infoMsg.get() != null);
return (
<div className={cn("box cmd-input has-background-black", {"has-info": infoShow}, {"has-history": historyShow})}>
<div onClick={this.onInfoToggle} className="input-minmax-control">
<If condition={infoShow || historyShow}>
<i className="fa fa-chevron-down"/>
</If>
<If condition={!(infoShow || historyShow) && hasInfo}>
<i className="fa fa-chevron-up"/>
</If>
</div>
<If condition={historyShow}>
<div className="cmd-input-grow-spacer"></div>
<HistoryInfo/>

View File

@ -637,6 +637,16 @@ body .xterm .xterm-viewport {
height: max(300px, 40%);
}
.input-minmax-control {
position: absolute;
top: 5px;
right: 5px;
color: @term-white;
font-size: 12px;
padding: 5px;
cursor: pointer;
}
.cmd-input-grow-spacer {
flex-grow: 1;
}