hover linesettings

This commit is contained in:
sawka 2023-03-17 15:12:34 -07:00
parent f7e81b14ae
commit fc5900122d
2 changed files with 29 additions and 2 deletions

View File

@ -108,7 +108,7 @@ class LineAvatar extends React.Component<{line : LineType, cmd : Cmd}, {}> {
let {line} = this.props;
if (line != null) {
mobx.action(() => {
GlobalModel.lineSettingsModal.set(this.props.line);
GlobalModel.lineSettingsModal.set(line);
})();
}
}
@ -440,6 +440,18 @@ class LineCmd extends React.Component<{screen : LineContainerModel, line : LineT
);
}
@boundMethod
handleLineSettings(e : any) : void {
e.preventDefault();
e.stopPropagation();
let {line} = this.props;
if (line != null) {
mobx.action(() => {
GlobalModel.lineSettingsModal.set(line);
})();
}
}
renderMetaWrap(cmd : Cmd) {
let {line} = this.props;
let model = GlobalModel;
@ -458,6 +470,9 @@ class LineCmd extends React.Component<{screen : LineContainerModel, line : LineT
<div className="termopts">
({termOpts.rows}x{termOpts.cols})
</div>
<div className="settings" onClick={this.handleLineSettings}>
<i className="fa-sharp fa-solid fa-gear"/>
</div>
</div>
{this.renderCmdText(cmd, remote)}
</div>

View File

@ -1451,6 +1451,10 @@ body::-webkit-scrollbar {
display: block;
}
&:hover .meta .settings {
display: block;
}
.avatar {
max-height: 38px;
width: 38px;
@ -1581,8 +1585,16 @@ body::-webkit-scrollbar {
}
}
.settings {
display: none;
color: #aaa;
font-size: 11px;
margin-left: 5px;
margin-top: 5px;
cursor: pointer;
}
.termopts {
display: flex;
color: #aaa;
margin-top: 5px;
.mono-font(11px);